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

version 1.14version 1.15
Line 1
Line 1
 // -*- c++ -*- // -*- c++ -*-
  
  // This file is part of the Collective Variables module (Colvars).
  // The original version of Colvars and its updates are located at:
  // https://github.com/colvars/colvars
  // Please update all Colvars source files before making any changes.
  // If you wish to distribute your changes, please submit them to the
  // Colvars repository at GitHub.
  
 #ifndef COLVARVALUE_H #ifndef COLVARVALUE_H
 #define COLVARVALUE_H #define COLVARVALUE_H
  
Line 128
Line 135
   {}   {}
  
   /// \brief Copy constructor from rvector base type (Note: this sets   /// \brief Copy constructor from rvector base type (Note: this sets
   /// automatically a type \link type_3vector \endlink , if you want a   /// by default a type \link type_3vector \endlink , if you want a
   /// \link type_unit3vector \endlink you must set it explicitly)   /// \link type_unit3vector \endlink you must set it explicitly)
   inline colvarvalue(cvm::rvector const &v)   inline colvarvalue(cvm::rvector const &v, Type vti = type_3vector)
     : value_type(type_3vector), rvector_value(v) 
   {} 
  
   /// \brief Copy constructor from rvector base type (additional 
   /// argument to make possible to choose a \link type_unit3vector 
   /// \endlink 
   inline colvarvalue(cvm::rvector const &v, Type const &vti) 
     : value_type(vti), rvector_value(v)     : value_type(vti), rvector_value(v)
   {}   {}
  
   /// \brief Copy constructor from quaternion base type   /// \brief Copy constructor from quaternion base type
   inline colvarvalue(cvm::quaternion const &q)   inline colvarvalue(cvm::quaternion const &q, Type vti = type_quaternion)
     : value_type(type_quaternion), quaternion_value(q)     : value_type(vti), quaternion_value(q)
   {}   {}
  
    /// Copy constructor from vector1d base type
    colvarvalue(cvm::vector1d<cvm::real> const &v, Type vti = type_vector);
  
   /// Copy constructor from another \link colvarvalue \endlink   /// Copy constructor from another \link colvarvalue \endlink
   colvarvalue(colvarvalue const &x);   colvarvalue(colvarvalue const &x);
  
   /// Copy constructor from vector1d base type 
   colvarvalue(cvm::vector1d<cvm::real> const &v, Type const &vti); 
  
  
   /// Set to the null value for the data type currently defined   /// Set to the null value for the data type currently defined
   void reset();   void reset();
Line 211
Line 211
     return std::sqrt(this->norm2());     return std::sqrt(this->norm2());
   }   }
  
   /// \brief Return the value whose scalar product with this value is 
   /// 1 
   inline colvarvalue inverse() const; 
  
   /// Square distance between this \link colvarvalue \endlink and another   /// Square distance between this \link colvarvalue \endlink and another
   cvm::real dist2(colvarvalue const &x2) const;   cvm::real dist2(colvarvalue const &x2) const;
  
Line 536
Line 532
   }   }
 } }
  
 inline colvarvalue::colvarvalue(cvm::vector1d<cvm::real> const &v, Type const &vti) inline colvarvalue::colvarvalue(cvm::vector1d<cvm::real> const &v, Type vti)
 { {
   if ((vti != type_vector) && (v.size() != num_dimensions(vti))) {   if ((vti != type_vector) && (v.size() != num_dimensions(vti))) {
     cvm::error("Error: trying to initialize a variable of type \""+type_desc(vti)+     cvm::error("Error: trying to initialize a variable of type \""+type_desc(vti)+
Line 620
Line 616
   }   }
  
   if (vt1 != type_notset) {   if (vt1 != type_notset) {
      if (((vt1 == type_unit3vector) &&
           (vt2 == type_unit3vectorderiv)) ||
          ((vt2 == type_unit3vector) &&
           (vt1 == type_unit3vectorderiv)) ||
          ((vt1 == type_quaternion) &&
           (vt2 == type_quaternionderiv)) ||
          ((vt2 == type_quaternion) &&
           (vt1 == type_quaternionderiv))) {
        return COLVARS_OK;
      } else {
     if (vt1 != vt2) {     if (vt1 != vt2) {
       cvm::error("Trying to assign a colvar value with type \""+       cvm::error("Trying to assign a colvar value with type \""+
                  type_desc(vt2)+"\" to one with type \""+                  type_desc(vt2)+"\" to one with type \""+
Line 627
Line 633
       return COLVARS_ERROR;       return COLVARS_ERROR;
     }     }
   }   }
    }
   return COLVARS_OK;   return COLVARS_OK;
 } }
  


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



Made by using version 1.53 of cvs2html