Changeset 514 in Sophya for trunk/SophyaLib/NTools/linfit.cc


Ignore:
Timestamp:
Oct 25, 1999, 6:43:04 PM (26 years ago)
Author:
ansari
Message:

elimination des OVector/OMatrix au profit des TVector/TMatrix cmv 25/10/99

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/NTools/linfit.cc

    r508 r514  
    22#include "peida.h"
    33#include "linfit.h"
    4 #include "matrix.h"
    5 #include "cvector.h"
    64
    7 double LinFit(const OVector& x, const OVector& y, int nf, double (*f)(int, double),
    8            OVector& c)
     5double LinFit(const Vector& x, const Vector& y, int nf, double (*f)(int, double),
     6           Vector& c)
    97{
    108  int n = x.NElts();
    119  if (n != y.NElts()) THROW(sizeMismatchErr);
    1210 
    13   OMatrix fx(nf, n);
     11  Matrix fx(nf, n);
    1412  for (int i=0; i<nf; i++)
    1513    for (int j=0; j<n; j++)
     
    2119
    2220
    23 double LinFit(const OMatrix& fx, const OVector& y, OVector& c)
     21double LinFit(const Matrix& fx, const Vector& y, Vector& c)
    2422{
    2523  int n = y.NElts();
     
    2826  int nf = fx.NRows();
    2927
    30   OMatrix a(nf,nf);
     28  Matrix a(nf,nf);
    3129
    3230  for (int j=0; j<nf; j++)
     
    3634  c = fx * y;
    3735
    38   if (OMatrix::GausPiv(a,c) == 0) THROW(singMatxErr);
     36  if (Matrix::GausPiv(a,c) == 0) THROW(singMatxErr);
    3937
    4038  double xi2 = 0;
     
    5250
    5351
    54 double LinFit(const OVector& x, const OVector& y, const OVector& errY2, int nf,
    55            double (*f)(int, double), OVector& c, OVector& errC)
     52double LinFit(const Vector& x, const Vector& y, const Vector& errY2, int nf,
     53           double (*f)(int, double), Vector& c, Vector& errC)
    5654{
    5755  int n = x.NElts();
    5856  if (n != y.NElts()) THROW(sizeMismatchErr);
    5957 
    60   OMatrix fx(nf, n);
     58  Matrix fx(nf, n);
    6159  for (int i=0; i<nf; i++)
    6260    for (int j=0; j<n; j++)
     
    6765
    6866
    69 double LinFit(const OMatrix& fx, const OVector& y, const OVector& errY2,
    70            OVector& c, OVector& errC)
     67double LinFit(const Matrix& fx, const Vector& y, const Vector& errY2,
     68           Vector& c, Vector& errC)
    7169{
    7270  int n = y.NElts();
     
    7674  int nf = fx.NRows();
    7775
    78   OMatrix a(nf,nf);
     76  Matrix a(nf,nf);
    7977
    8078  c.Realloc(nf);
     
    8987    }
    9088 
    91   OMatrix d(nf,nf+1);
     89  Matrix d(nf,nf+1);
    9290  for (int k=0; k<nf; k++) {
    9391    double x=0;
     
    9997  }
    10098
    101   if (OMatrix::GausPiv(a,d) == 0) THROW(singMatxErr);
     99  if (Matrix::GausPiv(a,d) == 0) THROW(singMatxErr);
    102100
    103101  for (int l=0; l<nf; l++) {
Note: See TracChangeset for help on using the changeset viewer.