Changeset 3572 in Sophya for trunk/SophyaLib
- Timestamp:
- Feb 7, 2009, 10:50:34 PM (17 years ago)
- Location:
- trunk/SophyaLib
- Files:
-
- 2 deleted
- 49 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/BaseTools/dvlist.cc
r3233 r3572 115 115 /* --Methode-- */ 116 116 /*! Copy constructor - Object initialized using the PPF file \b flnm */ 117 DVList::DVList(c har *flnm)117 DVList::DVList(const char *flnm) 118 118 { 119 119 PInPersist s(flnm); … … 192 192 // int_8 GetI(string const& key, int_8 def=-1) 193 193 // r_8 GetD(string const& key, r_8 def=-9.e19) 194 // string GetS(string const& key, c har* def="")194 // string GetS(string const& key, const char* def="") 195 195 // Retourne la valeur de la variable de nom "key" et de type entier, réél, 196 196 // chaine de caracteres. … … 245 245 /*! Returns the value corresponding to name \b key, converted to string 246 246 Default value \b def is returned if name \b key not found */ 247 string DVList::GetS(string const& key, c har* def) const247 string DVList::GetS(string const& key, const char* def) const 248 248 { 249 249 ValList::const_iterator it = mvlist.find(key); … … 265 265 // void SetD(string const& key, r_8 val) 266 266 // void SetZ(string const& key, complex<r_8> val) 267 // void SetS(string const& key, c har* val)267 // void SetS(string const& key, const char* val) 268 268 // void SetS(string const& key, string val) 269 269 // Crée la variable de nom "key", de type entier, double, complexe, string et … … 322 322 /* --Methode-- */ 323 323 /*! Appends or sets the string value \b val in the list with name \b key */ 324 void DVList::SetS(string const& key, c har const* val)324 void DVList::SetS(string const& key, const char * val) 325 325 { 326 326 MuTyV div(val); -
trunk/SophyaLib/BaseTools/dvlist.h
r2826 r3572 25 25 DVList(); 26 26 DVList(const DVList&); 27 DVList(c har *flnm);27 DVList(const char *flnm); 28 28 29 29 virtual ~DVList(); … … 35 35 36 36 //! Returns the number of elements (variables) in DVList object 37 inline int Size(){ return(mvlist.size()); }37 inline size_t Size() const { return(mvlist.size()); } 38 38 //! Returns the number of elements (variables) in DVList object 39 inline int NVar(){ return(mvlist.size()); }39 inline size_t NVar() const { return(mvlist.size()); } 40 40 41 41 int_8 GetI(string const& key, int_8 def=-1) const; 42 42 r_8 GetD(string const& key, r_8 def=-9.e19) const; 43 43 complex<r_8> GetZ(string const& key, complex<r_8> def=-9.e19) const; 44 string GetS(string const& key, c har* def="") const;44 string GetS(string const& key, const char* def="") const; 45 45 string GetComment(string const& key) const; 46 46 … … 51 51 void SetD(string const& key, r_8 val); 52 52 void SetZ(string const& key, complex<r_8> val); 53 void SetS(string const& key, c har const* val);53 void SetS(string const& key, const char * val); 54 54 void SetS(string const& key, string const& val); 55 55 void SetT(string const& key, TimeStamp const& val); -
trunk/SophyaLib/BaseTools/ppfbinstream.cc
r3525 r3572 511 511 GetI8(i8); // nb objets toplevel 512 512 GetU8(ui8); // nb de nametag 513 for( intkt=0; kt<ui8; kt++) {513 for(uint_8 kt=0; kt<ui8; kt++) { 514 514 GetRawI4(i4); 515 515 s->seekg(i4,ios::cur); … … 994 994 int_4 tsz; 995 995 GetRawI4(tsz); 996 if (tsz != sz)996 if (tsz != (int_4)sz) 997 997 throw FileFormatExc("PPFBinaryInputStream::GetPosTagTable Size mismatch "); 998 998 for(int kk=0; kk<tsz; kk++) … … 1036 1036 // Pour indenter lors de l'impression 1037 1037 #define _MXINDENT_ 10 1038 c har * indents[_MXINDENT_+1] = {""," ", " ", " ", " ", " ",1038 const char * indents[_MXINDENT_+1] = {""," ", " ", " ", " ", " ", 1039 1039 " ", " ", " ", 1040 1040 " ", " "}; … … 1150 1150 GetI8s(stats,8); 1151 1151 GetRawU8(ui8); // nb de nametag 1152 for( intkt=0; kt<ui8; kt++) {1152 for(uint_8 kt=0; kt<ui8; kt++) { 1153 1153 string tname; 1154 1154 GetRawI8(i8); -
trunk/SophyaLib/BaseTools/sophyainit.cc
r3532 r3572 193 193 double SophyaInitiator::GetVersion(string& svers) 194 194 { 195 c har* compiler = 0;195 const char* compiler = 0; 196 196 #ifdef __GNUG__ 197 197 compiler = "gcc " __VERSION__; -
trunk/SophyaLib/BaseTools/sversion.h
r3532 r3572 3 3 4 4 #define SOPHYA_VERSION 2.1 5 #define SOPHYA_REVISION 256 #define SOPHYA_TAG "V_ Sep2008"5 #define SOPHYA_REVISION 30 6 #define SOPHYA_TAG "V_Fev2009" 7 7 8 8 #endif -
trunk/SophyaLib/HiStats/Makefile
r3407 r3572 4 4 5 5 clean: 6 rm -f $(SOPHYAOBJP)basedtable.o $(SOPHYAOBJP)datatable.o $(SOPHYAOBJP)fio_dtable.o $(SOPHYAOBJP)hisprof.o $(SOPHYAOBJP)hist2err.o $(SOPHYAOBJP)histerr.o $(SOPHYAOBJP)histinit.o $(SOPHYAOBJP)histos.o $(SOPHYAOBJP)histos2.o $(SOPHYAOBJP)ntupintf.o $(SOPHYAOBJP)ntuple.o $(SOPHYAOBJP)proxtuple.o $(SOPHYAOBJP)swppfdtable.o $(SOPHYAOBJP)xntuple.o6 rm -f $(SOPHYAOBJP)basedtable.o $(SOPHYAOBJP)datatable.o $(SOPHYAOBJP)fio_dtable.o $(SOPHYAOBJP)hisprof.o $(SOPHYAOBJP)hist2err.o $(SOPHYAOBJP)histerr.o $(SOPHYAOBJP)histinit.o $(SOPHYAOBJP)histos.o $(SOPHYAOBJP)histos2.o $(SOPHYAOBJP)ntupintf.o $(SOPHYAOBJP)ntuple.o $(SOPHYAOBJP)proxtuple.o $(SOPHYAOBJP)swppfdtable.o 7 7 rm -f $(SOPHYALIBP)libHiStats.a 8 8 9 $(SOPHYALIBP)libHiStats.a : $(SOPHYAOBJP)basedtable.o $(SOPHYAOBJP)datatable.o $(SOPHYAOBJP)fio_dtable.o $(SOPHYAOBJP)hisprof.o $(SOPHYAOBJP)hist2err.o $(SOPHYAOBJP)histerr.o $(SOPHYAOBJP)histinit.o $(SOPHYAOBJP)histos2.o $(SOPHYAOBJP)histos.o $(SOPHYAOBJP)ntupintf.o $(SOPHYAOBJP)ntuple.o $(SOPHYAOBJP)proxtuple.o $(SOPHYAOBJP)swppfdtable.o $(SOPHYAOBJP)xntuple.o9 $(SOPHYALIBP)libHiStats.a : $(SOPHYAOBJP)basedtable.o $(SOPHYAOBJP)datatable.o $(SOPHYAOBJP)fio_dtable.o $(SOPHYAOBJP)hisprof.o $(SOPHYAOBJP)hist2err.o $(SOPHYAOBJP)histerr.o $(SOPHYAOBJP)histinit.o $(SOPHYAOBJP)histos2.o $(SOPHYAOBJP)histos.o $(SOPHYAOBJP)ntupintf.o $(SOPHYAOBJP)ntuple.o $(SOPHYAOBJP)proxtuple.o $(SOPHYAOBJP)swppfdtable.o 10 10 $(AR) $(ARFLAGS) $@ $? 11 11 touch $(SOPHYAINCP)/SophyaConfInfo/libsophya.objlist … … 228 228 $(SOPHYAINCP)utils.h hisprof.h histerr.h \ 229 229 hist2err.h $(SOPHYAINCP)tmatrix.h ntuple.h \ 230 ntupintf.h $(SOPHYAINCP)dvlist.h xntuple.h \ 231 datatable.h basedtable.h \ 232 $(SOPHYAINCP)segdatablock.h \ 230 ntupintf.h $(SOPHYAINCP)dvlist.h datatable.h \ 231 basedtable.h $(SOPHYAINCP)segdatablock.h \ 233 232 $(SOPHYAINCP)thsafeop.h swppfdtable.h \ 234 233 $(SOPHYAINCP)swsegdb.h \ … … 384 383 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ swppfdtable.cc 385 384 386 $(SOPHYAOBJP)xntuple.o: xntuple.cc $(SOPHYAINCP)ppersist.h \387 $(SOPHYAINCP)machdefs.h \388 $(SOPHYAINCP)pexceptions.h \389 $(SOPHYAINCP)gnumd5.h \390 $(SOPHYAINCP)ppfbinstream.h \391 $(SOPHYAINCP)rawstream.h \392 $(SOPHYAINCP)ppfnametag.h \393 $(SOPHYAINCP)ppersist.h \394 $(SOPHYAINCP)perrors.h xntuple.h \395 $(SOPHYAINCP)machdefs.h ntupintf.h \396 $(SOPHYAINCP)dvlist.h \397 $(SOPHYAINCP)objfio.h \398 $(SOPHYAINCP)anydataobj.h \399 $(SOPHYAINCP)mutyv.h \400 $(SOPHYAINCP)timestamp.h \401 $(SOPHYAINCP)objfio.h402 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ xntuple.cc403 -
trunk/SophyaLib/HiStats/histats.h
r3140 r3572 9 9 #include "hist2err.h" 10 10 #include "ntuple.h" 11 #include "xntuple.h"12 11 #include "datatable.h" 13 12 #include "swppfdtable.h" -
trunk/SophyaLib/HiStats/histinit.cc
r3169 r3572 12 12 #include "hist2err.h" 13 13 #include "ntuple.h" 14 #include "xntuple.h"15 14 #include "datatable.h" 16 15 #include "swppfdtable.h" … … 39 38 - Histo2DErr 40 39 - NTuple 41 - XNTuple42 40 - DataTable 43 41 - SwPPFDataTable … … 70 68 PPRegister(ObjFileIO<NTuple>); 71 69 DObjRegister(ObjFileIO<NTuple>, NTuple); 72 PPRegister(ObjFileIO<XNTuple>);73 DObjRegister(ObjFileIO<XNTuple>, XNTuple);74 70 75 71 PPRegister(ObjFileIO<BaseDataTable>); -
trunk/SophyaLib/HiStats/histos.cc
r3236 r3572 1550 1550 1551 1551 // Ecriture entete pour identifier facilement 1552 sprintf(strg,"V_2 mBins=%6d NEnt=%15 derrok=%1d",dobj->mBins,dobj->nEntries,errok);1552 sprintf(strg,"V_2 mBins=%6d NEnt=%15llu errok=%1d",dobj->mBins,dobj->nEntries,errok); 1553 1553 os.PutLine(strg); 1554 1554 sprintf(strg,"binw=%g mMin=%g mMax=%g",dobj->binWidth,dobj->mMin,dobj->mMax); -
trunk/SophyaLib/HiStats/ntuple.cc
r3392 r3572 26 26 #include "ntuple.h" 27 27 // ... 28 c har * names[3] = {"XPos", "YPos", "Val"};28 const char * names[3] = {"XPos", "YPos", "Val"}; 29 29 // NTuple (Table) creation with 3 columns (double precision) 30 30 NTuple nt(3, names); … … 73 73 74 74 75 //! Constructor with specification of number of columns and column name 75 //! Constructor with specification of number of columns and column names 76 76 /*! 77 77 \param nvar : Number of columns in the table 78 \param noms : Array of column names (length(name) < 8 characters)78 \param noms : Array of column names 79 79 \param blk : Optional argument specifying number of table lines 80 80 in a given data block … … 90 90 //-- 91 91 { 92 mNVar = mNEnt = mBlk = mNBlk = 0; 93 mVar = NULL; 94 mVarD = NULL; 95 mInfo = NULL; 96 mThS = NULL; 97 if (nvar <= 0) throw ParmError("NTuple::NTuple(nvar<=0) "); 98 mNVar = nvar; 99 mVar = new r_4[nvar]; 100 mVarD = new r_8[nvar]; 101 if (blk < 10) blk = 10; 102 mBlk = blk; 103 104 if (fgdouble) { 105 r_8* pt = new r_8[nvar*blk]; 106 mNBlk = 1; 107 mPtrD.push_back(pt); 108 mFgDouble = true; 109 } 110 else { 111 r_4* pt = new r_4[nvar*blk]; 112 mNBlk = 1; 113 mPtr.push_back(pt); 114 mFgDouble = false; 115 } 92 if (nvar <= 0) throw ParmError("NTuple::NTuple(nvar<=0) with char** noms"); 93 Initialize(nvar,blk,fgdouble); 116 94 for(int i=0; i<nvar; i++) mNames.push_back(noms[i]); 117 95 return; 118 96 } 119 97 120 //! Constructor with specification of number of columns and column name 98 99 //! Constructor with specification of number of columns and column names 100 /*! 101 \param nvar : Number of columns in the table 102 \param noms : Array of column names 103 \param blk : Optional argument specifying number of table lines 104 in a given data block 105 \param fgdouble : if \b true: internal data kept as double precision values (r_8), 106 simple precision (r_4) otherwise 107 */ 108 //++ 109 NTuple::NTuple(int nvar, const char** noms, int blk, bool fgdouble) 110 // 111 // Createur d'un ntuple de `nvar' variables dont les 112 // noms sont dans le tableau de chaines de caracteres `noms' 113 // avec `blk' d'evenements par blocks. 114 //-- 115 { 116 if (nvar <= 0) throw ParmError("NTuple::NTuple(nvar<=0) with const char** noms"); 117 Initialize(nvar,blk,fgdouble); 118 for(int i=0; i<nvar; i++) mNames.push_back(noms[i]); 119 return; 120 } 121 122 //! Constructor with specification of number of columns and column names as a string vector 121 123 /*! 122 124 \param noms : Array of column names (length(name) < 8 characters) … … 128 130 NTuple::NTuple(vector<string>& noms, int blk, bool fgdouble) 129 131 { 132 int nvar = noms.size(); 133 if (nvar <= 0) throw ParmError("NTuple::NTuple(nvar<=0) with vector<string>& noms"); 134 Initialize(nvar,blk,fgdouble); 135 for(int i=0; i<nvar; i++) mNames.push_back(noms[i]); 136 return; 137 } 138 139 140 /* --Methode-- */ 141 /* Initialisation pour Createurs (fonction privee) */ 142 void NTuple::Initialize(int nvar, int blk, bool fgdouble) 143 { 130 144 mNVar = mNEnt = mBlk = mNBlk = 0; 131 145 mVar = NULL; … … 133 147 mInfo = NULL; 134 148 mThS = NULL; 135 int nvar = noms.size();136 if (nvar <= 0) throw ParmError("NTuple::NTuple(nvar<=0) ");137 149 mNVar = nvar; 138 150 mVar = new r_4[nvar]; … … 153 165 mFgDouble = false; 154 166 } 155 for(int i=0; i<nvar; i++) mNames.push_back(noms[i]); 167 156 168 return; 157 169 } … … 206 218 Clean(); 207 219 } 220 208 221 /* --Methode-- */ 209 222 /*! … … 494 507 //-- 495 508 { 496 c har * tt = "float";509 const char * tt = "float"; 497 510 if (mFgDouble) tt = "double"; 498 511 os << "NTuple T=" << tt << " : NVar= " << mNVar << " NEnt=" << mNEnt -
trunk/SophyaLib/HiStats/ntuple.h
r3392 r3572 30 30 NTuple(); 31 31 NTuple(int nvar, char** noms, int blk=512, bool fgdouble=true); 32 NTuple(int nvar, const char** noms, int blk=512, bool fgdouble=true); 32 33 NTuple(vector<string>& noms, int blk=512, bool fgdouble=true); 33 34 NTuple(const NTuple& NT); … … 96 97 97 98 private: 99 void Initialize(int nvar, int blk, bool fgdouble); 98 100 void Clean(); 99 101 -
trunk/SophyaLib/HiStats/objlist.list
r3121 r3572 12 12 proxtuple.o 13 13 swppfdtable.o 14 xntuple.o -
trunk/SophyaLib/HiStats/proxtuple.cc
r2615 r3572 41 41 if (_tuple==0) { 42 42 char** names=new char* [N]; 43 for (int i=0;i<N;i++) names[i]=const_cast<char *>(_name[i].c_str());43 for (int i=0;i<N;i++) names[i]=const_cast<char *>(_name[i].c_str()); 44 44 _tuple=new NTuple(N,names); 45 45 delete[] names; … … 52 52 _val.clear(); 53 53 54 55 54 } -
trunk/SophyaLib/HiStats/smakefile
r3407 r3572 4 4 5 5 clean: 6 rm -f $(SOPHYAOBJP)basedtable.o $(SOPHYAOBJP)datatable.o $(SOPHYAOBJP)fio_dtable.o $(SOPHYAOBJP)hisprof.o $(SOPHYAOBJP)hist2err.o $(SOPHYAOBJP)histerr.o $(SOPHYAOBJP)histinit.o $(SOPHYAOBJP)histos.o $(SOPHYAOBJP)histos2.o $(SOPHYAOBJP)ntupintf.o $(SOPHYAOBJP)ntuple.o $(SOPHYAOBJP)proxtuple.o $(SOPHYAOBJP)swppfdtable.o $(SOPHYAOBJP)xntuple.o6 rm -f $(SOPHYAOBJP)basedtable.o $(SOPHYAOBJP)datatable.o $(SOPHYAOBJP)fio_dtable.o $(SOPHYAOBJP)hisprof.o $(SOPHYAOBJP)hist2err.o $(SOPHYAOBJP)histerr.o $(SOPHYAOBJP)histinit.o $(SOPHYAOBJP)histos.o $(SOPHYAOBJP)histos2.o $(SOPHYAOBJP)ntupintf.o $(SOPHYAOBJP)ntuple.o $(SOPHYAOBJP)proxtuple.o $(SOPHYAOBJP)swppfdtable.o 7 7 rm -f $(SOPHYALIBP)libHiStats.a 8 8 9 $(SOPHYALIBP)libHiStats.a : $(SOPHYAOBJP)basedtable.o $(SOPHYAOBJP)datatable.o $(SOPHYAOBJP)fio_dtable.o $(SOPHYAOBJP)hisprof.o $(SOPHYAOBJP)hist2err.o $(SOPHYAOBJP)histerr.o $(SOPHYAOBJP)histinit.o $(SOPHYAOBJP)histos2.o $(SOPHYAOBJP)histos.o $(SOPHYAOBJP)ntupintf.o $(SOPHYAOBJP)ntuple.o $(SOPHYAOBJP)proxtuple.o $(SOPHYAOBJP)swppfdtable.o $(SOPHYAOBJP)xntuple.o9 $(SOPHYALIBP)libHiStats.a : $(SOPHYAOBJP)basedtable.o $(SOPHYAOBJP)datatable.o $(SOPHYAOBJP)fio_dtable.o $(SOPHYAOBJP)hisprof.o $(SOPHYAOBJP)hist2err.o $(SOPHYAOBJP)histerr.o $(SOPHYAOBJP)histinit.o $(SOPHYAOBJP)histos2.o $(SOPHYAOBJP)histos.o $(SOPHYAOBJP)ntupintf.o $(SOPHYAOBJP)ntuple.o $(SOPHYAOBJP)proxtuple.o $(SOPHYAOBJP)swppfdtable.o 10 10 $(AR) $(ARFLAGS) $@ $? 11 11 touch $(SOPHYAINCP)/SophyaConfInfo/libsophya.objlist … … 228 228 $(SOPHYAINCP)utils.h hisprof.h histerr.h \ 229 229 hist2err.h $(SOPHYAINCP)tmatrix.h ntuple.h \ 230 ntupintf.h $(SOPHYAINCP)dvlist.h xntuple.h \ 231 datatable.h basedtable.h \ 232 $(SOPHYAINCP)segdatablock.h \ 230 ntupintf.h $(SOPHYAINCP)dvlist.h datatable.h \ 231 basedtable.h $(SOPHYAINCP)segdatablock.h \ 233 232 $(SOPHYAINCP)thsafeop.h swppfdtable.h \ 234 233 $(SOPHYAINCP)swsegdb.h \ … … 384 383 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ swppfdtable.cc 385 384 386 $(SOPHYAOBJP)xntuple.o: xntuple.cc $(SOPHYAINCP)ppersist.h \387 $(SOPHYAINCP)machdefs.h \388 $(SOPHYAINCP)pexceptions.h \389 $(SOPHYAINCP)gnumd5.h \390 $(SOPHYAINCP)ppfbinstream.h \391 $(SOPHYAINCP)rawstream.h \392 $(SOPHYAINCP)ppfnametag.h \393 $(SOPHYAINCP)ppersist.h \394 $(SOPHYAINCP)perrors.h xntuple.h \395 $(SOPHYAINCP)machdefs.h ntupintf.h \396 $(SOPHYAINCP)dvlist.h \397 $(SOPHYAINCP)objfio.h \398 $(SOPHYAINCP)anydataobj.h \399 $(SOPHYAINCP)mutyv.h \400 $(SOPHYAINCP)timestamp.h \401 $(SOPHYAINCP)objfio.h402 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ xntuple.cc403 -
trunk/SophyaLib/NTools/Makefile
r3406 r3572 4 4 5 5 clean: 6 rm -f $(SOPHYAOBJP)FSAppIrrSmpl.o $(SOPHYAOBJP)cimage.o $(SOPHYAOBJP)cspline.o $(SOPHYAOBJP)datatypes.o $(SOPHYAOBJP)dates.o $(SOPHYAOBJP)difeq.o $(SOPHYAOBJP)dynccd.o $(SOPHYAOBJP)fct1dfit.o $(SOPHYAOBJP)fct2dfit.o $(SOPHYAOBJP)fftmserver.o $(SOPHYAOBJP)fftpserver.o $(SOPHYAOBJP)fftservintf.o $(SOPHYAOBJP)functab.o $(SOPHYAOBJP)generaldata.o $(SOPHYAOBJP)generalfit.o $(SOPHYAOBJP)generalfunc.o $(SOPHYAOBJP)imageop.o $(SOPHYAOBJP)integ.o $(SOPHYAOBJP)median.o $(SOPHYAOBJP)ntoolsinit.o $(SOPHYAOBJP)objfitter.o $(SOPHYAOBJP)perandom.o $(SOPHYAOBJP)poly.o $(SOPHYAOBJP)rk4cdifeq.o $(SOPHYAOBJP)simplesort.o $(SOPHYAOBJP)simplex.o $(SOPHYAOBJP) tabmath.o $(SOPHYAOBJP)toeplitzMatrix.o $(SOPHYAOBJP)datime.o $(SOPHYAOBJP)fftmayer_r4.o $(SOPHYAOBJP)fftmayer_r8.o $(SOPHYAOBJP)fftpackc.o $(SOPHYAOBJP)matxop.o $(SOPHYAOBJP)nbmath.o $(SOPHYAOBJP)nbtri.o6 rm -f $(SOPHYAOBJP)FSAppIrrSmpl.o $(SOPHYAOBJP)cimage.o $(SOPHYAOBJP)cspline.o $(SOPHYAOBJP)datatypes.o $(SOPHYAOBJP)dates.o $(SOPHYAOBJP)difeq.o $(SOPHYAOBJP)dynccd.o $(SOPHYAOBJP)fct1dfit.o $(SOPHYAOBJP)fct2dfit.o $(SOPHYAOBJP)fftmserver.o $(SOPHYAOBJP)fftpserver.o $(SOPHYAOBJP)fftservintf.o $(SOPHYAOBJP)functab.o $(SOPHYAOBJP)generaldata.o $(SOPHYAOBJP)generalfit.o $(SOPHYAOBJP)generalfunc.o $(SOPHYAOBJP)imageop.o $(SOPHYAOBJP)integ.o $(SOPHYAOBJP)median.o $(SOPHYAOBJP)ntoolsinit.o $(SOPHYAOBJP)objfitter.o $(SOPHYAOBJP)perandom.o $(SOPHYAOBJP)poly.o $(SOPHYAOBJP)rk4cdifeq.o $(SOPHYAOBJP)simplesort.o $(SOPHYAOBJP)simplex.o $(SOPHYAOBJP)slinparbuff.o $(SOPHYAOBJP)tabmath.o $(SOPHYAOBJP)toeplitzMatrix.o $(SOPHYAOBJP)datime.o $(SOPHYAOBJP)fftmayer_r4.o $(SOPHYAOBJP)fftmayer_r8.o $(SOPHYAOBJP)fftpackc.o $(SOPHYAOBJP)matxop.o $(SOPHYAOBJP)nbmath.o $(SOPHYAOBJP)nbtri.o 7 7 rm -f $(SOPHYALIBP)libNTools.a 8 8 9 $(SOPHYALIBP)libNTools.a : $(SOPHYAOBJP)cimage.o $(SOPHYAOBJP)cspline.o $(SOPHYAOBJP)datatypes.o $(SOPHYAOBJP)dates.o $(SOPHYAOBJP)datime.o $(SOPHYAOBJP)difeq.o $(SOPHYAOBJP)dynccd.o $(SOPHYAOBJP)fct1dfit.o $(SOPHYAOBJP)fct2dfit.o $(SOPHYAOBJP)fftmayer_r4.o $(SOPHYAOBJP)fftmayer_r8.o $(SOPHYAOBJP)fftmserver.o $(SOPHYAOBJP)fftpackc.o $(SOPHYAOBJP)fftpserver.o $(SOPHYAOBJP)fftservintf.o $(SOPHYAOBJP)FSAppIrrSmpl.o $(SOPHYAOBJP)functab.o $(SOPHYAOBJP)generaldata.o $(SOPHYAOBJP)generalfit.o $(SOPHYAOBJP)generalfunc.o $(SOPHYAOBJP)integ.o $(SOPHYAOBJP)matxop.o $(SOPHYAOBJP)median.o $(SOPHYAOBJP)nbmath.o $(SOPHYAOBJP)nbtri.o $(SOPHYAOBJP)ntoolsinit.o $(SOPHYAOBJP)objfitter.o $(SOPHYAOBJP)perandom.o $(SOPHYAOBJP)poly.o $(SOPHYAOBJP)rk4cdifeq.o $(SOPHYAOBJP)simplesort.o $(SOPHYAOBJP)simplex.o $(SOPHYAOBJP) tabmath.o $(SOPHYAOBJP)toeplitzMatrix.o9 $(SOPHYALIBP)libNTools.a : $(SOPHYAOBJP)cimage.o $(SOPHYAOBJP)cspline.o $(SOPHYAOBJP)datatypes.o $(SOPHYAOBJP)dates.o $(SOPHYAOBJP)datime.o $(SOPHYAOBJP)difeq.o $(SOPHYAOBJP)dynccd.o $(SOPHYAOBJP)fct1dfit.o $(SOPHYAOBJP)fct2dfit.o $(SOPHYAOBJP)fftmayer_r4.o $(SOPHYAOBJP)fftmayer_r8.o $(SOPHYAOBJP)fftmserver.o $(SOPHYAOBJP)fftpackc.o $(SOPHYAOBJP)fftpserver.o $(SOPHYAOBJP)fftservintf.o $(SOPHYAOBJP)FSAppIrrSmpl.o $(SOPHYAOBJP)functab.o $(SOPHYAOBJP)generaldata.o $(SOPHYAOBJP)generalfit.o $(SOPHYAOBJP)generalfunc.o $(SOPHYAOBJP)integ.o $(SOPHYAOBJP)matxop.o $(SOPHYAOBJP)median.o $(SOPHYAOBJP)nbmath.o $(SOPHYAOBJP)nbtri.o $(SOPHYAOBJP)ntoolsinit.o $(SOPHYAOBJP)objfitter.o $(SOPHYAOBJP)perandom.o $(SOPHYAOBJP)poly.o $(SOPHYAOBJP)rk4cdifeq.o $(SOPHYAOBJP)simplesort.o $(SOPHYAOBJP)simplex.o $(SOPHYAOBJP)slinparbuff.o $(SOPHYAOBJP)tabmath.o $(SOPHYAOBJP)toeplitzMatrix.o 10 10 $(AR) $(ARFLAGS) $@ $? 11 11 touch $(SOPHYAINCP)/SophyaConfInfo/libsophya.objlist … … 39 39 $(SOPHYAINCP)matharr.h \ 40 40 $(SOPHYAINCP)fioarr.h \ 41 $(SOPHYAINCP)sopemtx.h fftservintf.h \ 41 $(SOPHYAINCP)sopemtx.h \ 42 $(SOPHYAINCP)arrctcast.h fftservintf.h \ 42 43 $(SOPHYAINCP)pexceptions.h \ 43 44 $(SOPHYAINCP)tmatrix.h \ … … 640 641 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ simplex.cc 641 642 643 $(SOPHYAOBJP)slinparbuff.o: slinparbuff.cc \ 644 $(SOPHYAINCP)machdefs.h \ 645 $(SOPHYAINCP)pexceptions.h \ 646 $(SOPHYAINCP)machdefs.h slinparbuff.h 647 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ slinparbuff.cc 648 642 649 $(SOPHYAOBJP)tabmath.o: tabmath.cc $(SOPHYAINCP)sopnamsp.h \ 643 650 $(SOPHYAINCP)machdefs.h tabmath.h peida.h \ … … 677 684 $(SOPHYAINCP)matharr.h \ 678 685 $(SOPHYAINCP)fioarr.h \ 679 $(SOPHYAINCP)sopemtx.h fftservintf.h \ 686 $(SOPHYAINCP)sopemtx.h \ 687 $(SOPHYAINCP)arrctcast.h fftservintf.h \ 680 688 $(SOPHYAINCP)pexceptions.h \ 681 689 $(SOPHYAINCP)tmatrix.h \ -
trunk/SophyaLib/NTools/datatypes.cc
r2615 r3572 9 9 10 10 /* Nouvelle-Fonction */ 11 c har * DataName(PBaseDataTypes typ)11 const char * DataName(PBaseDataTypes typ) 12 12 { 13 13 switch (typ) … … 33 33 34 34 /* Nouvelle-Fonction */ 35 c har * DataLongName(PBaseDataTypes typ)35 const char * DataLongName(PBaseDataTypes typ) 36 36 { 37 37 switch (typ) -
trunk/SophyaLib/NTools/datatypes.h
r244 r3572 23 23 inline PBaseDataTypes DataType(r_8) {return kr_8;} 24 24 25 c har * DataName(PBaseDataTypes);26 c har * DataLongName(PBaseDataTypes);25 const char * DataName(PBaseDataTypes); 26 const char * DataLongName(PBaseDataTypes); 27 27 int DataSize(PBaseDataTypes); 28 28 -
trunk/SophyaLib/NTools/dates.cc
r2808 r3572 39 39 TimeZone::TimeZone() 40 40 { 41 c har* p = getenv("ACQ_TZ");41 const char* p = getenv("ACQ_TZ"); 42 42 #if defined(__DECCXX) || defined(__KCC__) || defined(__aCC__) 43 43 if (!p) p = const_cast<char *>("France"); -
trunk/SophyaLib/NTools/functab.cc
r2618 r3572 53 53 Dx = (r_8)(XMax-XMin)/(r_8)(NTab-1); 54 54 Tabul = new r_8[NTab+2]; 55 for( int_4 i=0;i<NTab+2;i++) Tabul[i] = 0.;55 for(uint_4 i=0;i<NTab+2;i++) Tabul[i] = 0.; 56 56 PInterpL = PInterpP[0] = PInterpP[1] = NULL; 57 57 if(!Tabul) return; 58 for( int_4 i=0;i<NTab;i++) Tabul[i+1] = func(XMin + i*Dx);58 for(uint_4 i=0;i<NTab;i++) Tabul[i+1] = func(XMin + i*Dx); 59 59 Tabul[0] = Tabul[1]; 60 60 Tabul[NTab+1] = Tabul[NTab]; … … 106 106 if(PInterpL) delete [] PInterpL; 107 107 PInterpL = new r_8[NTab+2]; 108 for( int_4 i=0;i<NTab+1;i++)108 for(uint_4 i=0;i<NTab+1;i++) 109 109 PInterpL[i] = (Tabul[i+1]-Tabul[i])/Dx; 110 110 PInterpL[NTab+1] = 0.; … … 116 116 PInterpP[0] = new r_8[NTab+2]; 117 117 PInterpP[1] = new r_8[NTab+2]; 118 for( int_4 i=1;i<=NTab;i++) {118 for(uint_4 i=1;i<=NTab;i++) { 119 119 PInterpP[0][i] = (Tabul[i+1]+Tabul[i-1]-2.*Tabul[i])/(2.*Dx*Dx); 120 120 PInterpP[1][i] = (Tabul[i+1]-Tabul[i-1])/(2.*Dx); -
trunk/SophyaLib/NTools/generalfit.cc
r3205 r3572 279 279 Pour ecrire les iterations dans le fichier filename 280 280 */ 281 void GeneralFit::WriteStep(c har *filename)281 void GeneralFit::WriteStep(const char *filename) 282 282 { 283 283 -
trunk/SophyaLib/NTools/generalfit.h
r3083 r3572 53 53 ~GeneralFit(); 54 54 55 void WriteStep(c har *filename = NULL);55 void WriteStep(const char *filename = NULL); 56 56 void SetDebug(int level = 0); 57 57 void SetMaxStep(int n = 100); -
trunk/SophyaLib/NTools/ntools.h
r1316 r3572 15 15 #include "poly.h" 16 16 #include "datatypes.h" 17 #include "slinparbuff.h" 17 18 18 19 #include "cimage.h" -
trunk/SophyaLib/NTools/objlist.list
r3083 r3572 31 31 simplesort.o 32 32 simplex.o 33 slinparbuff.o 33 34 tabmath.o 34 35 toeplitzMatrix.o -
trunk/SophyaLib/NTools/pclassids.h
r2602 r3572 30 30 ClassId_HistoErr = 0x0204, 31 31 ClassId_NTuple = 0x0210, 32 ClassId_XNTuple = 0x0211,33 32 34 33 ClassId_GeneralFitData = 0x0290, -
trunk/SophyaLib/NTools/poly.cc
r3235 r3572 710 710 Poly2& Poly2::operator *= (double a) 711 711 { 712 for ( uint_4 i=0; i<NElts(); i++) Element(i) *= a;712 for (int_4 i=0; i<NElts(); i++) Element(i) *= a; 713 713 return *this; 714 714 } -
trunk/SophyaLib/NTools/simplex.cc
r2808 r3572 366 366 int ilo, ihi, inhi; 367 367 int move = 0; 368 c har* smov[6] = { "None", "Reflection", "ReflecExpand", "ContractHigh", "ContractLow", "ExpandHigh" };368 const char* smov[6] = { "None", "Reflection", "ReflecExpand", "ContractHigh", "ContractLow", "ExpandHigh" }; 369 369 int movcnt[6] = {0,0,0,0,0,0}; 370 370 … … 511 511 int MinZSimplex::StopReason(string& s) 512 512 { 513 c har* sr[5] = { "NoConverg, MaxIterReached", "OK, fm<Tol0", "OK, Df/f<Tol1",513 const char* sr[5] = { "NoConverg, MaxIterReached", "OK, fm<Tol0", "OK, Df/f<Tol1", 514 514 "OK, [Df/f max]Iter<Tol2" "Error - Wrong StopReason" }; 515 515 int stop = mStop; -
trunk/SophyaLib/NTools/slinparbuff.h
r2322 r3572 1 #include "machdefs.h"2 #include <iostream>3 #include <stdlib.h>4 #include <stdio.h>5 #include <math.h>6 #include <algorithm>7 1 #include "pexceptions.h" 8 2 … … 17 11 friend class SLinParBuffMerger; 18 12 19 //***************************************************************** 20 SLinParBuff(uint_4 lenbuf,uint_4 nresynch=0 21 ,r_8 x0=0.,r_8 y0=0.,bool autoxy0=false) 22 // ---- Createur 23 { 24 if(lenbuf==0) throw RangeCheckError("SLinParBuff: lenbuf==0 !"); 25 mLenBuf = lenbuf; 26 mNResynch = nresynch; 27 mX = new r_8[mLenBuf]; mY = new r_8[mLenBuf]; 28 mX0 = x0; mY0 = y0; mAutoXY0 = autoxy0; 29 Reset(); 30 } 13 SLinParBuff(uint_4 lenbuf,uint_4 nresynch=0,r_8 x0=0.,r_8 y0=0.,bool autoxy0=false); 14 SLinParBuff(SLinParBuff& slp); 15 SLinParBuff(void); 16 virtual ~SLinParBuff(); 31 17 32 SLinParBuff(SLinParBuff& slp) 33 // ---- Createur par copie 34 { 35 mLenBuf = slp.mLenBuf; 36 mNResynch = slp.mNResynch; 18 void GetX0Y0(r_8& x0,r_8& y0); 19 bool GetAutoX0Y0(); 20 void SetX0Y0(r_8 x0=0.,r_8 y0=0.); 21 void SetAutoX0Y0(bool autoxy0=false); 37 22 38 mX = mY = NULL; 39 if(mLenBuf) { 40 mX = new r_8[mLenBuf]; mY = new r_8[mLenBuf]; 41 for(uint_4 i=0;i<mLenBuf;i++) {mX[i]=slp.mX[i]; mY[i]=slp.mY[i];} 42 } 43 44 mX0 = slp.mX0; mY0 = slp.mY0; mAutoXY0 = slp.mAutoXY0; 45 mNCur = slp.mNCur; mIDeb = slp.mIDeb; mIResynch = slp.mIResynch; 46 mNResynchEff = slp.mNResynchEff; mNPush = slp.mNPush; mNPop = slp.mNPop; 47 48 mSx = slp.mSx; mSy = slp.mSy; 49 mSx2 = slp.mSx2; mSy2 = slp.mSy2; mSxy = slp.mSxy; 50 mSx3 = slp.mSx3; mSx2y = slp.mSx2y; 51 mSx4 = slp.mSx4; 52 } 53 54 SLinParBuff(void) 55 // ---- Createur par defaut 56 { 57 mLenBuf = 0; mNResynch = 0; 58 mX = mY = NULL; 59 mX0 = mY0 = 0.; mAutoXY0 = false; 60 Reset(); 61 } 62 63 virtual ~SLinParBuff() 64 // ---- Destructeur 65 { 66 if(mX) delete [] mX; if(mY) delete [] mY; 67 } 68 69 //***************************************************************** 70 inline void GetX0Y0(r_8& x0,r_8& y0) {x0 = mX0; y0 = mY0;} 71 inline bool GetAutoX0Y0() {return mAutoXY0;} 72 73 inline void SetX0Y0(r_8 x0=0.,r_8 y0=0.) 74 // ---- Stabilite numerique, centrage des x,y en mX0,mY0 75 { 76 mX0 = x0; mY0 = y0; mAutoXY0 = false; 77 ReComputeSum(); 78 } 79 80 inline void SetAutoX0Y0(bool autoxy0=false) 81 // ---- Stabilite numerique, centrage automatique a <x> et <y> 82 // a chaque ReComputeSum 83 { 84 mAutoXY0 = autoxy0; 85 ReComputeSum(); 86 } 87 88 inline void Reset(void) 89 // ---- Reset des sommes et des compteurs 90 { 91 mSx=mSy=mSx2=mSy2=mSxy=mSx3=mSx2y=mSx4=0.; 92 mNCur = mIDeb = mIResynch = mNResynchEff = mNPush = mNPop = 0; 93 //if(mX) for(uint_4 i=0;i<mLenBuf;i++) mX[i] = 0.; 94 //if(mY) for(uint_4 i=0;i<mLenBuf;i++) mY[i] = 0.; 95 } 96 97 //***************************************************************** 98 inline uint_4 Pop(void) 99 // ---- Pour enlever la donnee la plus ancienne 100 { 101 if(mNCur==0) return mNCur; 102 r_8 x=mX[mIDeb]-mX0, y=mY[mIDeb]-mY0; r_8 x2 = x*x; 103 mSx -= x; mSy -= y; 104 mSx2 -= x2; mSy2 -= y*y; mSxy -= x*y; 105 mSx3 -= x2*x; mSx2y -= x2*y; 106 mSx4 -= x2*x2; 107 mNCur--; mNPop++; 108 if(mNCur==0) {Reset(); return mNCur;} 109 mIDeb++; if(mIDeb==mLenBuf) mIDeb=0; 110 return mNCur; 111 } 112 113 inline uint_4 Push(r_8 x,r_8 y) 114 // ---- Pour ajouter une donnee, la donnee la plus ancienne 115 // est enlevee si le buffer est deja plein. 116 { 117 uint_4 ifill; 118 if(mNCur==mLenBuf) { 119 r_8 X=mX[mIDeb]-mX0, Y=mY[mIDeb]-mY0; r_8 X2 = X*X; 120 mSx -= X; mSy -=Y; 121 mSx2 -= X2; mSy2 -=Y*Y; mSxy -= X*Y; 122 mSx3 -= X2*X; mSx2y -=X*X*Y; 123 mSx4 -= X2*X2; 124 ifill = mIDeb; 125 mIDeb++; if(mIDeb==mLenBuf) mIDeb=0; 126 } else { 127 ifill = (mIDeb+mNCur)%mLenBuf; 128 mNCur++; 129 } 130 mX[ifill] = x; mY[ifill] = y; 131 x -= mX0; y -= mY0; r_8 x2 = x*x; 132 mSx += x; mSy += y; 133 mSx2 += x2; mSy2 += y*y; mSxy += x*y; 134 mSx3 += x2*x; mSx2y += x2*y; 135 mSx4 += x2*x2; 136 mNPush++; 137 // Il faut re-synchroniser pour eviter les derives numeriques 138 mIResynch++; if(mIResynch == mNResynch) ReComputeSum(); 139 return mNCur; 140 } 141 142 //***************************************************************** 143 inline uint_4 ReComputeSum(void) 144 // ---- Pour re-synchroniser (eviter les derives numeriques). 145 { 146 if(mNCur==0) return 0; 147 // Re-centrage automatique a la moyenne demande: 148 // Attention, mSx = sum(x-mX0) ==> nouvel mX0 = mSx/N + mX0(ancien) 149 if(mAutoXY0) {mX0 = mSx/(r_8)mNCur + mX0; mY0 = mSy/(r_8)mNCur + mY0;} 150 mSx=mSy=mSx2=mSy2=mSxy=mSx3=mSx2y=mSx4=0.; 151 for(uint_4 i=mIDeb;i<mIDeb+mNCur;i++) { 152 uint_4 ii = i%mLenBuf; 153 r_8 x=mX[ii]-mX0, y=mY[ii]-mY0; r_8 x2 = x*x; 154 mSx += x; mSy += y; 155 mSx2 += x2; mSy2 += y*y; mSxy += x*y; 156 mSx3 += x2*x; mSx2y += x2*y; 157 mSx4 += x2*x2; 158 } 159 mIResynch=0; 160 mNResynchEff++; 161 return mNCur; 162 } 163 164 //***************************************************************** 165 // ---- Retourne le nombre de points 23 void Reset(void); 24 uint_4 Pop(void); 25 uint_4 Push(r_8 x,r_8 y); 166 26 inline uint_4 NPoints(void) {return mNCur;} 167 27 168 inline r_8 Compute(r_8& mean,bool recomputeXi2=false) 169 // ---- Calcul <y>, Var(y) 170 // recomputeXi2=true : recalcule le xi2 (sigma) avec la courbe et les points 171 { 172 mean=0.; 173 if(mNCur==0) return -1.; 174 // Moyenne 175 mean = mSy/(r_8) mNCur; 176 // Sigma 177 r_8 sigma; 178 if(recomputeXi2) { 179 sigma=0.; 180 for(uint_4 i=mIDeb;i<mIDeb+mNCur;i++) { 181 uint_4 ii = i%mLenBuf; 182 r_8 s = mean - (mY[ii]-mY0); 183 sigma += s*s; 184 } 185 sigma /= (r_8) mNCur; 186 } else { 187 sigma = mSy2/(r_8) mNCur - mean*mean; 188 } 189 // gestion du decalage 190 mean += mY0; 28 r_8 SumX(void) {return mSx+mNCur*mX0;} 29 r_8 SumY(void) {return mSy+mNCur*mY0;} 191 30 192 if(sigma>0.) return sqrt(sigma);193 if(sigma<0.) return -sqrt(-sigma);194 return sigma;195 }31 uint_4 ReComputeSum(void); 32 r_8 Compute(r_8& mean,bool recomputeXi2=false); 33 r_8 Compute(r_8& a0,r_8 &a1,bool recomputeXi2=false); 34 r_8 Compute(r_8& a0,r_8 &a1,r_8 &a2,bool recomputeXi2=false); 196 35 197 inline r_8 Compute(r_8& a0,r_8 &a1,bool recomputeXi2=false) 198 // ---- Calcul y=a0+a1*x et slin=Var(y-(a0+a1*x))=sqrt(<dy^2>) 199 // recomputeXi2=true : recalcule le xi2 avec la courbe et les points 200 { 201 a0=a1=0.; 202 if(mNCur==0) return -1.; 203 // Fit lineaire 204 r_8 w = mNCur*mSx2 - mSx*mSx; 205 if(w==0. || mNCur==1) return -2.; 206 a0 = (mSx2*mSy - mSx*mSxy)/w; 207 a1 = (mNCur*mSxy - mSx*mSy )/w; 208 // Sigma par rapport Fit lineaire 209 // (On a XI2=mNCur*slin**2 dans notre cas ou les erreurs=1) 210 r_8 slin; 211 if(recomputeXi2) { 212 slin=0.; 213 for(uint_4 i=mIDeb;i<mIDeb+mNCur;i++) { 214 uint_4 ii = i%mLenBuf; 215 r_8 s = a0+a1*(mX[ii]-mX0) - (mY[ii]-mY0); 216 slin += s*s; 217 } 218 slin /= (r_8) mNCur; 219 } else { 220 slin = (mSy2 +a0*a0*mNCur +a1*a1*mSx2 -2.*a0*mSy -2.*a1*mSxy +2.*a0*a1*mSx) 221 / (r_8)mNCur; 222 } 223 // gestion du decalage y-y0 = a0 + a1*(x-x0) 224 a0 = mY0 + a0 - a1*mX0; 225 226 if(slin>0.) return sqrt(slin); 227 if(slin<0.) return -sqrt(-slin); 228 return slin; 229 } 230 231 inline r_8 Compute(r_8& a0,r_8 &a1,r_8 &a2,bool recomputeXi2=false) 232 // ---- Calcul y=a0+a1*x+a2*x^2 et spar=Var(y-(a0+a1*x+a2*x^2))=sqrt(<dy^2>) 233 // recomputeXi2=true : recalcule le xi2 avec la courbe et les points 234 { 235 a0=a1=a2=0.; 236 if(mNCur==0) return -1.; 237 // Fit parabolique 238 r_8 w = mSx2*(mSx2*mSx2-mSx3*mSx) -mSx*(mSx3*mSx2-mSx4*mSx) +mNCur*(mSx3*mSx3-mSx4*mSx2); 239 if(w==0. || mNCur<=2) return -2.; 240 a2 = (mSy*(mSx2*mSx2-mSx3*mSx) - mSxy*(mSx*mSx2-mSx3*mNCur) + mSx2y*(mSx*mSx-mSx2*mNCur) )/w; 241 a1 = -(mSy*(mSx3*mSx2-mSx4*mSx) - mSxy*(mSx2*mSx2-mSx4*mNCur) + mSx2y*(mSx2*mSx-mSx3*mNCur))/w; 242 a0 = (mSy*(mSx3*mSx3-mSx4*mSx2) - mSxy*(mSx2*mSx3-mSx4*mSx) + mSx2y*(mSx2*mSx2-mSx3*mSx) )/w; 243 // Sigma par rapport Fit parabolique 244 // (On a XI2=mNCur*spar**2 dans notre cas ou les erreurs=1) 245 // Le calcul direct du Xi2 n'est pas precis 246 r_8 spar; 247 if(recomputeXi2) { 248 spar=0.; 249 for(uint_4 i=mIDeb;i<mIDeb+mNCur;i++) { 250 uint_4 ii = i%mLenBuf; 251 r_8 s = a0+(a1+a2*(mX[ii]-mX0))*(mX[ii]-mX0) - (mY[ii]-mY0); 252 spar += s*s; 253 } 254 spar /= (r_8) mNCur; 255 } else { 256 spar = (mSy2 +a0*a0*mNCur +a1*a1*mSx2 +a2*a2*mSx4 -2.*mSy*a0 -2.*a1*mSxy 257 -2.*a2*mSx2y +2.*a0*a1*mSx +2.*a0*a2*mSx2 +2.*a1*a2*mSx3) 258 / (r_8) mNCur; 259 } 260 // gestion du decalage y-y0 = a0 + a1*(x-x0) + a2*(x-x0)^2 261 a0 = mY0 + a0 - a1*mX0 + a2*mX0*mX0; 262 a1 = a1 - 2.*a2*mX0; 263 264 if(spar>0.) return sqrt(spar); 265 if(spar<0.) return -sqrt(-spar); 266 return spar; 267 } 268 269 //***************************************************************** 270 void Print(int lp=0) 271 // ---- Print de l'etat de la classe 272 // lp = 0 : parametres 273 // 1 : + sommes 274 // 2 : + tableaux 275 { 276 cout<<"SLinParBuff(LenBuf="<<mLenBuf<<",NResynch="<<mNResynch 277 <<",auto_xy0="<<mAutoXY0 278 <<"): mX0="<<mX0<<" mY0="<<mY0<<" mNCur="<<mNCur<<endl 279 <<" NPush="<<mNPush<<" NPop="<<mNPop 280 <<" NSynchro="<<mNResynchEff<<endl; 281 if(mNCur==0) return; 282 if(lp>=2) { 283 cout<<"X:"; 284 if(mX) for(uint_4 i=0;i<mNCur;i++) { 285 uint_4 ii = (mIDeb+i)%mLenBuf; 286 cout<<" "<<mX[ii]; if(i%10==9 || i==mNCur-1) cout<<endl; 287 } 288 if(mY) cout<<"Y:"; 289 for(uint_4 i=0;i<mNCur;i++) { 290 uint_4 ii = (mIDeb+i)%mLenBuf; 291 cout<<" "<<mY[ii]; if(i%10==9 || i==mNCur-1) cout<<endl; 292 } 293 } 294 if(lp>=1) { 295 cout<<"...IDeb="<<mIDeb<<" IResynch="<<mIResynch<<endl; 296 cout<<" Sx="<<mSx<<" Sx2="<<mSx2<<" Sx3="<<mSx3<<" Sx4="<<mSx4<<endl 297 <<" Sy="<<mSy<<" Sy2="<<mSy2<<" Sxy="<<mSxy<<" Sx2y="<<mSx2y<<endl; 298 } 299 } 300 301 void PrintCompute(int lp=0) 302 // ---- Print des valeurs numeriques calculees 303 // lp = 0 : valeurs calculees 304 // 1 : + sommes 305 { 306 bool recompute = (mX==NULL || mY==NULL) ? false: true; 307 r_8 mean; 308 r_8 sigma = Compute(mean,recompute), sigmar = Compute(mean,false); 309 cout<<"SLinParBuff: n="<<NPoints()<<" mean="<<mean 310 <<" sigma="<<sigma<<" (raw="<<sigmar<<")"<<endl; 311 r_8 a0,a1,a2; 312 r_8 slin = Compute(a0,a1,recompute), slinr = Compute(a0,a1,false); 313 cout<<" a0="<<a0<<" a1="<<a1 314 <<" slin="<<slin<<" (raw="<<slinr<<")"<<endl; 315 r_8 spar = Compute(a0,a1,a2,recompute), sparr = Compute(a0,a1,a2,false); 316 cout<<" a0="<<a0<<" a1="<<a1<<" a2="<<a2 317 <<" spar="<<spar<<" (raw="<<sparr<<")"<<endl; 318 if(lp<1) return; 319 cout<<"...Sx="<<mSx<<" Sx2="<<mSx2<<" Sx3="<<mSx3<<" Sx4="<<mSx4<<endl 320 <<" Sy="<<mSy<<" Sy2="<<mSy2<<" Sxy="<<mSxy<<" Sx2y="<<mSx2y<<endl; 321 } 36 void Print(int lp=0); 37 void PrintCompute(int lp=0); 322 38 323 39 protected: … … 329 45 uint_4 mNResynchEff, mNPush, mNPop; 330 46 }; 47 331 48 332 49 /////////////////////////////////////////////////////////////////// … … 343 60 class SLinParBuffMerger { 344 61 public: 345 SLinParBuffMerger(void) {mFirst=true; mSlp.Reset();}346 SLinParBuffMerger(SLinParBuff& s,bool recompute=false) 347 {mFirst=true; mSlp.Reset(); Add(s,recompute);}348 virtual ~SLinParBuffMerger(void) {} 349 inline uint_4 62 SLinParBuffMerger(void); 63 SLinParBuffMerger(SLinParBuff& s,bool recompute=false); 64 virtual ~SLinParBuffMerger(void); 65 66 inline uint_4 NPoints(void) {return mSlp.NPoints();} 350 67 inline void Reset(void) {mSlp.Reset(); mFirst=true;} 351 inline void Add(SLinParBuff& s,bool recompute=false) 352 { 353 bool changex0y0=false, AutoXY0_Save; r_8 X0_Save,Y0_Save; 354 if(mFirst) { 355 // Cas ou c'est le premier SLinParBuff additionne. 356 mSlp.mX0=s.mX0; mSlp.mY0=s.mY0; mFirst=false; 357 } else if(mSlp.mX0!=s.mX0 || mSlp.mY0!=s.mY0) { 358 // Attention: pour merger il faut avoir les memes mX0,mY0 359 changex0y0=true; 360 X0_Save=s.mX0; Y0_Save=s.mY0; AutoXY0_Save=s.mAutoXY0; 361 s.mX0=mSlp.mX0; s.mY0=mSlp.mY0; s.mAutoXY0=false; 362 recompute=true; 363 } 364 if(recompute) s.ReComputeSum(); 365 mSlp.mNCur += s.mNCur; 366 mSlp.mSx += s.mSx; 367 mSlp.mSy += s.mSy; 368 mSlp.mSx2 += s.mSx2; 369 mSlp.mSy2 += s.mSy2; 370 mSlp.mSxy += s.mSxy; 371 mSlp.mSx3 += s.mSx3; 372 mSlp.mSx2y += s.mSx2y; 373 mSlp.mSx4 += s.mSx4; 374 // Dans le cas ou on a change les X0,Y0, on remet en etat 375 if(changex0y0) { 376 s.mX0=X0_Save; s.mY0=Y0_Save; 377 s.ReComputeSum(); 378 s.mAutoXY0=AutoXY0_Save; 379 } 380 } 381 inline r_8 Compute(r_8& mean) 382 {return mSlp.Compute(mean);} 383 inline r_8 Compute(r_8& a0,r_8 &a1) 384 {return mSlp.Compute(a0,a1);} 385 inline r_8 Compute(r_8& a0,r_8 &a1,r_8 &a2) 386 {return mSlp.Compute(a0,a1,a2);} 68 void Add(SLinParBuff& s,bool recompute=false); 69 inline r_8 Compute(r_8& mean) {return mSlp.Compute(mean);} 70 inline r_8 Compute(r_8& a0,r_8 &a1) {return mSlp.Compute(a0,a1);} 71 inline r_8 Compute(r_8& a0,r_8 &a1,r_8 &a2) {return mSlp.Compute(a0,a1,a2);} 387 72 inline void Print(int lp=0) {mSlp.Print(lp);} 388 73 inline void PrintCompute(int lp=0) {mSlp.PrintCompute(lp);} -
trunk/SophyaLib/NTools/smakefile
r3503 r3572 4 4 5 5 clean: 6 rm -f $(SOPHYAOBJP)FSAppIrrSmpl.o $(SOPHYAOBJP)cimage.o $(SOPHYAOBJP)cspline.o $(SOPHYAOBJP)datatypes.o $(SOPHYAOBJP)dates.o $(SOPHYAOBJP)difeq.o $(SOPHYAOBJP)dynccd.o $(SOPHYAOBJP)fct1dfit.o $(SOPHYAOBJP)fct2dfit.o $(SOPHYAOBJP)fftmserver.o $(SOPHYAOBJP)fftpserver.o $(SOPHYAOBJP)fftservintf.o $(SOPHYAOBJP)functab.o $(SOPHYAOBJP)generaldata.o $(SOPHYAOBJP)generalfit.o $(SOPHYAOBJP)generalfunc.o $(SOPHYAOBJP)imageop.o $(SOPHYAOBJP)integ.o $(SOPHYAOBJP)median.o $(SOPHYAOBJP)ntoolsinit.o $(SOPHYAOBJP)objfitter.o $(SOPHYAOBJP)perandom.o $(SOPHYAOBJP)poly.o $(SOPHYAOBJP)rk4cdifeq.o $(SOPHYAOBJP)simplesort.o $(SOPHYAOBJP)simplex.o $(SOPHYAOBJP) tabmath.o $(SOPHYAOBJP)toeplitzMatrix.o $(SOPHYAOBJP)datime.o $(SOPHYAOBJP)fftmayer_r4.o $(SOPHYAOBJP)fftmayer_r8.o $(SOPHYAOBJP)fftpackc.o $(SOPHYAOBJP)matxop.o $(SOPHYAOBJP)nbmath.o $(SOPHYAOBJP)nbtri.o6 rm -f $(SOPHYAOBJP)FSAppIrrSmpl.o $(SOPHYAOBJP)cimage.o $(SOPHYAOBJP)cspline.o $(SOPHYAOBJP)datatypes.o $(SOPHYAOBJP)dates.o $(SOPHYAOBJP)difeq.o $(SOPHYAOBJP)dynccd.o $(SOPHYAOBJP)fct1dfit.o $(SOPHYAOBJP)fct2dfit.o $(SOPHYAOBJP)fftmserver.o $(SOPHYAOBJP)fftpserver.o $(SOPHYAOBJP)fftservintf.o $(SOPHYAOBJP)functab.o $(SOPHYAOBJP)generaldata.o $(SOPHYAOBJP)generalfit.o $(SOPHYAOBJP)generalfunc.o $(SOPHYAOBJP)imageop.o $(SOPHYAOBJP)integ.o $(SOPHYAOBJP)median.o $(SOPHYAOBJP)ntoolsinit.o $(SOPHYAOBJP)objfitter.o $(SOPHYAOBJP)perandom.o $(SOPHYAOBJP)poly.o $(SOPHYAOBJP)rk4cdifeq.o $(SOPHYAOBJP)simplesort.o $(SOPHYAOBJP)simplex.o $(SOPHYAOBJP)slinparbuff.o $(SOPHYAOBJP)tabmath.o $(SOPHYAOBJP)toeplitzMatrix.o $(SOPHYAOBJP)datime.o $(SOPHYAOBJP)fftmayer_r4.o $(SOPHYAOBJP)fftmayer_r8.o $(SOPHYAOBJP)fftpackc.o $(SOPHYAOBJP)matxop.o $(SOPHYAOBJP)nbmath.o $(SOPHYAOBJP)nbtri.o 7 7 rm -f $(SOPHYALIBP)libNTools.a 8 8 9 $(SOPHYALIBP)libNTools.a : $(SOPHYAOBJP)cimage.o $(SOPHYAOBJP)cspline.o $(SOPHYAOBJP)datatypes.o $(SOPHYAOBJP)dates.o $(SOPHYAOBJP)datime.o $(SOPHYAOBJP)difeq.o $(SOPHYAOBJP)dynccd.o $(SOPHYAOBJP)fct1dfit.o $(SOPHYAOBJP)fct2dfit.o $(SOPHYAOBJP)fftmayer_r4.o $(SOPHYAOBJP)fftmayer_r8.o $(SOPHYAOBJP)fftmserver.o $(SOPHYAOBJP)fftpackc.o $(SOPHYAOBJP)fftpserver.o $(SOPHYAOBJP)fftservintf.o $(SOPHYAOBJP)FSAppIrrSmpl.o $(SOPHYAOBJP)functab.o $(SOPHYAOBJP)generaldata.o $(SOPHYAOBJP)generalfit.o $(SOPHYAOBJP)generalfunc.o $(SOPHYAOBJP)integ.o $(SOPHYAOBJP)matxop.o $(SOPHYAOBJP)median.o $(SOPHYAOBJP)nbmath.o $(SOPHYAOBJP)nbtri.o $(SOPHYAOBJP)ntoolsinit.o $(SOPHYAOBJP)objfitter.o $(SOPHYAOBJP)perandom.o $(SOPHYAOBJP)poly.o $(SOPHYAOBJP)rk4cdifeq.o $(SOPHYAOBJP)simplesort.o $(SOPHYAOBJP)simplex.o $(SOPHYAOBJP) tabmath.o $(SOPHYAOBJP)toeplitzMatrix.o9 $(SOPHYALIBP)libNTools.a : $(SOPHYAOBJP)cimage.o $(SOPHYAOBJP)cspline.o $(SOPHYAOBJP)datatypes.o $(SOPHYAOBJP)dates.o $(SOPHYAOBJP)datime.o $(SOPHYAOBJP)difeq.o $(SOPHYAOBJP)dynccd.o $(SOPHYAOBJP)fct1dfit.o $(SOPHYAOBJP)fct2dfit.o $(SOPHYAOBJP)fftmayer_r4.o $(SOPHYAOBJP)fftmayer_r8.o $(SOPHYAOBJP)fftmserver.o $(SOPHYAOBJP)fftpackc.o $(SOPHYAOBJP)fftpserver.o $(SOPHYAOBJP)fftservintf.o $(SOPHYAOBJP)FSAppIrrSmpl.o $(SOPHYAOBJP)functab.o $(SOPHYAOBJP)generaldata.o $(SOPHYAOBJP)generalfit.o $(SOPHYAOBJP)generalfunc.o $(SOPHYAOBJP)integ.o $(SOPHYAOBJP)matxop.o $(SOPHYAOBJP)median.o $(SOPHYAOBJP)nbmath.o $(SOPHYAOBJP)nbtri.o $(SOPHYAOBJP)ntoolsinit.o $(SOPHYAOBJP)objfitter.o $(SOPHYAOBJP)perandom.o $(SOPHYAOBJP)poly.o $(SOPHYAOBJP)rk4cdifeq.o $(SOPHYAOBJP)simplesort.o $(SOPHYAOBJP)simplex.o $(SOPHYAOBJP)slinparbuff.o $(SOPHYAOBJP)tabmath.o $(SOPHYAOBJP)toeplitzMatrix.o 10 10 $(AR) $(ARFLAGS) $@ $? 11 11 touch $(SOPHYAINCP)/SophyaConfInfo/libsophya.objlist … … 641 641 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ simplex.cc 642 642 643 $(SOPHYAOBJP)slinparbuff.o: slinparbuff.cc \ 644 $(SOPHYAINCP)machdefs.h \ 645 $(SOPHYAINCP)pexceptions.h \ 646 $(SOPHYAINCP)machdefs.h slinparbuff.h 647 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ slinparbuff.cc 648 643 649 $(SOPHYAOBJP)tabmath.o: tabmath.cc $(SOPHYAINCP)sopnamsp.h \ 644 650 $(SOPHYAINCP)machdefs.h tabmath.h peida.h \ -
trunk/SophyaLib/SUtils/datacards.cc
r2615 r3572 1 1 // 2 // $Id: datacards.cc,v 1.1 0 2004-09-10 09:54:48cmv Exp $2 // $Id: datacards.cc,v 1.11 2009-02-07 21:49:59 cmv Exp $ 3 3 // 4 4 // … … 217 217 DataCards::GetKey(int num) const 218 218 { 219 if ((num < 0) || (num >= cards.size()) ) return("");219 if ((num < 0) || (num >= (int)cards.size()) ) return(""); 220 220 int k = 0; 221 221 CardList::const_iterator i; … … 234 234 DataCards::CardList::const_iterator it = FindKeyC(key); 235 235 if (it == cards.end()) return(rs); 236 for ( int k=0; k<(*it).tokens.size(); k++) {236 for (size_t k=0; k<(*it).tokens.size(); k++) { 237 237 rs += ' '; rs += (*it).tokens[k]; 238 238 } … … 246 246 DataCards::CardList::const_iterator it = FindKeyC(key); 247 247 if (it == cards.end()) return(def); 248 if ( (numero < 0) || (numero >= ( *it).tokens.size()) ) return def;248 if ( (numero < 0) || (numero >= (int)((*it).tokens.size())) ) return def; 249 249 return (*it).tokens[numero]; 250 250 } … … 308 308 DataCards::ApplyPF(CrdPF & cpf, string const& key, string const& toks) 309 309 { 310 int l,lk;310 size_t l,lk; 311 311 int rc = 0; 312 312 // On verifie si le "pattern" correspond -
trunk/SophyaLib/SUtils/strutilxx.cc
r2706 r3572 13 13 // considering char "sep" as a separator. 14 14 // Vector is filled from its end (no reset done). 15 // T pwrite a "sep" char, use \'sep'15 // To write a "sep" char, use \'sep' 16 16 // Warning: separator "sep" could not be set to '\' 17 17 // Ex: sep=' ': s="aaa bbb cc d " -> vs=(aaa,bbb,cc,d) … … 55 55 // - Fill "vs" at the end: NO RESET IS DONE 56 56 // - If ',' is the separator, ",,," is c 57 // That routine is much more rapid than FillVStringFrString alt ouch less general57 // That routine is much more rapid than FillVStringFrString although less general 58 58 // (ex no '\' gestion is done) 59 59 { 60 60 uint_4 ls = s.size(); 61 61 if(ls<=0) return; 62 bool sep_non_blanc = (separator==' ')? false: true;62 //bool sep_non_blanc = (separator==' ')? false: true; 63 63 char *str = new char[ls+2]; 64 64 -
trunk/SophyaLib/SUtils/utils.cc
r2615 r3572 1 1 // This may look like C code, but it is really -*- C++ -*- 2 2 // 3 // $Id: utils.cc,v 1. 2 2004-09-10 09:54:49 cmv Exp $3 // $Id: utils.cc,v 1.3 2009-02-07 21:49:59 cmv Exp $ 4 4 // 5 5 … … 15 15 int i; // THINK C ne veut pas du int i dans chaque for... 16 16 if (dest < source) 17 for (i=0; i< n; i++)17 for (i=0; i<(int)n; i++) 18 18 ((char*)dest)[i] = ((char*)source)[i]; 19 19 else -
trunk/SophyaLib/Samba/Makefile
r3405 r3572 12 12 13 13 $(SOPHYAOBJP)alm.o: alm.cc $(SOPHYAINCP)sopnamsp.h alm.h \ 14 $(SOPHYAINCP)srandgen.h \ 15 $(SOPHYAINCP)machdefs.h \ 14 $(SOPHYAINCP)stsrand.h \ 15 $(SOPHYAINCP)machdefs.h \ 16 $(SOPHYAINCP)objfio.h \ 17 $(SOPHYAINCP)anydataobj.h \ 18 $(SOPHYAINCP)ppersist.h \ 19 $(SOPHYAINCP)pexceptions.h \ 20 $(SOPHYAINCP)gnumd5.h \ 21 $(SOPHYAINCP)ppfbinstream.h \ 22 $(SOPHYAINCP)rawstream.h \ 23 $(SOPHYAINCP)ppfnametag.h \ 24 $(SOPHYAINCP)ndatablock.h \ 16 25 $(SOPHYAINCP)nbmath.h \ 17 26 $(SOPHYAINCP)smathconst.h \ 18 27 $(SOPHYAINCP)triangmtx.h \ 19 $(SOPHYAINCP)ndatablock.h \ 20 $(SOPHYAINCP)anydataobj.h \ 21 $(SOPHYAINCP)pexceptions.h \ 22 $(SOPHYAINCP)tvector.h \ 23 $(SOPHYAINCP)tmatrix.h \ 24 $(SOPHYAINCP)tarray.h \ 25 $(SOPHYAINCP)basarr.h \ 26 $(SOPHYAINCP)mutyv.h \ 27 $(SOPHYAINCP)timestamp.h \ 28 $(SOPHYAINCP)objfio.h \ 29 $(SOPHYAINCP)ppersist.h \ 30 $(SOPHYAINCP)gnumd5.h \ 31 $(SOPHYAINCP)ppfbinstream.h \ 32 $(SOPHYAINCP)rawstream.h \ 33 $(SOPHYAINCP)ppfnametag.h \ 28 $(SOPHYAINCP)tvector.h \ 29 $(SOPHYAINCP)tmatrix.h \ 30 $(SOPHYAINCP)tarray.h \ 31 $(SOPHYAINCP)basarr.h \ 32 $(SOPHYAINCP)mutyv.h \ 33 $(SOPHYAINCP)timestamp.h \ 34 34 $(SOPHYAINCP)dvlist.h \ 35 35 $(SOPHYAINCP)utilarr.h \ … … 93 93 $(SOPHYAINCP)tmatrix_tsnl.h \ 94 94 $(SOPHYAINCP)tvector_tsnl.h alm.h \ 95 $(SOPHYAINCP)s randgen.h \95 $(SOPHYAINCP)stsrand.h \ 96 96 $(SOPHYAINCP)nbmath.h \ 97 97 $(SOPHYAINCP)smathconst.h \ 98 98 $(SOPHYAINCP)triangmtx.h \ 99 $(SOPHYAINCP)pexceptions.h \ 99 100 $(SOPHYAINCP)nbconst.h 100 101 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ lambdaBuilder.cc … … 198 199 $(SOPHYAINCP)fftservintf.h \ 199 200 $(SOPHYAINCP)fftpserver.h \ 200 $(SOPHYAINCP)fftservintf.h alm.h\201 $(SOPHYAINCP)s randgen.h \201 $(SOPHYAINCP)fftservintf.h \ 202 $(SOPHYAINCP)stsrand.h alm.h \ 202 203 $(SOPHYAINCP)nbmath.h \ 203 204 $(SOPHYAINCP)triangmtx.h \ 204 205 $(SOPHYAINCP)tvector.h lambdaBuilder.h \ 205 206 $(SOPHYAINCP)ndatablock.h \ 207 $(SOPHYAINCP)pexceptions.h \ 206 208 $(SOPHYAINCP)timing.h 207 209 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ sphericaltransformserver.cc -
trunk/SophyaLib/Samba/bruit.cc
r3533 r3572 220 220 //-- 221 221 { 222 int i,j;223 222 printf("OOFNoise::Print() MemL=%d Tau= %g \n", mMemL, mTau); 224 223 printf("OOFNoise::Print() Vecteur de Dynamique / Etat : \n"); 225 for(i =0; i<mMemL-1; i+=2)224 for(int i=0; i<mMemL-1; i+=2) 226 225 printf("%d: D=%g S=%g | %d: D=%g S=%g \n", i, 227 226 mDyn[i], mState[i], i+1, mDyn[i], mState[i]); … … 311 310 //-- 312 311 { 313 int i,j; 314 printf("EXPNoise::Print() MemL=%d Tau= %g \n", mMemL, mTau); 312 printf("EXPNoise::Print() MemL=%ld Tau= %g \n", mMemL, mTau); 315 313 printf("EXPNoise::Print() Vecteur de Dynamique / Etat : \n"); 316 for( i=0; i<mMemL-1; i+=2)317 printf("% d: D=%g S=%g | %d: D=%g S=%g \n", i,314 for(long int i=0; i<mMemL-1; i+=2) 315 printf("%ld: D=%g S=%g | %ld: D=%g S=%g \n", i, 318 316 mDyn[i], mState[i], i+1, mDyn[i], mState[i]); 319 317 … … 608 606 //-- 609 607 { 610 int i,j,rc=0;608 int rc=0; 611 609 printf("MemNoise::Print() MemL=%d Tau= %g \n", mMemL, mTau); 612 610 printf("mNtirage= %d , mMemPos= %d , mMemNeg= %d \n",mNtirage,mMemPos,mMemNeg); 613 611 // printf("MemNoise::Print() Vecteur de Dynamique / Etat : \n"); 614 /* for(i =0; i<mMemL-1; i+=2)612 /* for(int i=0; i<mMemL-1; i+=2) 615 613 printf("%d: D=%g S=%g | %d: D=%g S=%g \n", i, 616 614 mDyn[i], mState[i], i+1, mDyn[i], mState[i]); -
trunk/SophyaLib/Samba/lambdaBuilder.cc
r3533 r3572 137 137 register r_8 lam_0, lam_1, lam_2; 138 138 139 int_4 l,m, k;139 int_4 m, k; 140 140 141 141 for (m=0; m<=mmax;m++) { … … 194 194 register r_8 lam_0, lam_1, lam_2; 195 195 196 int_4 l,m, k;196 int_4 m, k; 197 197 198 198 for (m=0; m<=mmax;m++) { … … 235 235 register r_8 lam_0, lam_1, lam_2; 236 236 237 int_4 l,m, k;237 int_4 m, k; 238 238 239 239 for (m=0; m<=mmax;m++) { -
trunk/SophyaLib/Samba/smakefile
r3405 r3572 12 12 13 13 $(SOPHYAOBJP)alm.o: alm.cc $(SOPHYAINCP)sopnamsp.h alm.h \ 14 $(SOPHYAINCP)srandgen.h \ 15 $(SOPHYAINCP)machdefs.h \ 14 $(SOPHYAINCP)stsrand.h \ 15 $(SOPHYAINCP)machdefs.h \ 16 $(SOPHYAINCP)objfio.h \ 17 $(SOPHYAINCP)anydataobj.h \ 18 $(SOPHYAINCP)ppersist.h \ 19 $(SOPHYAINCP)pexceptions.h \ 20 $(SOPHYAINCP)gnumd5.h \ 21 $(SOPHYAINCP)ppfbinstream.h \ 22 $(SOPHYAINCP)rawstream.h \ 23 $(SOPHYAINCP)ppfnametag.h \ 24 $(SOPHYAINCP)ndatablock.h \ 16 25 $(SOPHYAINCP)nbmath.h \ 17 26 $(SOPHYAINCP)smathconst.h \ 18 27 $(SOPHYAINCP)triangmtx.h \ 19 $(SOPHYAINCP)ndatablock.h \ 20 $(SOPHYAINCP)anydataobj.h \ 21 $(SOPHYAINCP)pexceptions.h \ 22 $(SOPHYAINCP)tvector.h \ 23 $(SOPHYAINCP)tmatrix.h \ 24 $(SOPHYAINCP)tarray.h \ 25 $(SOPHYAINCP)basarr.h \ 26 $(SOPHYAINCP)mutyv.h \ 27 $(SOPHYAINCP)timestamp.h \ 28 $(SOPHYAINCP)objfio.h \ 29 $(SOPHYAINCP)ppersist.h \ 30 $(SOPHYAINCP)gnumd5.h \ 31 $(SOPHYAINCP)ppfbinstream.h \ 32 $(SOPHYAINCP)rawstream.h \ 33 $(SOPHYAINCP)ppfnametag.h \ 28 $(SOPHYAINCP)tvector.h \ 29 $(SOPHYAINCP)tmatrix.h \ 30 $(SOPHYAINCP)tarray.h \ 31 $(SOPHYAINCP)basarr.h \ 32 $(SOPHYAINCP)mutyv.h \ 33 $(SOPHYAINCP)timestamp.h \ 34 34 $(SOPHYAINCP)dvlist.h \ 35 35 $(SOPHYAINCP)utilarr.h \ … … 93 93 $(SOPHYAINCP)tmatrix_tsnl.h \ 94 94 $(SOPHYAINCP)tvector_tsnl.h alm.h \ 95 $(SOPHYAINCP)s randgen.h \95 $(SOPHYAINCP)stsrand.h \ 96 96 $(SOPHYAINCP)nbmath.h \ 97 97 $(SOPHYAINCP)smathconst.h \ 98 98 $(SOPHYAINCP)triangmtx.h \ 99 $(SOPHYAINCP)pexceptions.h \ 99 100 $(SOPHYAINCP)nbconst.h 100 101 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ lambdaBuilder.cc … … 198 199 $(SOPHYAINCP)fftservintf.h \ 199 200 $(SOPHYAINCP)fftpserver.h \ 200 $(SOPHYAINCP)fftservintf.h alm.h\201 $(SOPHYAINCP)s randgen.h \201 $(SOPHYAINCP)fftservintf.h \ 202 $(SOPHYAINCP)stsrand.h alm.h \ 202 203 $(SOPHYAINCP)nbmath.h \ 203 204 $(SOPHYAINCP)triangmtx.h \ 204 205 $(SOPHYAINCP)tvector.h lambdaBuilder.h \ 205 206 $(SOPHYAINCP)ndatablock.h \ 207 $(SOPHYAINCP)pexceptions.h \ 206 208 $(SOPHYAINCP)timing.h 207 209 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ sphericaltransformserver.cc -
trunk/SophyaLib/Samba/sphericaltransformserver.cc
r3510 r3572 211 211 int_4 nlmax=alm.Lmax(); 212 212 int_4 nmmax=nlmax; 213 int_4 nsmax=0;214 213 // le Resize est suppose mettre a zero 215 214 map.Resize(pixelSizeIndex); … … 521 520 522 521 alm.ReSizeToLmax(nlmax); 523 for ( int_4 ith = 0; ith < map.NbThetaSlices(); ith++)522 for (uint_4 ith = 0; ith < map.NbThetaSlices(); ith++) 524 523 { 525 524 r_8 phi0; … … 917 916 throw SzMismatchError("SphericalTransformServer::DecomposeToAlm: map Q and map U have not same size "); 918 917 } 919 for ( int_4 ith = 0; ith < mapq.NbThetaSlices(); ith++)918 for (uint_4 ith = 0; ith < mapq.NbThetaSlices(); ith++) 920 919 { 921 920 r_8 phi0; … … 1119 1118 Bm<complex<T> > b_m_theta_u(nmmax); 1120 1119 1121 for ( int_4 ith = 0; ith < mapq.NbThetaSlices();ith++)1120 for (uint_4 ith = 0; ith < mapq.NbThetaSlices();ith++) 1122 1121 { 1123 1122 int_4 nph; … … 1228 1227 Bm<complex<T> > b_m_theta_p(nmmax); 1229 1228 Bm<complex<T> > b_m_theta_m(nmmax); 1230 for ( int_4 ith = 0; ith < mapq.NbThetaSlices();ith++)1229 for (uint_4 ith = 0; ith < mapq.NbThetaSlices();ith++) 1231 1230 { 1232 1231 int_4 nph; -
trunk/SophyaLib/SkyMap/fiolocalmap.cc
r2869 r3572 167 167 int_4 nSzX= dobj->Size_x(); 168 168 int_4 nSzY= dobj->Size_y(); 169 int_4 nPix= dobj->NbPixels();170 169 171 170 if(dobj->ptrInfo()) … … 183 182 os.PutI4(nSzX); 184 183 os.PutI4(nSzY); 185 // os.PutI4(nPix);186 184 187 185 if(dobj->LocalMap_isDone()) -
trunk/SophyaLib/SkyMap/localmap.cc
r3300 r3572 256 256 throw(SzMismatchError("LocalMap<T>::CopyElt(const LocalMap<T>&) SizeMismatch")) ; 257 257 recopierVariablesSimples(a); 258 int k;259 258 pixels_ = a.pixels_; 260 259 return(*this); … … 349 348 double csTheta = cos(theta); 350 349 double snTheta = sin(theta); 351 double csPhi = cos(phi);352 double snPhi = sin(phi);353 350 double csPhiMPhiC = cos (phi - phiC_); 354 351 double snPhiMPhiC = sin (phi - phiC_); … … 585 582 double sin_phi_axeZ; 586 583 587 double cth,sth, cdeltaPhi, phi , cphi, sphi;584 double cth,sth, cdeltaPhi, phi; 588 585 589 586 if ( snthC_ <= 0.) // carte centree au pole -
trunk/SophyaLib/SkyMap/spherehealpix.cc
r2990 r3572 177 177 nPix_ = a.nPix_; 178 178 omeg_ = a.omeg_; 179 int k;180 179 if (fgring_ == a.fgring_) 181 for ( k=0; k< nPix_; k++) pixels_(k) = a.pixels_(k);180 for (int_4 k=0; k< nPix_; k++) pixels_(k) = a.pixels_(k); 182 181 else { 183 if (fgring_) for ( k=0; k< nPix_; k++)182 if (fgring_) for (int_4 k=0; k< nPix_; k++) 184 183 pixels_(k) = a.pixels_(ring2nest(nSide_, k)); 185 else for ( k=0; k< nPix_; k++)184 else for (int_4 k=0; k< nPix_; k++) 186 185 pixels_(k) = a.pixels_(nest2ring(nSide_, k)); 187 186 } 188 for ( k=0; k< a.sliceBeginIndex_.Size(); k++) sliceBeginIndex_(k) = a.sliceBeginIndex_(k);189 for ( k=0; k< a.sliceLenght_.Size(); k++) sliceLenght_(k) = a.sliceLenght_(k);187 for (size_t k=0; k< a.sliceBeginIndex_.Size(); k++) sliceBeginIndex_(k) = a.sliceBeginIndex_(k); 188 for (size_t k=0; k< a.sliceLenght_.Size(); k++) sliceLenght_(k) = a.sliceLenght_(k); 190 189 return(*this); 191 190 } … … 305 304 { 306 305 uint_4 nbslices = uint_4(4*nSide_-1); 307 if (index<0 || index >= nbslices)306 if (index<0 || index >= (int_4)nbslices) 308 307 throw RangeCheckError(" SphereHEALPix::ThetaOfSlice() index out of range"); 309 308 r_8 theta, phi0; … … 322 321 int_4 SphereHEALPix<T>::GetSymThetaSliceIndex(int_4 idx) const 323 322 { 324 if(idx < 0 || idx >= NbThetaSlices())323 if(idx < 0 || idx >= (int_4)NbThetaSlices()) 325 324 throw RangeCheckError("SphereHEALPix::GetSymThetaSliceIndex index out of range"); 326 325 return (NbThetaSlices()-1-idx); … … 340 339 void SphereHEALPix<T>::GetThetaSlice(int_4 index,r_8& theta,TVector<r_8>& phi,TVector<T>& value) const 341 340 { 342 if (index<0 || index >= NbThetaSlices())341 if (index<0 || index >= (int_4)NbThetaSlices()) 343 342 throw RangeCheckError(" SphereHEALPix::GetThetaSlice() index out of range"); 344 343 … … 391 390 { 392 391 393 if (sliceIndex<0 || sliceIndex >= NbThetaSlices())392 if (sliceIndex<0 || sliceIndex >= (int_4)NbThetaSlices()) 394 393 throw RangeCheckError(" SphereHEALPix::GetThetaSlice() index out of range"); 395 394 int_4 iring= sliceBeginIndex_(sliceIndex); … … 420 419 421 420 { 422 if (sliceIndex<0 || sliceIndex >= NbThetaSlices())421 if (sliceIndex<0 || sliceIndex >= (int_4)NbThetaSlices()) 423 422 throw RangeCheckError(" SphereHEALPix::GetThetaSliceDataPtr(): index out of range"); 424 423 if (fgring_) -
trunk/SophyaLib/SkyMap/spherepos.cc
r2973 r3572 11 11 #include <typeinfo> 12 12 13 static char *head_spherepos_cc_ = "$Header: /Users/garnier/temp/CVSSophya/SophyaLib/SkyMap/spherepos.cc,v 1.4 2006-06-20 16:01:48 ansari Exp $";14 13 15 14 -
trunk/SophyaLib/SkyMap/spherepos.h
r2973 r3572 9 9 #include "anydataobj.h" 10 10 11 static char *head_spherepos_h_ = "$Header: /Users/garnier/temp/CVSSophya/SophyaLib/SkyMap/spherepos.h,v 1.2 2006-06-20 16:01:48 ansari Exp $";12 11 13 12 namespace SOPHYA { -
trunk/SophyaLib/SkyMap/spherethetaphi.cc
r2990 r3572 192 192 NPix_ = a.NPix_; 193 193 Omega_ = a.Omega_; 194 int_4 k; 195 for (k=0; k< NPix_; k++) pixels_(k) = a.pixels_(k); 196 for (k=0; k< a.NPhi_.Size(); k++) NPhi_(k) = a.NPhi_(k); 197 for (k=0; k< a.TNphi_.Size(); k++) TNphi_(k) = a.TNphi_(k); 198 for (k=0; k< a.Theta_.Size(); k++) Theta_(k) = a.Theta_(k); 194 for (int_4 k=0; k< NPix_; k++) pixels_(k) = a.pixels_(k); 195 for (size_t k=0; k< a.NPhi_.Size(); k++) NPhi_(k) = a.NPhi_(k); 196 for (size_t k=0; k< a.TNphi_.Size(); k++) TNphi_(k) = a.TNphi_(k); 197 for (size_t k=0; k< a.Theta_.Size(); k++) Theta_(k) = a.Theta_(k); 199 198 return(*this); 200 199 … … 613 612 int_4 SphereThetaPhi<T>::GetSymThetaSliceIndex(int_4 idx) const 614 613 { 615 if(idx < 0 || idx >= NbThetaSlices())614 if(idx < 0 || idx >= (int_4)NbThetaSlices()) 616 615 throw RangeCheckError("SphereThetaPhi::GetSymThetaSliceIndex index out of range"); 617 616 return (NbThetaSlices()-1-idx); … … 630 629 { 631 630 632 if(index < 0 || index >= NbThetaSlices())631 if(index < 0 || index >= (int_4)NbThetaSlices()) 633 632 throw RangeCheckError("SphereThetaPhi::GetThetaSlice(idx...) index out of range"); 634 633 … … 665 664 { 666 665 667 if(index < 0 || index >= NbThetaSlices())666 if(index < 0 || index >= (int_4)NbThetaSlices()) 668 667 throw RangeCheckError("SphereThetaPhi::GetThetaSlice(idx...) idx out of range"); 669 668 … … 673 672 pixelIndices.ReSize(lring); 674 673 value.ReSize(lring); 675 double Te= 0.;676 double Fi= 0.;677 674 for(int_4 kk = 0; kk < lring; kk++) { 678 675 pixelIndices(kk)=kk+iring ; … … 686 683 T* SphereThetaPhi<T>::GetThetaSliceDataPtr(int_4 index) 687 684 { 688 if(index < 0 || index >= NbThetaSlices())685 if(index < 0 || index >= (int_4)NbThetaSlices()) 689 686 throw RangeCheckError("SphereThetaPhi::GetThetaSliceDataPtr(idx) idx out of range"); 690 687 return pixels_.Begin()+Index(index,0); -
trunk/SophyaLib/SysTools/commander.h
r2955 r3572 79 79 string& grp); 80 80 inline void RegisterCommand(string& keyw, string& usage, CmdExecutor * ce, 81 c har* grp)81 const char* grp) 82 82 { string sgrp = grp; RegisterCommand(keyw, usage, ce, sgrp); } 83 83 -
trunk/SophyaLib/SysTools/cxxcmplnk.cc
r3211 r3572 37 37 */ 38 38 39 static char * gcxx_opt = 40 "-O -fdollars-in-identifiers"; 41 static char * KCC_opt = 42 "-O --exceptions --rtti --auto_instantiation --one_instantiation_per_object -D__KCC__"; 43 static char * icc_opt = 44 "-O -fpic -frtti"; 45 static char * cxx_opt = 46 "-O -no_implicit_include -pthread"; 47 static char * SGICC_opt = "-O -prelink -D__SGICC__ -LANG:std"; 48 static char * xlC_opt = 49 "-O -qrtti=all -qeh=v6"; 39 static const char * gcxx_opt = "-O -fdollars-in-identifiers"; 40 static const char * KCC_opt = 41 "-O --exceptions --rtti --auto_instantiation --one_instantiation_per_object -D__KCC__"; 42 static const char * icc_opt = "-O -fpic -frtti"; 43 static const char * cxx_opt = 44 "-O -no_implicit_include -pthread"; 45 static const char * SGICC_opt = "-O -prelink -D__SGICC__ -LANG:std"; 46 static const char * xlC_opt = "-O -qrtti=all -qeh=v6"; 50 47 51 48 /* --Methode-- */ … … 251 248 int CxxCompilerLinker::BuildSO(string const & oname, string & soname) 252 249 { 253 // char * soext = ".dylib"; if defined(Darwin) - pas necessaire Reza 02/2002254 c har * soext = ".so";250 // const char * soext = ".dylib"; if defined(Darwin) - pas necessaire Reza 02/2002 251 const char * soext = ".so"; 255 252 256 253 if (soname.length() < 1) { -
trunk/SophyaLib/SysTools/timing.c
r2648 r3572 115 115 Comm, tcalt, tcal); 116 116 117 printf("ElapsedTime(hh:mm:ss): Total= %02 d:%02d:%02d ",117 printf("ElapsedTime(hh:mm:ss): Total= %02ld:%02ld:%02ld ", 118 118 etmt/3600, (etmt%3600)/60, etmt%60); 119 printf(" (Partial= %02 d:%02d:%02d)\n",119 printf(" (Partial= %02ld:%02ld:%02ld)\n", 120 120 etm/3600, (etm%3600)/60, etm%60); 121 121 -
trunk/SophyaLib/TArray/basarr.cc
r3446 r3572 22 22 23 23 // Variables statiques globales 24 c har * BaseArray::ck_op_msg_[6] =24 const char * BaseArray::ck_op_msg_[6] = 25 25 {"???", "Size(int )", "IsPacked(int )" 26 26 ,"Stride(int )", "ElemCheckBound()", "operator()" }; -
trunk/SophyaLib/TArray/basarr.h
r3173 r3572 200 200 DVList* mInfo; //!< Infos (variables) attached to the array 201 201 202 static c har * ck_op_msg_[6]; //!< Operation messages for CheckDI() CheckBound()202 static const char * ck_op_msg_[6]; //!< Operation messages for CheckDI() CheckBound() 203 203 static sa_size_t max_nprt_; //!< maximum number of printed elements 204 204 static int_4 prt_lev_; //!< Print level -
trunk/SophyaLib/TArray/triangmtx.h
r2957 r3572 32 32 33 33 //! Default constructor 34 TriangularMatrix() {;}; 34 TriangularMatrix() 35 : long_diag_(0) 36 { 37 } 38 35 39 //! instanciate a triangular matrix from the number of rows 36 TriangularMatrix(sa_size_t rowSize) : long_diag_(rowSize) 37 { 38 elem_.ReSize((rowSize*(rowSize+1)/2) ); 39 } 40 TriangularMatrix(sa_size_t rowSize) 41 : long_diag_(rowSize) 42 { 43 elem_.ReSize((rowSize*(rowSize+1)/2) ); 44 } 45 40 46 //! Copy constructor (possibility of sharing datas) 41 TriangularMatrix(const TriangularMatrix<T>& a, bool share=false) : elem_(a.elem_, share), long_diag_(a.long_diag_) {;} 47 TriangularMatrix(const TriangularMatrix<T>& a, bool share=false) 48 : long_diag_(a.long_diag_) , elem_(a.elem_, share) 49 { 50 } 42 51 43 52 //! resize the matrix with a new number of rows 44 53 inline void ReSizeRow(sa_size_t rowSize) 45 46 47 48 54 { 55 long_diag_=(uint_4)rowSize; 56 elem_.ReSize(long_diag_*(long_diag_+1)/2); 57 } 49 58 50 59 TriangularMatrix<T>& SetT(T a) -
trunk/SophyaLib/TArray/utilarr.cc
r3394 r3572 142 142 MuTyV & EnumeratedSequence::Value (sa_size_t k) const 143 143 { 144 if (k >= vecv_.size()) retv_ = 0;144 if (k >= (sa_size_t)vecv_.size()) retv_ = 0; 145 145 else retv_ = vecv_[k]; 146 146 return(retv_); … … 175 175 { 176 176 os << " EnumeratedSequence::Print() - Size()= " << Size() << endl; 177 for( int k=0; k<vecv_.size(); k++) {177 for(size_t k=0; k<vecv_.size(); k++) { 178 178 os << vecv_[k]; 179 179 if ((k > 0) && (k%10 == 0)) os << endl; … … 190 190 sa_size_t EnumeratedSequence::Append(EnumeratedSequence const & seq) 191 191 { 192 for( int k=0; k<seq.vecv_.size(); k++)192 for(size_t k=0; k<seq.vecv_.size(); k++) 193 193 vecv_.push_back(seq.vecv_[k]); 194 194 return(seq.vecv_.size()); … … 278 278 nc = 0; 279 279 sa_size_t n = 0; 280 char buff[256];280 //char buff[256]; 281 281 string line; 282 282 int nbad, nbadtot, nel;
Note:
See TracChangeset
for help on using the changeset viewer.