Changeset 3572 in Sophya for trunk/SophyaLib


Ignore:
Timestamp:
Feb 7, 2009, 10:50:34 PM (17 years ago)
Author:
cmv
Message:

char* -> const char* pour regler les problemes de deprecated string const... + comparaison unsigned signed + suppression EVOL_PLANCK rz+cmv 07/02/2009

Location:
trunk/SophyaLib
Files:
2 deleted
49 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/BaseTools/dvlist.cc

    r3233 r3572  
    115115/* --Methode-- */
    116116/*! Copy constructor - Object initialized using the PPF file \b flnm */
    117 DVList::DVList(char *flnm)
     117DVList::DVList(const char *flnm)
    118118{
    119119PInPersist s(flnm);
     
    192192// int_8   GetI(string const& key, int_8  def=-1)
    193193// r_8     GetD(string const& key, r_8 def=-9.e19)
    194 // string  GetS(string const& key, char* def="")
     194// string  GetS(string const& key, const char* def="")
    195195//      Retourne la valeur de la variable de nom "key" et de type entier, réél,
    196196//      chaine de caracteres.
     
    245245/*! Returns the value corresponding to name \b key, converted to string
    246246    Default value \b def is returned if name \b key not found */
    247 string      DVList::GetS(string const& key, char* def) const
     247string      DVList::GetS(string const& key, const char* def) const
    248248{
    249249ValList::const_iterator it = mvlist.find(key);
     
    265265// void  SetD(string const& key, r_8 val)
    266266// void  SetZ(string const& key, complex<r_8> val)
    267 // void  SetS(string const& key, char*  val)
     267// void  SetS(string const& key, const char*  val)
    268268// void  SetS(string const& key, string val)
    269269//      Crée la variable de nom "key", de type entier, double, complexe, string et
     
    322322/* --Methode-- */
    323323/*! Appends or sets the string value \b val in the list with name \b key */
    324 void        DVList::SetS(string const& key, char const* val)
     324void        DVList::SetS(string const& key, const char * val)
    325325{
    326326MuTyV div(val);
  • trunk/SophyaLib/BaseTools/dvlist.h

    r2826 r3572  
    2525                    DVList();
    2626                    DVList(const DVList&);
    27                     DVList(char *flnm);
     27                    DVList(const char *flnm);
    2828
    2929  virtual           ~DVList();
     
    3535
    3636  //! 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()); }
    3838  //! 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()); }
    4040
    4141  int_8             GetI(string const& key, int_8 def=-1) const;
    4242  r_8               GetD(string const& key, r_8 def=-9.e19) const;
    4343  complex<r_8>      GetZ(string const& key, complex<r_8> def=-9.e19) const;
    44   string            GetS(string const& key, char* def="") const;
     44  string            GetS(string const& key, const char* def="") const;
    4545  string            GetComment(string const& key) const;
    4646
     
    5151  void              SetD(string const& key, r_8 val);
    5252  void              SetZ(string const& key, complex<r_8> val);
    53   void              SetS(string const& key, char const*  val);
     53  void              SetS(string const& key, const char *  val);
    5454  void              SetS(string const& key, string const& val);
    5555  void              SetT(string const& key, TimeStamp const& val);
  • trunk/SophyaLib/BaseTools/ppfbinstream.cc

    r3525 r3572  
    511511        GetI8(i8);  // nb objets toplevel
    512512        GetU8(ui8); // nb de nametag
    513         for(int kt=0; kt<ui8; kt++) {
     513        for(uint_8 kt=0; kt<ui8; kt++) {
    514514          GetRawI4(i4);
    515515          s->seekg(i4,ios::cur);
     
    994994  int_4 tsz;
    995995  GetRawI4(tsz);
    996   if (tsz != sz)
     996  if (tsz != (int_4)sz)
    997997    throw FileFormatExc("PPFBinaryInputStream::GetPosTagTable Size mismatch ");
    998998  for(int kk=0; kk<tsz; kk++)
     
    10361036  // Pour indenter lors de l'impression
    10371037  #define _MXINDENT_ 10
    1038   char * indents[_MXINDENT_+1] = {"","  ", "    ", "      ", "        ", "          ",
     1038  const char * indents[_MXINDENT_+1] = {"","  ", "    ", "      ", "        ", "          ",
    10391039                                    "            ", "              ", "                ",
    10401040                                    "                  ", "                    "};
     
    11501150          GetI8s(stats,8);
    11511151          GetRawU8(ui8); // nb de nametag
    1152           for(int kt=0; kt<ui8; kt++) {
     1152          for(uint_8 kt=0; kt<ui8; kt++) {
    11531153            string tname;
    11541154            GetRawI8(i8);
  • trunk/SophyaLib/BaseTools/sophyainit.cc

    r3532 r3572  
    193193double SophyaInitiator::GetVersion(string& svers)
    194194{
    195   char* compiler = 0;
     195  const char* compiler = 0;
    196196  #ifdef __GNUG__
    197197  compiler = "gcc " __VERSION__;
  • trunk/SophyaLib/BaseTools/sversion.h

    r3532 r3572  
    33
    44#define SOPHYA_VERSION   2.1
    5 #define SOPHYA_REVISION  25
    6 #define SOPHYA_TAG       "V_Sep2008"
     5#define SOPHYA_REVISION  30
     6#define SOPHYA_TAG       "V_Fev2009"
    77
    88#endif
  • trunk/SophyaLib/HiStats/Makefile

    r3407 r3572  
    44 
    55clean:
    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.o
     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
    77        rm -f $(SOPHYALIBP)libHiStats.a
    88 
    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.o
     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
    1010        $(AR) $(ARFLAGS) $@ $?
    1111        touch $(SOPHYAINCP)/SophyaConfInfo/libsophya.objlist
     
    228228  $(SOPHYAINCP)utils.h hisprof.h histerr.h \
    229229  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 \
    233232  $(SOPHYAINCP)thsafeop.h swppfdtable.h \
    234233  $(SOPHYAINCP)swsegdb.h \
     
    384383        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  swppfdtable.cc
    385384 
    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.h
    402         $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  xntuple.cc
    403  
  • trunk/SophyaLib/HiStats/histats.h

    r3140 r3572  
    99#include "hist2err.h"
    1010#include "ntuple.h"
    11 #include "xntuple.h"
    1211#include "datatable.h"
    1312#include "swppfdtable.h"
  • trunk/SophyaLib/HiStats/histinit.cc

    r3169 r3572  
    1212#include "hist2err.h"
    1313#include "ntuple.h"
    14 #include "xntuple.h"
    1514#include "datatable.h"
    1615#include "swppfdtable.h"
     
    3938  - Histo2DErr
    4039  - NTuple
    41   - XNTuple
    4240  - DataTable
    4341  - SwPPFDataTable
     
    7068  PPRegister(ObjFileIO<NTuple>);
    7169  DObjRegister(ObjFileIO<NTuple>, NTuple);
    72   PPRegister(ObjFileIO<XNTuple>);
    73   DObjRegister(ObjFileIO<XNTuple>, XNTuple);
    7470
    7571  PPRegister(ObjFileIO<BaseDataTable>);
  • trunk/SophyaLib/HiStats/histos.cc

    r3236 r3572  
    15501550
    15511551// Ecriture entete pour identifier facilement
    1552 sprintf(strg,"V_2 mBins=%6d  NEnt=%15d  errok=%1d",dobj->mBins,dobj->nEntries,errok);
     1552sprintf(strg,"V_2 mBins=%6d  NEnt=%15llu  errok=%1d",dobj->mBins,dobj->nEntries,errok);
    15531553os.PutLine(strg);
    15541554sprintf(strg,"binw=%g  mMin=%g mMax=%g",dobj->binWidth,dobj->mMin,dobj->mMax);
  • trunk/SophyaLib/HiStats/ntuple.cc

    r3392 r3572  
    2626   #include "ntuple.h"
    2727   // ...
    28    char * names[3] = {"XPos", "YPos", "Val"};
     28   const char * names[3] = {"XPos", "YPos", "Val"};
    2929   // NTuple (Table) creation with 3 columns (double precision)
    3030   NTuple  nt(3, names);
     
    7373
    7474
    75 //! Constructor with specification of number of columns and column name
     75//! Constructor with specification of number of columns and column names
    7676/*!
    7777  \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
    7979  \param blk : Optional argument specifying number of table lines
    8080  in a given data block
     
    9090//--
    9191{
    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 }
     92if (nvar <= 0)  throw ParmError("NTuple::NTuple(nvar<=0) with char** noms");
     93Initialize(nvar,blk,fgdouble);
    11694for(int i=0; i<nvar; i++) mNames.push_back(noms[i]);
    11795return;
    11896}
    11997
    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//++
     109NTuple::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{
     116if (nvar <= 0)  throw ParmError("NTuple::NTuple(nvar<=0) with const char** noms");
     117Initialize(nvar,blk,fgdouble);
     118for(int i=0; i<nvar; i++) mNames.push_back(noms[i]);
     119return;
     120}
     121
     122//! Constructor with specification of number of columns and column names as a string vector
    121123/*!
    122124  \param noms : Array of column names (length(name) < 8 characters)
     
    128130NTuple::NTuple(vector<string>& noms, int blk, bool fgdouble)
    129131{
     132int nvar = noms.size();
     133if (nvar <= 0)  throw ParmError("NTuple::NTuple(nvar<=0) with vector<string>& noms");
     134Initialize(nvar,blk,fgdouble);
     135for(int i=0; i<nvar; i++) mNames.push_back(noms[i]);
     136return;
     137}
     138
     139
     140/* --Methode-- */
     141/* Initialisation pour Createurs (fonction privee) */
     142void NTuple::Initialize(int nvar, int blk, bool fgdouble)
     143{
    130144mNVar = mNEnt = mBlk = mNBlk = 0;
    131145mVar = NULL;
     
    133147mInfo = NULL;
    134148mThS = NULL;
    135 int nvar = noms.size();
    136 if (nvar <= 0)  throw ParmError("NTuple::NTuple(nvar<=0) ");
    137149mNVar = nvar;
    138150mVar = new r_4[nvar];
     
    153165  mFgDouble = false;
    154166}
    155 for(int i=0; i<nvar; i++) mNames.push_back(noms[i]);
     167
    156168return;
    157169}
     
    206218Clean();
    207219}
     220
    208221/* --Methode-- */
    209222/*!
     
    494507//--
    495508{
    496 char * tt = "float";
     509const char * tt = "float";
    497510if (mFgDouble) tt = "double";
    498511os << "NTuple T=" << tt << " : NVar= " << mNVar << " NEnt=" << mNEnt 
  • trunk/SophyaLib/HiStats/ntuple.h

    r3392 r3572  
    3030  NTuple();
    3131  NTuple(int nvar, char** noms, int blk=512, bool fgdouble=true);
     32  NTuple(int nvar, const char** noms, int blk=512, bool fgdouble=true);
    3233  NTuple(vector<string>& noms, int blk=512, bool fgdouble=true);
    3334  NTuple(const NTuple& NT);
     
    9697
    9798private:
     99  void Initialize(int nvar, int blk, bool fgdouble);
    98100  void  Clean();
    99101
  • trunk/SophyaLib/HiStats/objlist.list

    r3121 r3572  
    1212proxtuple.o
    1313swppfdtable.o
    14 xntuple.o
  • trunk/SophyaLib/HiStats/proxtuple.cc

    r2615 r3572  
    4141  if (_tuple==0) {
    4242    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());
    4444    _tuple=new NTuple(N,names);
    4545    delete[] names;
     
    5252  _val.clear();
    5353
    54 
    5554}
  • trunk/SophyaLib/HiStats/smakefile

    r3407 r3572  
    44 
    55clean:
    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.o
     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
    77        rm -f $(SOPHYALIBP)libHiStats.a
    88 
    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.o
     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
    1010        $(AR) $(ARFLAGS) $@ $?
    1111        touch $(SOPHYAINCP)/SophyaConfInfo/libsophya.objlist
     
    228228  $(SOPHYAINCP)utils.h hisprof.h histerr.h \
    229229  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 \
    233232  $(SOPHYAINCP)thsafeop.h swppfdtable.h \
    234233  $(SOPHYAINCP)swsegdb.h \
     
    384383        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  swppfdtable.cc
    385384 
    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.h
    402         $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  xntuple.cc
    403  
  • trunk/SophyaLib/NTools/Makefile

    r3406 r3572  
    44 
    55clean:
    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.o
     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)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
    77        rm -f $(SOPHYALIBP)libNTools.a
    88 
    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.o
     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)slinparbuff.o $(SOPHYAOBJP)tabmath.o $(SOPHYAOBJP)toeplitzMatrix.o
    1010        $(AR) $(ARFLAGS) $@ $?
    1111        touch $(SOPHYAINCP)/SophyaConfInfo/libsophya.objlist
     
    3939  $(SOPHYAINCP)matharr.h \
    4040  $(SOPHYAINCP)fioarr.h \
    41   $(SOPHYAINCP)sopemtx.h fftservintf.h \
     41  $(SOPHYAINCP)sopemtx.h \
     42  $(SOPHYAINCP)arrctcast.h fftservintf.h \
    4243  $(SOPHYAINCP)pexceptions.h \
    4344  $(SOPHYAINCP)tmatrix.h \
     
    640641        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  simplex.cc
    641642 
     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 
    642649$(SOPHYAOBJP)tabmath.o: tabmath.cc $(SOPHYAINCP)sopnamsp.h \
    643650  $(SOPHYAINCP)machdefs.h tabmath.h peida.h \
     
    677684  $(SOPHYAINCP)matharr.h \
    678685  $(SOPHYAINCP)fioarr.h \
    679   $(SOPHYAINCP)sopemtx.h fftservintf.h \
     686  $(SOPHYAINCP)sopemtx.h \
     687  $(SOPHYAINCP)arrctcast.h fftservintf.h \
    680688  $(SOPHYAINCP)pexceptions.h \
    681689  $(SOPHYAINCP)tmatrix.h \
  • trunk/SophyaLib/NTools/datatypes.cc

    r2615 r3572  
    99
    1010/* Nouvelle-Fonction */
    11 char * DataName(PBaseDataTypes typ)
     11const char * DataName(PBaseDataTypes typ)
    1212{
    1313switch (typ)
     
    3333
    3434/* Nouvelle-Fonction */
    35 char * DataLongName(PBaseDataTypes typ)
     35const char * DataLongName(PBaseDataTypes typ)
    3636{
    3737switch (typ)
  • trunk/SophyaLib/NTools/datatypes.h

    r244 r3572  
    2323inline PBaseDataTypes DataType(r_8)    {return kr_8;}
    2424
    25 char * DataName(PBaseDataTypes);
    26 char * DataLongName(PBaseDataTypes);
     25const char * DataName(PBaseDataTypes);
     26const char * DataLongName(PBaseDataTypes);
    2727int    DataSize(PBaseDataTypes);
    2828
  • trunk/SophyaLib/NTools/dates.cc

    r2808 r3572  
    3939TimeZone::TimeZone()
    4040{
    41   char* p = getenv("ACQ_TZ");
     41  const char* p = getenv("ACQ_TZ");
    4242#if defined(__DECCXX) || defined(__KCC__) || defined(__aCC__)
    4343  if (!p) p = const_cast<char *>("France");
  • trunk/SophyaLib/NTools/functab.cc

    r2618 r3572  
    5353  Dx = (r_8)(XMax-XMin)/(r_8)(NTab-1);
    5454  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.;
    5656  PInterpL = PInterpP[0] = PInterpP[1] = NULL;
    5757  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);
    5959  Tabul[0] = Tabul[1];
    6060  Tabul[NTab+1] = Tabul[NTab];
     
    106106    if(PInterpL) delete [] PInterpL;
    107107    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++)
    109109      PInterpL[i] = (Tabul[i+1]-Tabul[i])/Dx;
    110110    PInterpL[NTab+1] = 0.;
     
    116116    PInterpP[0] = new r_8[NTab+2];
    117117    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++) {
    119119      PInterpP[0][i] = (Tabul[i+1]+Tabul[i-1]-2.*Tabul[i])/(2.*Dx*Dx);
    120120      PInterpP[1][i] = (Tabul[i+1]-Tabul[i-1])/(2.*Dx);
  • trunk/SophyaLib/NTools/generalfit.cc

    r3205 r3572  
    279279  Pour ecrire les iterations dans le fichier filename
    280280*/
    281 void GeneralFit::WriteStep(char *filename)
     281void GeneralFit::WriteStep(const char *filename)
    282282{
    283283
  • trunk/SophyaLib/NTools/generalfit.h

    r3083 r3572  
    5353  ~GeneralFit();
    5454
    55   void            WriteStep(char *filename = NULL);
     55  void            WriteStep(const char *filename = NULL);
    5656  void            SetDebug(int level = 0);
    5757  void            SetMaxStep(int n = 100);
  • trunk/SophyaLib/NTools/ntools.h

    r1316 r3572  
    1515#include "poly.h"
    1616#include "datatypes.h"
     17#include "slinparbuff.h"
    1718
    1819#include "cimage.h"
  • trunk/SophyaLib/NTools/objlist.list

    r3083 r3572  
    3131simplesort.o
    3232simplex.o
     33slinparbuff.o
    3334tabmath.o
    3435toeplitzMatrix.o
  • trunk/SophyaLib/NTools/pclassids.h

    r2602 r3572  
    3030   ClassId_HistoErr = 0x0204,
    3131   ClassId_NTuple   = 0x0210,
    32    ClassId_XNTuple  = 0x0211,
    3332
    3433   ClassId_GeneralFitData  = 0x0290,
  • trunk/SophyaLib/NTools/poly.cc

    r3235 r3572  
    710710Poly2& Poly2::operator *= (double a)
    711711{
    712   for (uint_4 i=0; i<NElts(); i++) Element(i) *= a;
     712  for (int_4 i=0; i<NElts(); i++) Element(i) *= a;
    713713  return *this;
    714714}
  • trunk/SophyaLib/NTools/simplex.cc

    r2808 r3572  
    366366  int ilo, ihi, inhi;
    367367  int move = 0;
    368   char* smov[6] = { "None", "Reflection", "ReflecExpand", "ContractHigh", "ContractLow", "ExpandHigh" };
     368  const char* smov[6] = { "None", "Reflection", "ReflecExpand", "ContractHigh", "ContractLow", "ExpandHigh" };
    369369  int movcnt[6] = {0,0,0,0,0,0};
    370370
     
    511511int MinZSimplex::StopReason(string& s)
    512512{
    513   char* 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",
    514514                  "OK, [Df/f max]Iter<Tol2" "Error - Wrong StopReason" };
    515515  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>
    71#include "pexceptions.h"
    82
     
    1711  friend class SLinParBuffMerger;
    1812
    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();
    3117
    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);
    3722
    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);
    16626  inline uint_4 NPoints(void) {return mNCur;}
    16727
    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;}
    19130
    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);
    19635
    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);
    32238
    32339protected:
     
    32945  uint_4 mNResynchEff, mNPush, mNPop;
    33046};
     47
    33148
    33249///////////////////////////////////////////////////////////////////
     
    34360class SLinParBuffMerger {
    34461public:
    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  NPoints(void) {return mSlp.NPoints();}
     62  SLinParBuffMerger(void);
     63  SLinParBuffMerger(SLinParBuff& s,bool recompute=false);
     64  virtual ~SLinParBuffMerger(void);
     65
     66  inline uint_4 NPoints(void) {return mSlp.NPoints();}
    35067  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);}
    38772  inline void Print(int lp=0) {mSlp.Print(lp);}
    38873  inline void PrintCompute(int lp=0) {mSlp.PrintCompute(lp);}
  • trunk/SophyaLib/NTools/smakefile

    r3503 r3572  
    44 
    55clean:
    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.o
     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)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
    77        rm -f $(SOPHYALIBP)libNTools.a
    88 
    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.o
     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)slinparbuff.o $(SOPHYAOBJP)tabmath.o $(SOPHYAOBJP)toeplitzMatrix.o
    1010        $(AR) $(ARFLAGS) $@ $?
    1111        touch $(SOPHYAINCP)/SophyaConfInfo/libsophya.objlist
     
    641641        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  simplex.cc
    642642 
     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 
    643649$(SOPHYAOBJP)tabmath.o: tabmath.cc $(SOPHYAINCP)sopnamsp.h \
    644650  $(SOPHYAINCP)machdefs.h tabmath.h peida.h \
  • trunk/SophyaLib/SUtils/datacards.cc

    r2615 r3572  
    11//
    2 // $Id: datacards.cc,v 1.10 2004-09-10 09:54:48 cmv Exp $
     2// $Id: datacards.cc,v 1.11 2009-02-07 21:49:59 cmv Exp $
    33//
    44//
     
    217217DataCards::GetKey(int num) const
    218218{
    219   if ((num < 0) || (num >= cards.size()) )  return("");
     219  if ((num < 0) || (num >= (int)cards.size()) )  return("");
    220220  int k = 0;
    221221  CardList::const_iterator i;
     
    234234  DataCards::CardList::const_iterator it = FindKeyC(key);
    235235  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++) {
    237237    rs += ' ';  rs += (*it).tokens[k];
    238238  }
     
    246246  DataCards::CardList::const_iterator it = FindKeyC(key);
    247247  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;
    249249  return (*it).tokens[numero];
    250250}
     
    308308DataCards::ApplyPF(CrdPF & cpf, string const& key, string const& toks)
    309309{
    310 int l,lk;
     310size_t l,lk;
    311311int rc = 0;
    312312// On verifie si le "pattern" correspond
  • trunk/SophyaLib/SUtils/strutilxx.cc

    r2706 r3572  
    1313// considering char "sep" as a separator.
    1414// Vector is filled from its end (no reset done).
    15 // Tp write a "sep" char, use \'sep'
     15// To write a "sep" char, use \'sep'
    1616// Warning: separator "sep" could not be set to '\'
    1717// Ex: sep=' ': s="aaa   bbb cc d " -> vs=(aaa,bbb,cc,d)
     
    5555// - Fill "vs" at the end: NO RESET IS DONE
    5656// - If ',' is the separator, ",,," is c
    57 // That routine is much more rapid than FillVStringFrString altouch less general
     57// That routine is much more rapid than FillVStringFrString although less general
    5858//           (ex no '\' gestion is done)
    5959{
    6060 uint_4 ls = s.size();
    6161 if(ls<=0) return;
    62  bool sep_non_blanc = (separator==' ')? false: true;
     62 //bool sep_non_blanc = (separator==' ')? false: true;
    6363 char *str = new char[ls+2];
    6464
  • trunk/SophyaLib/SUtils/utils.cc

    r2615 r3572  
    11// This may look like C code, but it is really -*- C++ -*-
    22//
    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 $
    44//
    55
     
    1515  int i;   // THINK C ne veut pas du int i dans chaque for...
    1616  if (dest < source)
    17     for (i=0; i<n; i++)
     17    for (i=0; i<(int)n; i++)
    1818      ((char*)dest)[i] = ((char*)source)[i];
    1919  else
  • trunk/SophyaLib/Samba/Makefile

    r3405 r3572  
    1212 
    1313$(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 \
    1625  $(SOPHYAINCP)nbmath.h \
    1726  $(SOPHYAINCP)smathconst.h \
    1827  $(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 \
    3434  $(SOPHYAINCP)dvlist.h \
    3535  $(SOPHYAINCP)utilarr.h \
     
    9393  $(SOPHYAINCP)tmatrix_tsnl.h \
    9494  $(SOPHYAINCP)tvector_tsnl.h alm.h \
    95   $(SOPHYAINCP)srandgen.h \
     95  $(SOPHYAINCP)stsrand.h \
    9696  $(SOPHYAINCP)nbmath.h \
    9797  $(SOPHYAINCP)smathconst.h \
    9898  $(SOPHYAINCP)triangmtx.h \
     99  $(SOPHYAINCP)pexceptions.h \
    99100  $(SOPHYAINCP)nbconst.h
    100101        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  lambdaBuilder.cc
     
    198199  $(SOPHYAINCP)fftservintf.h \
    199200  $(SOPHYAINCP)fftpserver.h \
    200   $(SOPHYAINCP)fftservintf.h alm.h \
    201   $(SOPHYAINCP)srandgen.h \
     201  $(SOPHYAINCP)fftservintf.h \
     202  $(SOPHYAINCP)stsrand.h alm.h \
    202203  $(SOPHYAINCP)nbmath.h \
    203204  $(SOPHYAINCP)triangmtx.h \
    204205  $(SOPHYAINCP)tvector.h lambdaBuilder.h \
    205206  $(SOPHYAINCP)ndatablock.h \
     207  $(SOPHYAINCP)pexceptions.h \
    206208  $(SOPHYAINCP)timing.h
    207209        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  sphericaltransformserver.cc
  • trunk/SophyaLib/Samba/bruit.cc

    r3533 r3572  
    220220//--
    221221{
    222 int i,j;
    223222printf("OOFNoise::Print()  MemL=%d  Tau= %g \n", mMemL, mTau);
    224223printf("OOFNoise::Print() Vecteur de Dynamique / Etat : \n");
    225 for(i=0; i<mMemL-1; i+=2)
     224for(int i=0; i<mMemL-1; i+=2)
    226225  printf("%d:   D=%g  S=%g   | %d:  D=%g  S=%g \n", i,
    227226         mDyn[i], mState[i], i+1, mDyn[i], mState[i]);   
     
    311310//--
    312311{
    313 int i,j;
    314 printf("EXPNoise::Print()  MemL=%d  Tau= %g \n", mMemL, mTau);
     312printf("EXPNoise::Print()  MemL=%ld  Tau= %g \n", mMemL, mTau);
    315313printf("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,
     314for(long int i=0; i<mMemL-1; i+=2)
     315  printf("%ld:   D=%g  S=%g   | %ld:  D=%g  S=%g \n", i,
    318316         mDyn[i], mState[i], i+1, mDyn[i], mState[i]);   
    319317
     
    608606//--
    609607{
    610 int i,j,rc=0;
     608int rc=0;
    611609printf("MemNoise::Print()  MemL=%d  Tau= %g \n", mMemL, mTau);
    612610printf("mNtirage= %d , mMemPos= %d , mMemNeg= %d \n",mNtirage,mMemPos,mMemNeg);
    613611// 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)
    615613  printf("%d:   D=%g  S=%g   | %d:  D=%g  S=%g \n", i,
    616614         mDyn[i], mState[i], i+1, mDyn[i], mState[i]);   
  • trunk/SophyaLib/Samba/lambdaBuilder.cc

    r3533 r3572  
    137137  register r_8 lam_0, lam_1, lam_2;
    138138
    139   int_4 l, m, k;
     139  int_4 m, k;
    140140
    141141  for (m=0; m<=mmax;m++)   {
     
    194194  register r_8 lam_0, lam_1, lam_2;
    195195 
    196   int_4 l, m, k;
     196  int_4 m, k;
    197197
    198198  for (m=0; m<=mmax;m++)  {
     
    235235  register r_8 lam_0, lam_1, lam_2;
    236236 
    237   int_4 l, m, k;
     237  int_4 m, k;
    238238
    239239  for (m=0; m<=mmax;m++)  {
  • trunk/SophyaLib/Samba/smakefile

    r3405 r3572  
    1212 
    1313$(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 \
    1625  $(SOPHYAINCP)nbmath.h \
    1726  $(SOPHYAINCP)smathconst.h \
    1827  $(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 \
    3434  $(SOPHYAINCP)dvlist.h \
    3535  $(SOPHYAINCP)utilarr.h \
     
    9393  $(SOPHYAINCP)tmatrix_tsnl.h \
    9494  $(SOPHYAINCP)tvector_tsnl.h alm.h \
    95   $(SOPHYAINCP)srandgen.h \
     95  $(SOPHYAINCP)stsrand.h \
    9696  $(SOPHYAINCP)nbmath.h \
    9797  $(SOPHYAINCP)smathconst.h \
    9898  $(SOPHYAINCP)triangmtx.h \
     99  $(SOPHYAINCP)pexceptions.h \
    99100  $(SOPHYAINCP)nbconst.h
    100101        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  lambdaBuilder.cc
     
    198199  $(SOPHYAINCP)fftservintf.h \
    199200  $(SOPHYAINCP)fftpserver.h \
    200   $(SOPHYAINCP)fftservintf.h alm.h \
    201   $(SOPHYAINCP)srandgen.h \
     201  $(SOPHYAINCP)fftservintf.h \
     202  $(SOPHYAINCP)stsrand.h alm.h \
    202203  $(SOPHYAINCP)nbmath.h \
    203204  $(SOPHYAINCP)triangmtx.h \
    204205  $(SOPHYAINCP)tvector.h lambdaBuilder.h \
    205206  $(SOPHYAINCP)ndatablock.h \
     207  $(SOPHYAINCP)pexceptions.h \
    206208  $(SOPHYAINCP)timing.h
    207209        $(CXXCOMPILE) $(CXXTEMPFLG) -o $@  sphericaltransformserver.cc
  • trunk/SophyaLib/Samba/sphericaltransformserver.cc

    r3510 r3572  
    211211  int_4 nlmax=alm.Lmax();
    212212  int_4 nmmax=nlmax;
    213   int_4 nsmax=0;
    214213  // le Resize est suppose mettre a zero
    215214  map.Resize(pixelSizeIndex);
     
    521520 
    522521  alm.ReSizeToLmax(nlmax);
    523   for (int_4 ith = 0; ith < map.NbThetaSlices(); ith++)
     522  for (uint_4 ith = 0; ith < map.NbThetaSlices(); ith++)
    524523    {
    525524      r_8 phi0;
     
    917916      throw SzMismatchError("SphericalTransformServer::DecomposeToAlm: map Q and map U have not same size ");
    918917    }
    919   for (int_4 ith = 0; ith < mapq.NbThetaSlices(); ith++)
     918  for (uint_4 ith = 0; ith < mapq.NbThetaSlices(); ith++)
    920919    {
    921920      r_8 phi0;
     
    11191118  Bm<complex<T> > b_m_theta_u(nmmax);
    11201119
    1121   for (int_4 ith = 0; ith < mapq.NbThetaSlices();ith++)
     1120  for (uint_4 ith = 0; ith < mapq.NbThetaSlices();ith++)
    11221121    {
    11231122      int_4 nph;
     
    12281227  Bm<complex<T> > b_m_theta_p(nmmax);
    12291228  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++)
    12311230    {
    12321231      int_4 nph;
  • trunk/SophyaLib/SkyMap/fiolocalmap.cc

    r2869 r3572  
    167167  int_4 nSzX= dobj->Size_x();
    168168  int_4 nSzY= dobj->Size_y();
    169   int_4 nPix= dobj->NbPixels();
    170169 
    171170  if(dobj->ptrInfo())
     
    183182  os.PutI4(nSzX);
    184183  os.PutI4(nSzY);
    185   //  os.PutI4(nPix);
    186184
    187185  if(dobj->LocalMap_isDone())
  • trunk/SophyaLib/SkyMap/localmap.cc

    r3300 r3572  
    256256    throw(SzMismatchError("LocalMap<T>::CopyElt(const LocalMap<T>&) SizeMismatch")) ;
    257257      recopierVariablesSimples(a);     
    258   int k;
    259258  pixels_ = a.pixels_;
    260259  return(*this);
     
    349348  double csTheta = cos(theta);
    350349  double snTheta = sin(theta);
    351   double csPhi   = cos(phi);
    352   double snPhi   = sin(phi);
    353350  double csPhiMPhiC = cos (phi - phiC_);
    354351  double snPhiMPhiC = sin (phi - phiC_);
     
    585582  double sin_phi_axeZ;
    586583
    587   double cth,sth, cdeltaPhi, phi, cphi, sphi;
     584  double cth,sth, cdeltaPhi, phi;
    588585
    589586  if ( snthC_ <= 0.) // carte centree au pole
  • trunk/SophyaLib/SkyMap/spherehealpix.cc

    r2990 r3572  
    177177  nPix_ = a.nPix_;
    178178  omeg_ = a.omeg_;
    179   int k;
    180179  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);
    182181  else {
    183     if (fgring_)  for (k=0; k< nPix_; k++)
     182    if (fgring_)  for (int_4 k=0; k< nPix_; k++)
    184183      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++)
    186185      pixels_(k) = a.pixels_(nest2ring(nSide_, k));                         
    187186  }
    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);
    190189  return(*this);
    191190}
     
    305304{
    306305  uint_4 nbslices = uint_4(4*nSide_-1);
    307   if (index<0 || index >= nbslices)
     306  if (index<0 || index >= (int_4)nbslices)
    308307    throw RangeCheckError(" SphereHEALPix::ThetaOfSlice()  index out of range");
    309308  r_8 theta, phi0;
     
    322321int_4 SphereHEALPix<T>::GetSymThetaSliceIndex(int_4 idx) const
    323322{
    324   if(idx < 0 || idx >= NbThetaSlices())
     323  if(idx < 0 || idx >= (int_4)NbThetaSlices())
    325324    throw RangeCheckError("SphereHEALPix::GetSymThetaSliceIndex index out of range");
    326325  return (NbThetaSlices()-1-idx);
     
    340339void SphereHEALPix<T>::GetThetaSlice(int_4 index,r_8& theta,TVector<r_8>& phi,TVector<T>& value) const
    341340{
    342   if (index<0 || index >= NbThetaSlices())
     341  if (index<0 || index >= (int_4)NbThetaSlices())
    343342    throw RangeCheckError(" SphereHEALPix::GetThetaSlice()  index out of range");
    344343
     
    391390{
    392391
    393   if (sliceIndex<0 || sliceIndex >= NbThetaSlices())
     392  if (sliceIndex<0 || sliceIndex >= (int_4)NbThetaSlices())
    394393    throw RangeCheckError(" SphereHEALPix::GetThetaSlice() index out of range");
    395394  int_4 iring= sliceBeginIndex_(sliceIndex);
     
    420419
    421420{
    422   if (sliceIndex<0 || sliceIndex >= NbThetaSlices())
     421  if (sliceIndex<0 || sliceIndex >= (int_4)NbThetaSlices())
    423422    throw RangeCheckError(" SphereHEALPix::GetThetaSliceDataPtr(): index out of range");
    424423  if (fgring_)
  • trunk/SophyaLib/SkyMap/spherepos.cc

    r2973 r3572  
    1111#include <typeinfo>
    1212
    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 $";
    1413
    1514
  • trunk/SophyaLib/SkyMap/spherepos.h

    r2973 r3572  
    99#include "anydataobj.h"
    1010
    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 $";
    1211
    1312namespace SOPHYA {
  • trunk/SophyaLib/SkyMap/spherethetaphi.cc

    r2990 r3572  
    192192  NPix_  = a.NPix_;
    193193  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);
    199198  return(*this);
    200199
     
    613612int_4 SphereThetaPhi<T>::GetSymThetaSliceIndex(int_4 idx) const
    614613{
    615   if(idx < 0 || idx >= NbThetaSlices())
     614  if(idx < 0 || idx >= (int_4)NbThetaSlices())
    616615    throw RangeCheckError("SphereThetaPhi::GetSymThetaSliceIndex index out of range");
    617616  return (NbThetaSlices()-1-idx);
     
    630629{
    631630
    632   if(index < 0 || index >= NbThetaSlices())
     631  if(index < 0 || index >= (int_4)NbThetaSlices())
    633632    throw RangeCheckError("SphereThetaPhi::GetThetaSlice(idx...) index out of range");
    634633   
     
    665664{
    666665
    667   if(index < 0 || index >= NbThetaSlices())
     666  if(index < 0 || index >= (int_4)NbThetaSlices())
    668667    throw RangeCheckError("SphereThetaPhi::GetThetaSlice(idx...)  idx out of range");
    669668
     
    673672  pixelIndices.ReSize(lring);
    674673  value.ReSize(lring);
    675   double Te= 0.;
    676   double Fi= 0.;
    677674  for(int_4 kk = 0; kk < lring; kk++)  {
    678675    pixelIndices(kk)=kk+iring ;
     
    686683T* SphereThetaPhi<T>::GetThetaSliceDataPtr(int_4 index)
    687684{
    688   if(index < 0 || index >= NbThetaSlices())
     685  if(index < 0 || index >= (int_4)NbThetaSlices())
    689686    throw RangeCheckError("SphereThetaPhi::GetThetaSliceDataPtr(idx)  idx out of range");
    690687  return pixels_.Begin()+Index(index,0);
  • trunk/SophyaLib/SysTools/commander.h

    r2955 r3572  
    7979                                        string& grp);
    8080  inline  void          RegisterCommand(string& keyw, string& usage, CmdExecutor * ce,
    81                                         char* grp)
     81                                        const char* grp)
    8282                        { string sgrp = grp; RegisterCommand(keyw, usage, ce, sgrp); }
    8383
  • trunk/SophyaLib/SysTools/cxxcmplnk.cc

    r3211 r3572  
    3737*/
    3838
    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";
     39static const char * gcxx_opt = "-O -fdollars-in-identifiers";
     40static const char * KCC_opt =
     41  "-O --exceptions --rtti  --auto_instantiation --one_instantiation_per_object -D__KCC__";
     42static const char * icc_opt = "-O -fpic -frtti";
     43static const char * cxx_opt =
     44  "-O -no_implicit_include -pthread";
     45static const char * SGICC_opt =  "-O -prelink -D__SGICC__ -LANG:std";
     46static const char * xlC_opt = "-O -qrtti=all -qeh=v6";
    5047
    5148/* --Methode-- */
     
    251248int CxxCompilerLinker::BuildSO(string const & oname, string & soname)
    252249{
    253   // char * soext = ".dylib"; if defined(Darwin) - pas necessaire Reza 02/2002
    254   char * soext = ".so";
     250  // const char * soext = ".dylib"; if defined(Darwin) - pas necessaire Reza 02/2002
     251  const char * soext = ".so";
    255252
    256253  if (soname.length() < 1) {
  • trunk/SophyaLib/SysTools/timing.c

    r2648 r3572  
    115115          Comm, tcalt, tcal);
    116116
    117 printf("ElapsedTime(hh:mm:ss): Total= %02d:%02d:%02d ",
     117printf("ElapsedTime(hh:mm:ss): Total= %02ld:%02ld:%02ld ",
    118118       etmt/3600, (etmt%3600)/60, etmt%60);
    119 printf(" (Partial= %02d:%02d:%02d)\n",
     119printf(" (Partial= %02ld:%02ld:%02ld)\n",
    120120       etm/3600, (etm%3600)/60, etm%60);
    121121
  • trunk/SophyaLib/TArray/basarr.cc

    r3446 r3572  
    2222
    2323// Variables statiques globales
    24 char * BaseArray::ck_op_msg_[6] =
     24const char * BaseArray::ck_op_msg_[6] =
    2525     {"???", "Size(int )", "IsPacked(int )"
    2626     ,"Stride(int )", "ElemCheckBound()", "operator()" };
  • trunk/SophyaLib/TArray/basarr.h

    r3173 r3572  
    200200  DVList* mInfo;    //!< Infos (variables) attached to the array
    201201
    202   static char * ck_op_msg_[6]; //!< Operation messages for CheckDI() CheckBound()
     202  static const char * ck_op_msg_[6]; //!< Operation messages for CheckDI() CheckBound()
    203203  static sa_size_t max_nprt_; //!< maximum number of printed elements
    204204  static int_4 prt_lev_;  //!< Print level
  • trunk/SophyaLib/TArray/triangmtx.h

    r2957 r3572  
    3232
    3333//! Default constructor
    34 TriangularMatrix()   {;};
     34TriangularMatrix()
     35  : long_diag_(0)
     36{
     37}
     38
    3539//! 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   }
     40TriangularMatrix(sa_size_t rowSize)
     41  : long_diag_(rowSize)
     42{
     43  elem_.ReSize((rowSize*(rowSize+1)/2) );
     44}
     45
    4046//! Copy constructor (possibility of sharing datas)
    41   TriangularMatrix(const TriangularMatrix<T>& a,  bool share=false)  : elem_(a.elem_, share),  long_diag_(a.long_diag_) {;}
     47TriangularMatrix(const TriangularMatrix<T>& a,  bool share=false) 
     48  : long_diag_(a.long_diag_) , elem_(a.elem_, share) 
     49{
     50}
    4251
    4352//! resize the matrix with a new number of rows
    4453inline void ReSizeRow(sa_size_t rowSize)
    45   {
    46     long_diag_=(uint_4)rowSize;
    47     elem_.ReSize(long_diag_*(long_diag_+1)/2);
    48   }
     54{
     55  long_diag_=(uint_4)rowSize;
     56  elem_.ReSize(long_diag_*(long_diag_+1)/2);
     57}
    4958
    5059TriangularMatrix<T>& SetT(T a)
  • trunk/SophyaLib/TArray/utilarr.cc

    r3394 r3572  
    142142MuTyV & EnumeratedSequence::Value (sa_size_t k) const
    143143{
    144   if (k >= vecv_.size())  retv_ = 0;
     144  if (k >= (sa_size_t)vecv_.size())  retv_ = 0;
    145145  else retv_ = vecv_[k];
    146146  return(retv_);
     
    175175{
    176176  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++) {
    178178    os << vecv_[k];
    179179    if ((k > 0) && (k%10 == 0))  os << endl;
     
    190190sa_size_t EnumeratedSequence::Append(EnumeratedSequence const & seq)
    191191{
    192   for(int k=0; k<seq.vecv_.size(); k++)
     192  for(size_t k=0; k<seq.vecv_.size(); k++)
    193193    vecv_.push_back(seq.vecv_[k]);
    194194  return(seq.vecv_.size());
     
    278278  nc = 0;
    279279  sa_size_t n = 0;
    280   char buff[256];
     280  //char buff[256];
    281281  string line;
    282282  int nbad, nbadtot, nel;
Note: See TracChangeset for help on using the changeset viewer.