numeric

C++ library with numerical algorithms
git clone git://src.adamsgaard.dk/numeric # fast
git clone https://src.adamsgaard.dk/numeric.git # slow
Log | Files | Refs | README | LICENSE Back to index

lsfit.h (791B)


      1 // Make sure header is only included once per object
      2 #ifndef LSFIT_H_
      3 #define LSFIT_H_
      4 
      5 #include <armadillo>
      6 #include "header.h"
      7 
      8 // lsfit structure
      9 class LSfit {
     10   private:
     11     const Lengthtype n; // Input data count
     12     const Lengthtype m; // Fitting function count
     13 
     14     // Covariance matrix
     15     arma::Mat<Floattype> A;
     16 
     17     // Data points
     18     arma::Col<Floattype> b;
     19 
     20     // Fitting coefficients
     21     arma::Col<Floattype> c;
     22 
     23     // Evaluate fitting function i at x
     24     Floattype fitfuncts(char i, Floattype x); 
     25 
     26   public:
     27 
     28     // Constructor. Arguments: input data points
     29     LSfit(arma::Col<Floattype> &x,
     30 	  arma::Col<Floattype> &y,
     31 	  arma::Col<Floattype> &delta_y);
     32 
     33     // Destructor
     34     //~LSfit();
     35     
     36     // Return value fitted at x
     37     Floattype eval(Floattype x);
     38 
     39 };
     40 
     41 #endif