#include "machdefs.h" #include "peida.h" #include "sopemtx.h" #include "linfit.h" LinFitter::LinFitter() { } LinFitter::~LinFitter() { } double LinFitter::LinFit(const Vector& x, const Vector& y, int nf, double (*f)(int, double), Vector& c) { int n = x.NElts(); if (n != y.NElts()) THROW(sizeMismatchErr); Matrix fx(nf, n); for (int i=0; i::Row(const_cast(fx), j) * TMatrixRC::Row(const_cast(fx), k); /* $CHECK$ Reza 10/3/2000 */ c = fx * y; if (SimpleMatrixOperation::GausPiv(a,c) == 0) THROW(singMatxErr); /* $CHECK$ Reza 10/3/2000 */ double xi2 = 0; for (int k=0; k::GausPiv(a,d) == 0) THROW(singMatxErr); /* $CHECK$ Reza 10/3/2000 */ for (int l=0; l