Difference for src/colvartypes.h from version 1.14 to 1.15

version 1.14version 1.15
Line 1
Line 1
 /// -*- c++ -*- // -*- c++ -*-
  
 #ifndef COLVARTYPES_H #ifndef COLVARTYPES_H
 #define COLVARTYPES_H #define COLVARTYPES_H
Line 57
Line 57
     }     }
   }   }
  
    /// Return a reference to the data
    inline std::vector<T> &data_array()
    {
      return data;
    }
  
   inline ~vector1d()   inline ~vector1d()
   {   {
     data.clear();     data.clear();
Line 203
Line 209
     return std::sqrt(this->norm2());     return std::sqrt(this->norm2());
   }   }
  
    inline cvm::real sum() const
    {
      cvm::real result = 0.0;
      size_t i;
      for (i = 0; i < this->size(); i++) {
        result += (*this)[i];
      }
      return result;
    }
  
   /// Slicing   /// Slicing
   inline vector1d<T> const slice(size_t const i1, size_t const i2) const   inline vector1d<T> const slice(size_t const i1, size_t const i2) const
   {   {
Line 295
Line 311
   {   {
     std::stringstream stream(s);     std::stringstream stream(s);
     size_t i = 0;     size_t i = 0;
      if (this->size()) {
     while ((stream >> (*this)[i]) && (i < this->size())) {     while ((stream >> (*this)[i]) && (i < this->size())) {
       i++;       i++;
     }     }
     if (i < this->size()) {     if (i < this->size()) {
       return COLVARS_ERROR;       return COLVARS_ERROR;
     }     }
      } else {
        T input;
        while (stream >> input) {
          if ((i % 100) == 0) {
            data.reserve(data.size()+100);
          }
          data.resize(data.size()+1);
          data[i] = input;
          i++;
        }
      }
     return COLVARS_OK;     return COLVARS_OK;
   }   }
  
Line 434
Line 462
     this->clear();     this->clear();
   }   }
  
    /// Return a reference to the data
    inline std::vector<T> &data_array()
    {
      return data;
    }
  
   inline row & operator [] (size_t const i)   inline row & operator [] (size_t const i)
   {   {
     return rows[i];     return rows[i];


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



Made by using version 1.53 of cvs2html