Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/molecules.cpp

    r1999d8 r54a746  
    77#include "config.hpp"
    88#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 vector
    14  * \param *params
    15  * \return sum of square distances
    16  */
    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 };
    319
    3210/************************************* Functions for class molecule *********************************/
Note: See TracChangeset for help on using the changeset viewer.