Changeset 1207 in Sophya for trunk/SophyaPI/PIext/nomgfdadapter.cc
- Timestamp:
- Sep 29, 2000, 4:26:15 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/nomgfdadapter.cc
r1165 r1207 7 7 #include "nomgfdadapter.h" 8 8 #include "pipodrw.h" 9 10 #ifndef SANS_EVOLPLANCK 11 #include "objfitter.h" 12 #endif 9 13 10 14 //------------------------------------------------------------------------- … … 70 74 } 71 75 76 /* --Methode-- */ 77 GeneralFitData* NOMAdapter_GeneralFitData::GetGeneralFitData(bool& adel 78 ,GeneralFitData::FitErrType errtype,double errscale,double errmin 79 ,int i1,int i2,int j1,int j2) 80 { 81 adel = false; 82 if(!mG) return(NULL); 83 84 int n = mG->NData(); 85 if(n<=0) return(NULL); 86 int nv = mG->NVar(); 87 if(nv<=0) return(NULL); 88 89 i1 = (i1<0||i1>=n)? 0: i1; 90 i2 = (i2<0||i2>=n||i2<i1)? n-1: i2; 91 n = i2-i1+1; 92 93 // Pas de gestion des erreurs sur les Abscisses Xi 94 GeneralFitData* mGData = new GeneralFitData(nv,n,0); 95 adel = true; 96 97 double *x = new double[nv]; 98 for(int i=i1;i<=i2;i++) { 99 for(int j=0;j<nv;j++) x[j] = mG->Absc(j,i); 100 double f = mG->Val(i); 101 double e = mG->EVal(i); 102 e = GeneralFitData::ComputeError(f,e,errtype,errscale,errmin); 103 mGData->AddData(x,f,e); 104 if(!mG->IsValid(i)) mGData->KillData(i); 105 } 106 delete [] x; 107 108 return mGData; 109 } 110 111 AnyDataObj* NOMAdapter_GeneralFitData::FitResidusObj(GeneralFit& mfit) 112 { 113 GeneralFitData* g = NULL; 114 #ifdef SANS_EVOLPLANCK 115 g = mG->FitResidus(mfit); 116 #else 117 g = new GeneralFitData(ObjectFitter::FitResidus(*mG,mfit)); 118 #endif 119 return g; 120 } 121 122 AnyDataObj* NOMAdapter_GeneralFitData::FitFunctionObj(GeneralFit& mfit) 123 { 124 GeneralFitData* g = NULL; 125 #ifdef SANS_EVOLPLANCK 126 g = mG->FitFunction(mfit); 127 #else 128 g = new GeneralFitData(ObjectFitter::FitFunction(*mG,mfit)); 129 #endif 130 return g; 131 }
Note:
See TracChangeset
for help on using the changeset viewer.