Changes in src/molecules.cpp [1999d8:54a746]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/molecules.cpp
r1999d8 r54a746 7 7 #include "config.hpp" 8 8 #include "molecules.hpp" 9 10 /************************************* Other Functions *************************************/11 12 /** Determines sum of squared distances of \a X to all \a **vectors.13 * \param *x reference vector14 * \param *params15 * \return sum of square distances16 */17 double LSQ (const gsl_vector * x, void * params)18 {19 double sum = 0.;20 struct LSQ_params *par = (struct LSQ_params *)params;21 Vector **vectors = par->vectors;22 int num = par->num;23 24 for (int i=num;i--;) {25 for(int j=NDIM;j--;)26 sum += (gsl_vector_get(x,j) - (vectors[i])->x[j])*(gsl_vector_get(x,j) - (vectors[i])->x[j]);27 }28 29 return sum;30 };31 9 32 10 /************************************* Functions for class molecule *********************************/
Note:
See TracChangeset
for help on using the changeset viewer.