Changeset 301 in Sophya for trunk/SophyaLib
- Timestamp:
- May 18, 1999, 2:23:15 PM (26 years ago)
- Location:
- trunk/SophyaLib/NTools
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/NTools/tmatrix.cc
r299 r301 1 // $Id: tmatrix.cc,v 1. 5 1999-05-17 17:16:43 ansari Exp $1 // $Id: tmatrix.cc,v 1.6 1999-05-18 12:23:13 ansari Exp $ 2 2 // C.Magneville 04/99 3 3 #include "machdefs.h" … … 66 66 TMatrix<T> a; a.Clone(*this); a.SetTemp(true); 67 67 a.mNr = mNc; a.mNc = mNr; 68 {for( inti=0; i<mNr; i++)69 for( intj=0; j<mNc; j++) {68 {for(uint_4 i=0; i<mNr; i++) 69 for(uint_4 j=0; j<mNc; j++) { 70 70 a(j,i) = (*this)(i,j); 71 71 }} … … 187 187 ////////////////////////////////////////////////////////// 188 188 //**** Residus des fits 189 TMatrix<r_8> TMatrix<r_8>::FitResidus(GeneralFit& gfit) 190 // Retourne une classe contenant les residus du fit ``gfit''. 191 // On suppose que x=j (colonnes) et y=i (lignes) pour m(i,j). 189 TMatrix<r_8> TMatrix<r_8>::FitResidus(GeneralFit& gfit 190 ,double xorg,double yorg,double dx,double dy) 191 // Retourne une classe contenant les residus du fit ``gfit''. 192 // On suppose que x=j (colonnes) et y=i (lignes) pour m(i,j). 193 // Les coordonnees de l'element (i,j) sont : 194 // (i,j) -> x = xorg+j*dx , y = yorg+i*dy 192 195 { 193 196 if(NCols()<=0||NRows()<=0) … … 202 205 {for(int i=0;i<npar;i++) par[i] = gfit.GetParm(i);} 203 206 TMatrix<r_8> m(*this); 204 for( int i=0;i<NRows();i++) for(intj=0;j<NCols();j++) {205 double x[2] = { (double)j,(double)i}; // attention x=col y=row!!207 for(uint_4 i=0;i<NRows();i++) for(uint_4 j=0;j<NCols();j++) { 208 double x[2] = {xorg+j*dx,yorg+i*dy}; 206 209 m(i,j) -= f->Value(x,par); 207 210 } … … 210 213 } 211 214 212 TMatrix<r_8> TMatrix<r_8>::FitFunction(GeneralFit& gfit) 213 // Retourne une classe contenant la fonction du fit ``gfit''. 214 // On suppose que x=j (colonnes) et y=i (lignes) pour m(i,j). 215 TMatrix<r_8> TMatrix<r_8>::FitFunction(GeneralFit& gfit 216 ,double xorg,double yorg,double dx,double dy) 217 // Retourne une classe contenant la fonction du fit ``gfit''. 218 // On suppose que x=j (colonnes) et y=i (lignes) pour m(i,j). 219 // Les coordonnees de l'element (i,j) sont : 220 // (i,j) -> x = xorg + j*dx , y = yorg + i*dy 215 221 { 216 222 if(NCols()<=0||NRows()<=0) … … 225 231 {for(int i=0;i<npar;i++) par[i] = gfit.GetParm(i);} 226 232 TMatrix<r_8> m(*this); 227 for( int i=0;i<NRows();i++) for(intj=0;j<NCols();j++) {228 double x[2] = { (double)j,(double)i};233 for(uint_4 i=0;i<NRows();i++) for(uint_4 j=0;j<NCols();j++) { 234 double x[2] = {xorg+j*dx,yorg+i*dy}; 229 235 m(i,j) = f->Value(x,par); 230 236 } -
trunk/SophyaLib/NTools/tmatrix.h
r299 r301 100 100 101 101 // Residus et fonction fittees. 102 TMatrix<T> FitResidus(GeneralFit& gfit); 103 TMatrix<T> FitFunction(GeneralFit& gfit); 102 TMatrix<T> FitResidus(GeneralFit& gfit 103 ,double xorg=0.,double yorg=0.,double dx=1.,double dy=1.); 104 TMatrix<T> FitFunction(GeneralFit& gfit 105 ,double xorg=0.,double yorg=0.,double dx=1.,double dy=1.); 104 106 105 107 protected: -
trunk/SophyaLib/NTools/tvector.cc
r299 r301 1 // $Id: tvector.cc,v 1. 1 1999-05-17 17:16:44ansari Exp $1 // $Id: tvector.cc,v 1.2 1999-05-18 12:23:15 ansari Exp $ 2 2 // C.Magneville 04/99 3 3 #include "machdefs.h" … … 53 53 ////////////////////////////////////////////////////////// 54 54 //**** Residus des fits 55 TVector<r_8> TVector<r_8>::FitResidus(GeneralFit& gfit )56 // 57 // On suppose que x=i.55 TVector<r_8> TVector<r_8>::FitResidus(GeneralFit& gfit,double xorg,double dx) 56 // Retourne une classe contenant les residus du fit ``gfit''. 57 // La coordonnee de l'element (i) est -> x = xorg + i*dx 58 58 { 59 59 if(NElts()<=0) … … 69 69 TVector<r_8> v(*this); 70 70 for(int i=0;i<NElts();i++) { 71 double x = (double)i;71 double x = xorg+i*dx; 72 72 v(i) -= f->Value(&x,par); 73 73 } … … 76 76 } 77 77 78 TVector<r_8> TVector<r_8>::FitFunction(GeneralFit& gfit )79 // 80 // On suppose que x=i.78 TVector<r_8> TVector<r_8>::FitFunction(GeneralFit& gfit,double xorg,double dx) 79 // Retourne une classe contenant la fonction du fit ``gfit''. 80 // La coordonnee de l'element (i) est -> x = xorg + i*dx 81 81 { 82 82 if(NElts()<=0) … … 91 91 {for(int i=0;i<npar;i++) par[i] = gfit.GetParm(i);} 92 92 TVector<r_8> v(*this); 93 for( inti=0;i<NElts();i++) {94 double x = (double)i;93 for(uint_4 i=0;i<NElts();i++) { 94 double x = xorg+i*dx; 95 95 v(i) = f->Value(&x,par); 96 96 } -
trunk/SophyaLib/NTools/tvector.h
r299 r301 37 37 38 38 // Residus et fonction fittees. 39 TVector<T> FitResidus(GeneralFit& gfit );40 TVector<T> FitFunction(GeneralFit& gfit );39 TVector<T> FitResidus(GeneralFit& gfit,double xorg=0.,double dx=1.); 40 TVector<T> FitFunction(GeneralFit& gfit,double xorg=0.,double dx=1.); 41 41 42 42 };
Note:
See TracChangeset
for help on using the changeset viewer.