Difference for src/colvargrid.h from version 1.15 to 1.16

version 1.15version 1.16
Line 378
Line 378
     return value_to_bin_scalar(actual_value[i] ? cv[i]->actual_value() : cv[i]->value(), i);     return value_to_bin_scalar(actual_value[i] ? cv[i]->actual_value() : cv[i]->value(), i);
   }   }
  
    /// \brief Report the bin corresponding to the current value of variable i
    /// and assign first or last bin if out of boundaries
    inline int current_bin_scalar_bound(int const i) const
    {
      return value_to_bin_scalar_bound(actual_value[i] ? cv[i]->actual_value() : cv[i]->value(), i);
    }
  
   /// \brief Report the bin corresponding to the current value of item iv in variable i   /// \brief Report the bin corresponding to the current value of item iv in variable i
   inline int current_bin_scalar(int const i, int const iv) const   inline int current_bin_scalar(int const i, int const iv) const
   {   {
Line 393
Line 400
     return (int) std::floor( (value.real_value - lower_boundaries[i].real_value) / widths[i] );     return (int) std::floor( (value.real_value - lower_boundaries[i].real_value) / widths[i] );
   }   }
  
    /// \brief Use the lower boundary and the width to report which bin
    /// the provided value is in and assign first or last bin if out of boundaries
    inline int value_to_bin_scalar_bound(colvarvalue const &value, const int i) const
    {
      int bin_index = std::floor( (value.real_value - lower_boundaries[i].real_value) / widths[i] );
      if (bin_index < 0) bin_index=0;
      if (bin_index >=int(nx[i])) bin_index=int(nx[i])-1;
      return (int) bin_index;
    }
  
   /// \brief Same as the standard version, but uses another grid definition   /// \brief Same as the standard version, but uses another grid definition
   inline int value_to_bin_scalar(colvarvalue const &value,   inline int value_to_bin_scalar(colvarvalue const &value,
                                  colvarvalue const &new_offset,                                  colvarvalue const &new_offset,
Line 514
Line 531
       data[i] *= a;       data[i] *= a;
   }   }
  
    /// \brief Assign all zero elements a scalar constant (fast loop)
    inline void remove_zeros(cvm::real const &a)
    {
      for (size_t i = 0; i < nt; i++)
        if(data[i]==0) data[i] = a;
    }
  
  
   /// \brief Get the bin indices corresponding to the provided values of   /// \brief Get the bin indices corresponding to the provided values of
   /// the colvars   /// the colvars
Line 537
Line 561
     return index;     return index;
   }   }
  
    /// \brief Get the bin indices corresponding to the provided values of
    /// the colvars and assign first or last bin if out of boundaries
    inline std::vector<int> const get_colvars_index_bound() const
    {
      std::vector<int> index = new_index();
      for (size_t i = 0; i < nd; i++) {
        index[i] = current_bin_scalar_bound(i);
      }
      return index;
    }
  
   /// \brief Get the minimal distance (in number of bins) from the   /// \brief Get the minimal distance (in number of bins) from the
   /// boundaries; a negative number is returned if the given point is   /// boundaries; a negative number is returned if the given point is
   /// off-grid   /// off-grid
Line 1071
Line 1106
   {   {
     // write the header     // write the header
     os << "object 1 class gridpositions counts";     os << "object 1 class gridpositions counts";
     int icv;     size_t icv;
     for (icv = 0; icv < number_of_colvars(); icv++) {     for (icv = 0; icv < number_of_colvars(); icv++) {
       os << " " << number_of_points(icv);       os << " " << number_of_points(icv);
     }     }
Line 1166
Line 1201
  
   /// \brief Return the log-gradient from finite differences   /// \brief Return the log-gradient from finite differences
   /// on the *same* grid for dimension n   /// on the *same* grid for dimension n
   inline const cvm::real log_gradient_finite_diff( const std::vector<int> &ix0,   inline cvm::real log_gradient_finite_diff(const std::vector<int> &ix0,
                                                    int n = 0)                                                    int n = 0)
   {   {
     cvm::real A0, A1;     cvm::real A0, A1;
Line 1322
Line 1357
   /// \brief Return the lowest value   /// \brief Return the lowest value
   cvm::real minimum_value() const;   cvm::real minimum_value() const;
  
    /// \brief Return the lowest positive value
    cvm::real minimum_pos_value() const;
  
   /// \brief Calculates the integral of the map (uses widths if they are defined)   /// \brief Calculates the integral of the map (uses widths if they are defined)
   cvm::real integral() const;   cvm::real integral() const;
  


Legend:
Removed in v.1.15 
changed lines
 Added in v.1.16



Made by using version 1.53 of cvs2html