Changeset 958 in Sophya


Ignore:
Timestamp:
Apr 18, 2000, 3:38:53 PM (25 years ago)
Author:
ansari
Message:

doc + vire warning cmv 18/04/00

Location:
trunk/SophyaLib
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/HiStats/hisprof.h

    r943 r958  
    8383
    8484
     85/*! \ingroup HiStats \fn operator<<(POuttPersist&, HProf)
     86  \brief Persistance management */
    8587inline POutPersist& operator << (POutPersist& os, HProf & obj)
    8688{ ObjFileIO<HProf> fio(&obj);  fio.Write(os);  return(os); }
     89/*! \ingroup HiStats \fn operator>>(PInPersist&, HProf)
     90  \brief Persistance management */
    8791inline PInPersist& operator >> (PInPersist& is, HProf & obj)
    8892{ ObjFileIO<HProf> fio(&obj);  fio.Read(is);  return(is); }
  • trunk/SophyaLib/HiStats/histos.cc

    r943 r958  
    11//
    2 // $Id: histos.cc,v 1.4 2000-04-15 11:06:27 ansari Exp $
     2// $Id: histos.cc,v 1.5 2000-04-18 13:38:16 ansari Exp $
    33//
    44
     
    432432void Histo::PutValue(TVector<r_8> &v, int ierr)
    433433{
    434 if(v.NElts()<bins) THROW(sizeMismatchErr);
     434if(v.NElts()<(uint_4) bins) THROW(sizeMismatchErr);
    435435for(int i=0;i<bins;i++) {
    436436  data[i] = v(i);
     
    445445void Histo::PutValueAdd(TVector<r_8> &v, int ierr)
    446446{
    447 if(v.NElts()<bins) THROW(sizeMismatchErr);
     447if(v.NElts()<(uint_4) bins) THROW(sizeMismatchErr);
    448448for(int i=0;i<bins;i++) {
    449449  data[i] += v(i);
     
    458458void Histo::PutError2(TVector<r_8> &v)
    459459{
    460 if(v.NElts()<bins) THROW(sizeMismatchErr);
     460if(v.NElts()<(uint_4) bins) THROW(sizeMismatchErr);
    461461if(!err2) Errors();
    462462for(int i=0;i<bins;i++) err2[i] = v(i);
     
    469469void Histo::PutError2Add(TVector<r_8> &v)
    470470{
    471 if(v.NElts()<bins) THROW(sizeMismatchErr);
     471if(v.NElts()<(uint_4) bins) THROW(sizeMismatchErr);
    472472if(!err2) Errors();
    473473for(int i=0;i<bins;i++) if(v(i)>0.) err2[i] += v(i);
     
    480480void Histo::PutError(TVector<r_8> &v)
    481481{
    482 if(v.NElts()<bins) THROW(sizeMismatchErr);
     482if(v.NElts()<(uint_4) bins) THROW(sizeMismatchErr);
    483483if(!err2) Errors();
    484484for(int i=0;i<bins;i++)
     
    13601360  double f = (double) (*this)(i);
    13611361  double saf = sqrt(fabs((double) f)); if(saf<1.) saf=1.;
    1362   double e;
     1362  double e=0.;
    13631363  if(typ_err==0)      {if(HasErrors()) e=Error(i); else e=1.;}
    13641364  else if(typ_err==1) {if(HasErrors()) e=Error(i); else e=saf;}
  • trunk/SophyaLib/HiStats/histos.h

    r943 r958  
    11// This may look like C code, but it is really -*- C++ -*-
    22//
    3 // $Id: histos.h,v 1.5 2000-04-15 11:06:28 ansari Exp $
     3// $Id: histos.h,v 1.6 2000-04-18 13:38:17 ansari Exp $
    44//
    55
     
    179179
    180180
     181/*! \ingroup HiStats \fn operator<<(POuttPersist&,Histo)
     182  \brief Persistance management */
    181183inline POutPersist& operator << (POutPersist& os, Histo & obj)
    182184{ ObjFileIO<Histo> fio(&obj);  fio.Write(os);  return(os); }
     185/*! \ingroup HiStats \fn operator<<(POuttPersist&,Histo)
     186  \brief Persistance management */
    183187inline PInPersist& operator >> (PInPersist& is, Histo & obj)
    184188{ ObjFileIO<Histo> fio(&obj);  fio.Read(is);  return(is); }
  • trunk/SophyaLib/HiStats/histos2.cc

    r943 r958  
    666666{
    667667int i,j;
    668 if(v.NRows()!=nx || v.NCol()!=ny) THROW(sizeMismatchErr);
     668if(v.NRows()!=(uint_4)nx || v.NCol()!=(uint_4)ny) THROW(sizeMismatchErr);
    669669for(i=0;i<nx;i++) for(j=0;j<ny;j++) {
    670670  (*this)(i,j) = v(i,j);
     
    680680{
    681681int i,j;
    682 if(v.NRows()!=nx || v.NCol()!=ny) THROW(sizeMismatchErr);
     682if(v.NRows()!=(uint_4)nx || v.NCol()!=(uint_4)ny) THROW(sizeMismatchErr);
    683683for(i=0;i<nx;i++) for(j=0;j<ny;j++) {
    684684  (*this)(i,j) += v(i,j);
     
    695695{
    696696int i,j;
    697 if(v.NRows()!=nx || v.NCol()!=ny) THROW(sizeMismatchErr);
     697if(v.NRows()!=(uint_4)nx || v.NCol()!=(uint_4)ny) THROW(sizeMismatchErr);
    698698if(!err2) Errors();
    699699for(i=0;i<nx;i++) for(j=0;j<ny;j++) Error2(i,j) = v(i,j);
     
    708708{
    709709int i,j;
    710 if(v.NRows()!=nx || v.NCol()!=ny) THROW(sizeMismatchErr);
     710if(v.NRows()!=(uint_4)nx || v.NCol()!=(uint_4)ny) THROW(sizeMismatchErr);
    711711if(!err2) Errors();
    712712for(i=0;i<nx;i++) for(j=0;j<ny;j++)
     
    721721{
    722722int i,j;
    723 if(v.NRows()!=nx || v.NCol()!=ny) THROW(sizeMismatchErr);
     723if(v.NRows()!=(uint_4)nx || v.NCol()!=(uint_4)ny) THROW(sizeMismatchErr);
    724724if(!err2) Errors();
    725725for(i=0;i<nx;i++) for(j=0;j<ny;j++)
     
    10461046  double f = (double) (*this)(i,j);
    10471047  double saf = sqrt(fabs(f)); if(saf<1.) saf=1.;
    1048   double e;
     1048  double e=0.;
    10491049  if(typ_err==0)      {if(HasErrors()) e=Error(i,j); else e=1.;}
    10501050  else if(typ_err==1) {if(HasErrors()) e=Error(i,j); else e=saf;}
  • trunk/SophyaLib/HiStats/histos2.h

    r943 r958  
    249249// Classe pour la gestion de persistance
    250250
     251/*! \ingroup HiStats \fn operator<<(POuttPersist&,Histo2D)
     252  \brief Persistance management */
    251253inline POutPersist& operator << (POutPersist& os, Histo2D & obj)
    252254{ ObjFileIO<Histo2D> fio(&obj);  fio.Write(os);  return(os); }
     255/*! \ingroup HiStats \fn operator<<(POuttPersist&,Histo2D)
     256  \brief Persistance management */
    253257inline PInPersist& operator >> (PInPersist& is, Histo2D & obj)
    254258{ ObjFileIO<Histo2D> fio(&obj);  fio.Read(is);  return(is); }
  • trunk/SophyaLib/NTools/generaldata.cc

    r938 r958  
    549549if(var<0 || var>3) return -1;
    550550if(var>=2 && (ix<0 || ix>=mNVar) ) return -1;
    551 double min, max;
     551double min=1., max=-1.;
    552552int ntest = 0;
    553553for(int i=0;i<mNData;i++) {
    554554  if( ! IsValid(i) ) continue;
    555555  double v;
    556   if(var==0)      v = Val(i);
    557   else if(var==1) v = EVal(i);
    558   else if(var==2) v = Absc(ix,i);
    559   else if(var==3) v = EAbsc(ix,i);
     556  if(var==1)          v = EVal(i);
     557    else if(var==2)   v = Absc(ix,i);
     558      else if(var==3) v = EAbsc(ix,i);
     559        else          v = Val(i);
    560560  if(ntest==0) {min = max = v; imin = imax = i;}
    561561  if(v<min) {min = v; imin = i;}
     
    616616  if( ! IsValid(i) ) continue;
    617617  double v;
    618   if(var==0)      v = Val(i);
    619   else if(var==1) v = EVal(i);
    620   else if(var==2) v = Absc(ix,i);
    621   else if(var==3) v = EAbsc(ix,i);
     618  if(var==1)          v = EVal(i);
     619    else if(var==2)   v = Absc(ix,i);
     620      else if(var==3) v = EAbsc(ix,i);
     621        else          v = Val(i);
    622622  if(min<max && (v<min || max<v)) continue;
    623623  mean += v;
     
    662662  if( ! IsValid(i) ) continue;
    663663  double v;
    664   if(var==0)      v = Val(i);
    665   else if(var==1) v = EVal(i);
    666   else if(var==2) v = Absc(ix,i);
    667   else if(var==3) v = EAbsc(ix,i);
     664  if(var==1)          v = EVal(i);
     665    else if(var==2)   v = Absc(ix,i);
     666      else if(var==3) v = EAbsc(ix,i);
     667        else          v = Val(i);
    668668  if(min<max && (v<min || max<v)) continue;
    669669  buff[ntest] = v;
  • trunk/SophyaLib/NTools/generaldata.h

    r926 r958  
    158158  void Delete();
    159159
    160   int_4   mNVar;
    161   int_4   mNDataAlloc;
    162   int_4   mNData;
    163   int_4   mNDataGood;
    164   uint_2  mOk_EXP;
     160  int_4   mNVar;        //!< number of variables
     161  int_4   mNDataAlloc;  //!< space allocated for datas
     162  int_4   mNData;       //!< number of datas
     163  int_4   mNDataGood;   //!< number of good datas (not killed)
     164  uint_2  mOk_EXP;      //!< true if errors on variables X,Y,..
    165165  r_8* mXP;             //!< x0 y0 z0, x1 y1 z1, ..., xn yn zn
    166166  r_8* mErrXP;          //!< Ex0 Ey0 Ez0, Ex1 Ey1 Ez1, ..., Exn Eyn Ezn
     
    168168  r_8* mErr;            //!< EF0, EF1, ...., EFn
    169169  uint_2* mOK;          //!< 1 si pt valid, 0 sinon
    170   r_8* BuffVar;
    171   r_4* BuffVarR4;
     170  r_8* BuffVar;         //!< dummy buffer
     171  r_4* BuffVarR4;       //!< dummy buffer
    172172};
    173173
     
    178178// Classe pour la gestion de persistance
    179179
     180//! For persistance management
    180181inline POutPersist& operator << (POutPersist& os, GeneralFitData & obj)
    181182{ ObjFileIO<GeneralFitData> fio(&obj);  fio.Write(os);  return(os); }
     183//! For persistance management
    182184inline PInPersist& operator >> (PInPersist& is, GeneralFitData & obj)
    183185{ ObjFileIO<GeneralFitData> fio(&obj);  fio.Read(is);  return(is); }
  • trunk/SophyaLib/NTools/poly.cc

    r938 r958  
    44#include "fioarr.h"
    55
    6 //++
    7 // Class        Poly
    8 // Lib          Outils++
    9 // include      poly.h
    10 //
    11 //      Classe de calcul sur polynômes à une variable.
    12 //--
    13 
    14 //++
    15 // Links        Parents
    16 // Vector
    17 //--
    18 
    19 //++
    20 // Titre        Constructeurs
    21 //--
    22 
    23 
    24 //////////////////////////////////////////////////////////////////////////
    25 //++
    26 // Poly::Poly(int degre=0)
    27 //
    28 //      Crée un nouveau polynôme, en allouant de la place pour
    29 //      le degré spécifié.
    30 //--
    31 
     6////////////////////////////////////////////////////////////
     7////////////////////////////////////////////////////////////
     8////////////////////////////////////////////////////////////
     9////////////////////////////////////////////////////////////
     10////////////////////////////////////////////////////////////
     11/*!
     12  \class SOPHYA::Poly
     13  \ingroup NTools
     14  One dimensional polynomials class.
     15*/
     16
     17//! Constructor
     18/*! Create a 1D polynomial of degre \b degre */
    3219Poly::Poly(int degre)
    3320: TVector<r_8>(degre+1), dirty(0), deg(0)
     
    3623}
    3724
    38 //++
     25//! Constructor by copy
    3926Poly::Poly(Poly const& a)
    40 //
    41 //      Constructeur par copie.
    42 //--
    4327:TVector<r_8>(a), dirty(a.dirty), deg(a.deg)
    4428{
     
    4630}
    4731
    48 
     32//! update degre
     33/*! update degre (that could be changed after operations) */
    4934void Poly::UpdateDeg() const
    5035{
     
    5641}
    5742
    58 //++
    59 // Titre        Méthodes
    60 //--
    61 
    62 //++
    63 // double& Poly::operator[](int i)
    64 //      Permet d'accéder au coefficient de degré i (avec version
    65 //      const).
    66 //--
    67 
    68 //++
     43//! compute value P(\b x)
    6944double Poly::operator()(double x) const
    70 //
    71 //      Calcule la valeur du polynôme au point x.
    72 //--
    7345{
    7446  UpdateDegIfDirty();
     
    8153}
    8254
    83 //++
     55//! Replace p(x) by its derivate
    8456void Poly::Derivate()
    85 //
    86 //      Remplace le polynôme par le polynôme dérivé.
    87 //--
    8857{
    8958  UpdateDegIfDirty();
     
    9665
    9766
    98 //++
     67//! Return the derivate in \b der(x)
    9968void Poly::Derivate(Poly& der) const
    100 //
    101 //      Retourne dans der le polynôme dérivé.
    102 //--
    10369{
    10470  UpdateDegIfDirty();
     
    11076
    11177
    112 //++
     78//! Return the roots of the polynomial into \b roots
     79/*!
     80  This works until degre 2
     81  \return the number of roots
     82*/
    11383int Poly::Roots(TVector<r_8>& roots) const
    114 //
    115 //      Retourne dans roots les racines réelles, si on sait
    116 //      les calculer. Retourne le nombre de racines.
    117 //--
    11884{
    11985  UpdateDegIfDirty();
     
    135101
    136102
    137 //++
     103//! Return root \b r for a degre 1 polynomial
     104/*! \return return 1 if succes, 0 if not */
    138105int Poly::Root1(double& r) const
    139 //
    140 //      Seulement si le polynôme est de degré 1: retourne
    141 //      la racine dans "r". Retourne 1 (nombre de racines).
    142 //--
    143106{
    144107  UpdateDegIfDirty();
     
    150113}
    151114
    152 //++
     115//! Return roots \b r1 and \b r2 for a degre 2 polynomial
     116/*! \return return the number of roots found */
    153117int Poly::Root2(double& r1, double& r2) const
    154 //
    155 //      Seulement si le polynôme est de degre 2: retourne
    156 //      les racines dans "r1" et "r2". Retourne 0, 1 ou 2
    157 //      (nombre de racines).
    158 //--
    159118{
    160119  UpdateDegIfDirty();
     
    172131}
    173132
    174 //++
     133//! Operator P(x) = a(x)
    175134Poly& Poly::operator = (Poly const& a)
    176 //
    177 //      Opérateur d'affectation.
    178 //--
    179135{
    180136  if (this == &a) return *this;
     
    185141}
    186142
    187 //++
    188 // Titres       Opérations sur polynômes
    189 //--
    190 
    191 //++
     143//! Perform P(x) += b(x)
    192144Poly& Poly::operator += (Poly const& b)
    193 //
    194 //--
    195145{
    196146  UpdateDegIfDirty();
     
    206156}
    207157
    208 //++
     158//! Perform P(x) -= b(x)
    209159Poly& Poly::operator -= (Poly const& b)
    210 //
    211 //--
    212160{
    213161  UpdateDegIfDirty();
     
    223171}
    224172
    225 //++
     173//! Perform P(x) *= b(x)
    226174Poly& Poly::operator *= (double a)
    227 //
    228 //--
    229175{
    230176  UpdateDegIfDirty();
     
    233179}
    234180
    235 //++
     181//! Return P(x) = *this(x) * b(x)
    236182Poly Poly::Mult(Poly const& b) const
    237 //
    238 //--
    239183{
    240184Poly c(deg + b.deg);
     
    254198}
    255199
    256 //++
     200//! Print on stream \b s
    257201void Poly::Print(ostream& s, int_4 , bool ) const
    258 //
    259 //      Impresssion.
    260 //--
    261202{
    262203  UpdateDegIfDirty();
     
    274215}
    275216
    276 //++
     217//! Fit datas by a polynomial
     218/*!
     219  Fit y(x) by a polynimial P(x)
     220  \param x : x datas
     221  \param y : y datas
     222  \param degre : degre of the polynomial P(x) to be fitted
     223  \warning result is stored in the current object
     224  \return return chisquare
     225*/
    277226double Poly::Fit(TVector<r_8> const& x, TVector<r_8> const& y, int degre)
    278 //
    279 //      Ajustement polynomial par moindre carrés. Un polynôme de
    280 //      degré "degre" est ajusté sur les données "x" et "y", et stocké dans
    281 //      l'objet courant. Retourne le chi2.
    282 //--
    283227{
    284228  int n = x.NElts();
     
    303247}
    304248
    305 //++
     249//! Fit datas with errors by a polynomial
     250/*!
     251  Fit y(x) by a polynimial P(x)
     252  \param x : x datas
     253  \param y : y datas
     254  \param erry2 : errors squared on y
     255  \param degre : degre of the polynomial P(x) to be fitted
     256  \warning result is stored in the current object
     257  \return \b errcoeff : errors on the coefficients
     258  \return return chisquare
     259*/
    306260double Poly::Fit(TVector<r_8> const& x, TVector<r_8> const& y,
    307261       TVector<r_8> const& erry2, int degre,TVector<r_8>& errCoef)
    308 //
    309 //      Ajustement polynomial par moindre carrés. Un polynôme de
    310 //      degré est ajusté sur les données x et y, et stocké dans
    311 //      l'objet courant. erry2 contient le carre des erreurs sur y.
    312 //      Retourne le chi2.
    313 //--
    314262{
    315263  int n = x.NElts();
     
    337285
    338286
    339 //++
    340 // Poly Poly::power(int n) const
    341 //
    342 //      Retourne le polynôme à la puissance n
    343 //--
    344 
     287//! Return the polynomial at power \b n : ( \f$ P(x)^n \f$ )
    345288Poly Poly::power(int n) const // a accelerer !!!
    346289{
     
    351294}
    352295
    353 //++
     296//! Substitue polynomial and return P\f$ (b(x)) \f$
    354297Poly Poly::operator() (Poly const& b) const
    355 //
    356 //      Substitution d'un polynôme dans un autre.
    357 //--
    358298{
    359299  Poly c(b.Degre()*Degre());
     
    365305
    366306//////////////////////////////////////////////////////////////////////////
     307//! For persistance management
    367308void ObjFileIO<Poly>::ReadSelf(PInPersist& is)
    368309{
     
    375316}
    376317
     318//! For persistance management
    377319void ObjFileIO<Poly>::WriteSelf(POutPersist& os) const
    378320{
     
    385327
    386328//////////////////////////////////////////////////////////////////////////
     329/*! \ingroup NTools
     330  \fn binomial(int,int)
     331  Return the binomial coefficient \f$ {C_n}^p \f$.
     332*/
    387333int binomial(int n, int p)
    388334{
     
    393339}
    394340
    395 //////////////////////////////////////////////////////////////////////////
    396 // ******************* POLY 2 VARIABLES ******************
    397 //++
    398 // Class        Poly2
    399 // Lib          Outils++
    400 // include      poly.h
    401 //
    402 //      Classe de calcul sur polynômes à deux variables.
    403 //--
    404 
    405 //++
    406 // Links        Parents
    407 // Vector
    408 //--
    409 
    410 //++
    411 // Titre        Constructeurs
    412 //--
    413 
    414 //++
     341
     342////////////////////////////////////////////////////////////
     343////////////////////////////////////////////////////////////
     344////////////////////////////////////////////////////////////
     345////////////////////////////////////////////////////////////
     346////////////////////////////////////////////////////////////
     347/*!
     348  \class SOPHYA::Poly2
     349  \ingroup NTools
     350  Two dimensional polynomials class.
     351*/
     352
     353//! Constructor of 2D polynomial of degres \b degreX \b degreY
    415354Poly2::Poly2(int degreX, int degreY)
    416 //
    417 //      Crée un polynôme de degrés partiels degreX et degreY.
    418 //--
    419355:TVector<r_8>((degreX+1)*(degreY+1)), dirty(0),
    420356 maxDegX(degreX), maxDegY(degreY), degX(0), degY(0), deg(0)
     
    423359}
    424360
    425 //++
     361//! Constructor of 2D polynomial \f$ P(x,y) = px(x) * py(y) \f$
    426362Poly2::Poly2(Poly const& polX, Poly const& polY)
    427 //
    428 //      Crée un polynôme à deux variables comme produit
    429 //      de deux polynômes à une variable, p2(x,y)=px(x)py(y)
    430 //--
    431363:TVector<r_8>((polX.Degre()+1)*(polY.Degre()+1)), dirty(0),
    432364 maxDegX(polX.Degre()), maxDegY(polY.Degre()),
     
    439371}
    440372
    441 //++
     373//! Constructor by copy
    442374Poly2::Poly2(Poly2 const& a)
    443 //
    444 //      Constructeur par copie.
    445 //--
    446375:TVector<r_8>(a), dirty(a.dirty),
    447376 maxDegX(a.maxDegX), maxDegY(a.maxDegY),
     
    451380}
    452381
    453 
    454 //++
    455 // Titre        Méthodes
    456 //--
    457 
    458 //++
     382//! Operator P(x) = a(x)
    459383Poly2& Poly2::operator = (Poly2 const& a)
    460 //
    461 //      Opérateur d'affectation.
    462 //--
    463384{
    464385  if (this == &a) return *this;
     
    475396}
    476397
    477 //++
     398//! Re-allocate space for 2D polynomial with partial degres \b degreX \b degreY
    478399void Poly2::Realloc(int degreX, int degreY)
    479 //
    480 //      Redimensionne le polynôme comme etant un
    481 //      polynôme de degrés partiels degreX et degreY.
    482 //--
    483400{
    484401  UpdateDegIfDirty();
     
    499416
    500417
     418//! update degres
     419/*! update degres (that could be changed after operations) */
    501420void Poly2::UpdateDeg() const
    502421{
     
    514433}
    515434
    516 //++
    517 // int Poly2::DegX() const
    518 //      Degré partiel en X.
    519 // int Poly2::DegY() const
    520 //      Degré partiel en Y
    521 // int Poly2::MaxDegX() const
    522 //      Degré partiel maximum (alloué) en X
    523 // int Poly2::MaxDegY() const
    524 //      Degré partiel maximum (alloué) en Y
    525 // int Poly2::Deg()  const
    526 //      Degré total.
    527 //--
    528 
    529 //++
    530 // double& Poly2::Coef(int dx, int dy)
    531 //      Retourne le coefficient de x^dx y^dy
    532 //      (avec aussi version const).
    533 //--
    534 
    535 //++
     435//! Return P(\b x, \b y)
    536436double Poly2::operator()(double x, double y) const
    537 //
    538 //      Retourne la valeur en (x,y).
    539 //--
    540437{
    541438  UpdateDegIfDirty();
     
    553450}
    554451
    555 //++
     452//! Fit datas by a polynomial
     453/*!
     454  Fit z(x,y) by a polynimial P(x,y)
     455  \param x : x datas
     456  \param y : y datas
     457  \param z : z datas
     458  \param degreX : partial degre on X
     459  \param degreY : partial degre on Y
     460  \warning result is stored in the current object
     461  \return return chisquare
     462*/
    556463double Poly2::Fit(TVector<r_8> const& x, TVector<r_8> const& y,
    557464                 TVector<r_8> const& z, int degreX, int degreY)
    558 //
    559 //      Ajustement par moindre carrés z = P(x,y), degrés partiels imposés.
    560 //--
    561465{
    562466  int n = x.NElts();
     
    586490}
    587491
    588 
    589 //++
     492//! Fit datas with errors by a polynomial
     493/*!
     494  Fit z(x,y) by a polynimial P(x,y)
     495  \param x : x datas
     496  \param y : y datas
     497  \param z : z datas
     498  \param errz2 : errors squared on z
     499  \param degreX : partial degre on X
     500  \param degreY : partial degre on Y
     501  \warning result is stored in the current object
     502  \return \b errcoeff : errors on the coefficients
     503  \return return chisquare
     504*/
    590505double Poly2::Fit(TVector<r_8> const& x, TVector<r_8> const& y, TVector<r_8> const& z,
    591506                  TVector<r_8> const& errz2, int degreX, int degreY,
    592507                  TVector<r_8>& errCoef)
    593 //
    594 //      Ajustement par moindre carrés z = P(x,y), degrés partiels imposés,
    595 //      et erreurs^2 sur z dans errz2.
    596 //--
    597508{
    598509  int n = x.NElts();
     
    624535}
    625536
    626 //++
     537//! Fit datas by a polynomial
     538/*!
     539  Fit z(x,y) by a polynimial P(x,y)
     540  \param x : x datas
     541  \param y : y datas
     542  \param z : z datas
     543  \param degre : total degre
     544  \warning result is stored in the current object
     545  \return return chisquare
     546*/
    627547double Poly2::Fit(TVector<r_8> const& x, TVector<r_8> const& y,
    628548                              TVector<r_8> const& z, int degre)
    629 //
    630 //      Ajustement par moindre carrés z = P(x,y), degré total imposé.
    631 //--
    632549{
    633550  int n = x.NElts();
     
    668585}
    669586
    670 
    671 //++
     587//! Fit datas with errors by a polynomial
     588/*!
     589  Fit z(x,y) by a polynimial P(x,y)
     590  \param x : x datas
     591  \param y : y datas
     592  \param z : z datas
     593  \param errz2 : errors squared on z
     594  \param degre : total degre
     595  \warning result is stored in the current object
     596  \return \b errcoeff : errors on the coefficients
     597  \return return chisquare
     598*/
    672599double Poly2::Fit(TVector<r_8> const& x, TVector<r_8> const& y,
    673600               TVector<r_8> const& z,TVector<r_8> const& errz2,
    674601                              int degre, TVector<r_8>& errCoef)
    675 //
    676 //      Ajustement par moindre carrés z = P(x,y), degré total imposé,
    677 //      et erreurs^2 sur z dans errz2.
    678 //--
    679602{
    680603  int n = x.NElts();
     
    721644}
    722645
    723 //++
     646//! Print on stream \b s
    724647void Poly2::Print(ostream& s, int_4 , bool ) const
    725 //
    726 //      Impression sur stream s.
    727 //--
    728648{
    729649  UpdateDegIfDirty();
     
    750670}
    751671
    752 //++
    753 // Titre        Opérations
    754 //--
    755 
    756 //++
     672//! Operator: return P(x) = *this(x) + b(x)
    757673Poly2& Poly2::operator += (Poly2 const& b)
    758 //
    759 //--
    760674{
    761675  if (maxDegX < b.DegX() || maxDegY < b.DegY())
     
    774688}
    775689
    776 //++
     690//! Operator: return P(x) = *this(x) - b(x)
    777691Poly2& Poly2::operator -= (Poly2 const& b)
    778 //
    779 //--
    780692{
    781693  if (maxDegX < b.DegX() || maxDegY < b.DegY())
     
    794706}
    795707
    796 //++
     708//! Operator: return P(x) = *this(x) * a
    797709Poly2& Poly2::operator *= (double a)
    798 //
    799 //--
    800710{
    801711  for (int i=0; i<NElts(); i++)
     
    805715}
    806716
    807 //++
     717//! Operator: return P(x) = *this(x) * b(x)
    808718Poly2 Poly2::Mult(Poly2 const& b) const
    809 //
    810 //--
    811719{
    812720  Poly2 c(DegX() + b.DegX(), DegY() + b.DegY());
     
    822730}
    823731
    824 //++
     732//! Return \f$ P(x,y)^n \f$
    825733Poly2 Poly2::power(int n) const
    826 //
    827 //      Calcule le polynôme P(x,y)^n
    828 //--
    829734{
    830735  if (n < 0) THROW(rangeCheckErr);
     
    835740
    836741
    837 //++
     742//! substitute and return \f$ P(a(x),b(x)) \f$
    838743Poly2 Poly2::operator() (Poly const& a, Poly const& b) const
    839 //
    840 //      Substitution de deux polynômes en X et Y,
    841 //      P2(pa(x), pb(y)).
    842 //--
    843744{
    844745  UpdateDegIfDirty();
     
    854755}
    855756
    856 //++
     757//! substitute and return 2D polynomial \f$ P(a(x,y)) \f$, P is a 1D polynomial
    857758Poly2 Poly::operator() (Poly2 const& a) const
    858 //
    859 //      Substitution d'un polynôme à deux variables dans
    860 //      un polynôme à une variable, P(P2(x,y)).
    861 //--
    862759{
    863760  Poly2 c(a.MaxDegX()*Degre(), a.MaxDegY()*Degre());
     
    869766
    870767//////////////////////////////////////////////////////////////////////////
     768//! For persistance management
    871769void ObjFileIO<Poly2>::ReadSelf(PInPersist& is)
    872770{
     
    879777}
    880778
     779//! For persistance management
    881780void ObjFileIO<Poly2>::WriteSelf(POutPersist& os) const
    882781{
  • trunk/SophyaLib/NTools/poly.h

    r938 r958  
    11// This may look like C code, but it is really -*- C++ -*-
    22//
    3 // $Id: poly.h,v 1.7 2000-04-14 16:14:31 ansari Exp $
     3// $Id: poly.h,v 1.8 2000-04-18 13:38:36 ansari Exp $
    44//
    55
     
    2121
    2222//////////////////////////////////////////////////////////////////////////
     23//! Class of 1 dimension polynomials P(x)
    2324class Poly : public TVector<r_8> {
    2425  friend class ObjFileIO<Poly>;
     
    2728  Poly(Poly const& a);
    2829
     30  //! Return degre of polynomials
    2931  inline int Degre() const {UpdateDegIfDirty(); return deg;}
    3032
     33  //! Return space for a \b n degre polynomial
     34  /*!
     35    \param \b n : degre of new polynomial
     36    \param \b force : force re-allocation if true,\
     37                 if not allocation occurs only
     38                 if space needed is greater than the old one
     39  */
    3140  inline void Realloc(int n, bool force=false)
    3241                     {TVector<r_8>::Realloc(n+1,force);}
    3342
    3443  //  Pour compatibilite PEIDA  - Reza 03/2000
     44  //! Return coefficient of degre \b i
    3545  inline double Element(int i) const { return Elem(i,0,0,0,0); }
     46  //! Return coefficient of degre \b i
    3647  inline double & Element(int i)  { return Elem(i,0,0,0,0); }
    3748
     49  //! Return coefficient of degre \b i
    3850  inline double operator[](int i) const {return Elem(i,0,0,0,0);}
     51  //! Return coefficient of degre \b i
    3952  inline double& operator[](int i) {dirty = 1; return Elem(i,0,0,0,0);}
    4053  // Retourne le coefficient de degre i
     
    87100};
    88101
     102/*! \ingroup NTools \fn operator*(Poly const&,Poly const&)
     103  \brief perform and return P(X) = a(x) * b(x) */
    89104inline Poly operator* (Poly const& a, Poly const& b)
    90105  { return a.Mult(b); }
    91106
     107/*! \ingroup NTools \fn operator+(Poly const&,Poly const&)
     108  \brief perform and return P(X) = a(x) + b(x) */
    92109inline Poly operator+ (Poly const& a, Poly const& b)
    93110 { Poly c((a.Degre() > b.Degre())?(a.Degre()+1):(b.Degre()+1));
    94111   c = a; c += b; return c; }
    95112
     113/*! \ingroup NTools \fn operator-(Poly const&,Poly const&)
     114  \brief perform and return P(X) = a(x) - b(x) */
    96115inline Poly operator- (Poly const& a, Poly const& b)
    97116  { Poly c((a.Degre() > b.Degre())?(a.Degre()+1):(b.Degre()+1));
    98117    c = a; c -= b; return c; }
    99118
     119/*! \ingroup NTools \fn operator*(double,Poly const&)
     120  \brief perform and return P(X) = a * b(x) */
    100121inline Poly operator* (double a, Poly const& b)
    101122  { Poly c(b); c *= a; return c; }
    102123
     124/*! \ingroup NTools \fn operator<<(ostream&,const Poly&)
     125  \brief Print a(x) on stream \b s */
    103126inline ostream& operator << (ostream& s, const Poly& a)
    104127  { a.Print(s); return s; }
    105128
    106129//////////////////////////////////////////////////////////////////////////
     130/*! \ingroup NTools \fn operator<<(POutPersist&,Poly&)
     131  \brief For persistance management */
    107132inline POutPersist& operator << (POutPersist& os, Poly & obj)
    108133  { ObjFileIO<Poly> fio(&obj);  fio.Write(os);  return(os); }
     134/*! \ingroup NTools \fn operator<<(PInPersist&,,Poly&)
     135  \brief For persistance management */
    109136inline PInPersist& operator >> (PInPersist& is, Poly & obj)
    110137  { ObjFileIO<Poly> fio(&obj);  fio.Read(is);  return(is); }
     
    116143
    117144//////////////////////////////////////////////////////////////////////////
     145//! Class of 2 dimensions polynomials P(x,y)
    118146class Poly2 : public TVector<r_8> {
    119147  friend class ObjFileIO<Poly2>;
     
    124152  Poly2(Poly2 const& a);
    125153
     154  //! Return polynomial partial degre for X
    126155  inline int DegX() const {UpdateDegIfDirty(); return degX;}
     156  //! Return polynomial partial degre for Y
    127157  inline int DegY() const {UpdateDegIfDirty(); return degY;}
     158  //! Return polynomial maximum partial degre for X
    128159  inline int MaxDegX() const {return maxDegX;}
     160  //! Return polynomial maximum partial degre for Y
    129161  inline int MaxDegY() const {return maxDegY;}
     162  //! Return polynomial total degre for X
    130163  inline int Deg()  const {UpdateDegIfDirty(); return deg;}
    131164  // les degres partiels en x et y, et totaux.
    132165
    133166  //  Pour compatibilite PEIDA  - Reza 03/2000
     167  //! Return coefficient of degre \b i
    134168  inline double Element(int i) const { return Elem(i,0,0,0,0); }
     169  //! Return coefficient of degre \b i
    135170  inline double & Element(int i)  { return Elem(i,0,0,0,0); }
    136171
     
    138173  // retourne la valeur en (x,y)
    139174
     175  //! Return index of coefficient of X^dx * Y^dy in the vector
    140176  inline int IndCoef(int dx, int dy) const {
    141177    if (dx>maxDegX || dy>maxDegY) THROW(rangeCheckErr);
     
    146182  // d'un fit...
    147183
     184  //! Return coefficient of X^dx * Y^dy
    148185  inline double Coef(int dx, int dy) const {
    149186    return (dx>maxDegX || dy>maxDegY) ? 0 : Element(IndCoef(dx,dy));
    150187  }
     188  //! Return coefficient of X^dx * Y^dy
    151189  inline double& Coef(int dx, int dy) {
    152190    if (dx>maxDegX || dy>maxDegY) THROW(rangeCheckErr);
     
    199237};
    200238
     239/*! \ingroup NTools \fn operator*(Poly2 const&,Poly2 const&)
     240  \brief Perform P(x,y) = a(x,y) * b(x,y) */
    201241inline Poly2 operator* (Poly2 const& a, Poly2 const& b)
    202242  { return a.Mult(b); }
    203243
     244/*! \ingroup NTools \fn operator+(Poly2 const&,Poly2 const&)
     245  \brief Perform P(x,y) = a(x,y) + b(x,y) */
    204246inline Poly2 operator+ (Poly2 const& a, Poly2 const& b)
    205247  { Poly2 c(a); c += b; return c; }
    206248
     249/*! \ingroup NTools \fn operator-(Poly2 const&,Poly2 const&)
     250  \brief Perform P(x,y) = a(x,y) - b(x,y) */
    207251inline Poly2 operator- (Poly2 const& a, Poly2 const& b)
    208252  { Poly2 c(a); c -= b; return c; }
    209253
     254/*! \ingroup NTools \fn operator-(double,Poly2 const&)
     255  \brief Perform P(x,y) = a * b(x,y) */
    210256inline Poly2 operator * (double a, Poly2 const& b)
    211257  { Poly2 c(b); c *= a; return c; }
    212258
     259/*! \ingroup NTools \fn operator<<(ostream&,const Poly2&)
     260  \brief Print a(x,y) on stream \b s */
    213261inline ostream& operator << (ostream& s, const Poly2& a)
    214262  { a.Print(s); return s; }
    215263
    216264//////////////////////////////////////////////////////////////////////////
     265/*! \ingroup NTools \fn operator<<(POutPersist&,Poly2&)
     266  \brief For persistance management */
    217267inline POutPersist& operator << (POutPersist& os, Poly2 & obj)
    218268  { ObjFileIO<Poly2> fio(&obj);  fio.Write(os);  return(os); }
     269/*! \ingroup NTools \fn operator<<(POutPersist&,Poly2&)
     270  \brief For persistance management */
    219271inline PInPersist& operator >> (PInPersist& is, Poly2 & obj)
    220272  { ObjFileIO<Poly2> fio(&obj);  fio.Read(is);  return(is); }
  • trunk/SophyaLib/TArray/basarr.cc

    r926 r958  
    6161{
    6262  uint_8 rs = step;
    63   for(int k=0; k<ndim; k++) rs *= siz[k];
     63  for(uint_4 k=0; k<ndim; k++) rs *= siz[k];
    6464  return(rs+offset);
    6565}
     
    285285{
    286286  if (ndim_ != a.ndim_)  return(false);
    287   for(int k=0; k<ndim_; k++)
     287  for(uint_4 k=0; k<ndim_; k++)
    288288    if (size_[k] != a.size_[k])  return(false);
    289289  //  $CHECK$   Reza doit-on verifier ca
     
    301301  uint_4 size[BASEARRAY_MAXNDIMS];
    302302  uint_4 step[BASEARRAY_MAXNDIMS];
    303   for(int k=0; k<ndim_; k++) {
     303  for(uint_4 k=0; k<ndim_; k++) {
    304304    if (size_[k] < 2)  continue;
    305305    size[ndim] = size_[k];
     
    324324  uint_4 size[BASEARRAY_MAXNDIMS];
    325325  uint_4 step[BASEARRAY_MAXNDIMS];
    326   for(int k=0; k<ndim_; k++) {
     326  for(uint_4 k=0; k<ndim_; k++) {
    327327    size[ndim] = size_[k];
    328328    step[ndim] = step_[k];
     
    338338uint_4 BaseArray::MinStepKA() const
    339339{
    340   for(int ka=0; ka<ndim_; ka++)
     340  for(uint_4 ka=0; ka<ndim_; ka++)
    341341    if (step_[ka] == minstep_) return(ka);
    342342  return(0);
     
    348348  uint_4 ka = 0;
    349349  uint_4 mx = size_[0];
    350   for(int k=0; k<ndim_; k++) 
     350  for(uint_4 k=0; k<ndim_; k++) 
    351351    if (size_[k] > mx) {  ka = k;  mx = size_[k];  }
    352352  return(ka);
     
    370370  //#endif
    371371  uint_4 idx[BASEARRAY_MAXNDIMS];
    372   int k;
     372  uint_4 k;
    373373  uint_8 rest = i;
    374374  idx[ka] = 0;
     
    392392
    393393  uint_4 idx[BASEARRAY_MAXNDIMS];
    394   int k;
     394  uint_4 k;
    395395  uint_8 rest = ip;
    396396  for(k=0; k<ndim_; k++) {
     
    424424  os << "\n--- " << InfoString() ;
    425425  os << " ND=" << ndim_ << " SizeX*Y*...= " ;
    426   for(int k=0; k<ndim_; k++) {
     426  for(uint_4 k=0; k<ndim_; k++) {
    427427    os << size_[k];
    428428    if (k<ndim_-1)  os << "x";
     
    431431  if (prt_lev_ > 0) {
    432432    os <<  " TotSize= " << totsize_ << " Step(X Y ...)="  ;
    433     for(int k=0; k<ndim_; k++)     os << step_[k] << "  " ;
     433    for(uint_4 k=0; k<ndim_; k++)     os << step_[k] << "  " ;
    434434    os << " Offset= " << offset_  << endl;
    435435  }
     
    483483
    484484  totsize_ = 1;
    485   int k;
     485  uint_4 k;
    486486  for(k=0; k<BASEARRAY_MAXNDIMS; k++) {
    487487    size_[k] = 1;
     
    530530
    531531  totsize_ = 1;
    532   int k;
     532  uint_4 k;
    533533  for(k=0; k<BASEARRAY_MAXNDIMS; k++) {
    534534    size_[k] = 1;
     
    584584
    585585  totsize_ = 1;
    586   int k;
     586  uint_4 k;
    587587  for(k=0; k<BASEARRAY_MAXNDIMS; k++) {
    588588    size_[k] = 1;
     
    629629  if ( (ndim > ndim_) || (ndim < 1) )
    630630    throw(SzMismatchError("BaseArray::UpdateSubArraySizes( ... ) NDim Error") );
    631   int k;
     631  uint_4 k;
    632632  for(k=0; k<ndim; k++)
    633633    if ( (siz[k]*step[k]+pos[k]) > size_[k] ) 
  • trunk/SophyaLib/TArray/fioarr.h

    r926 r958  
    3434};
    3535
    36 //! Write TArray \b obj into POutPersist stream \b os
     36/*! \ingroup TArray \fn operator<<(POutPersist&,TArray<T>&)
     37  \brief Write TArray \b obj into POutPersist stream \b os */
    3738template <class T>
    3839inline POutPersist& operator << (POutPersist& os, TArray<T> & obj)
    3940{ FIO_TArray<T> fio(&obj);  fio.Write(os);  return(os); }
    4041
    41 //! Read TArray \b obj from PInPersist stream \b os
     42/*! \ingroup TArray \fn operator>>(PInPersist&,TArray<T>&)
     43  \brief Read TArray \b obj from PInPersist stream \b os */
    4244template <class T>
    4345inline PInPersist& operator >> (PInPersist& is, TArray<T> & obj)
  • trunk/SophyaLib/TArray/matharr.h

    r942 r958  
    3333#if !defined(__GNUG__)
    3434// see below for g++   
     35/*! \ingroup TArray \fn fabs(const TArray<T>& a)
     36  \brief computation on TArray */
    3537template <class T>
    3638inline TArray<T> fabs(const TArray<T>& a)
    3739  { MathArray<T> ma;   return( ma.ApplyFunction(a, fabs) ); }
    3840
     41/*! \ingroup TArray \fn sqrt(const TArray<T>& a)
     42  \brief computation on TArray */
    3943template <class T>
    4044inline TArray<T> sqrt(const TArray<T>& a)
    4145  { MathArray<T> ma;   return( ma.ApplyFunction(a, sqrt) ); }
    4246
     47/*! \ingroup TArray \fn sin(const TArray<T>& a)
     48  \brief computation on TArray */
    4349template <class T>
    4450inline TArray<T> sin(const TArray<T>& a)
    4551  { MathArray<T> ma;   return( ma.ApplyFunction(a, sin) ); }
    4652
     53/*! \ingroup TArray \fn cos(const TArray<T>& a)
     54  \brief computation on TArray */
    4755template <class T>
    4856inline TArray<T> cos(const TArray<T>& a)
    4957  { MathArray<T> ma;   return( ma.ApplyFunction(a, cos) ); }
    5058
     59/*! \ingroup TArray \fn tan(const TArray<T>& a)
     60  \brief computation on TArray */
    5161template <class T>
    5262inline TArray<T> tan(const TArray<T>& a)
    5363  { MathArray<T> ma;   return( ma.ApplyFunction(a, tan) ); }
    5464
     65/*! \ingroup TArray \fn asin(const TArray<T>& a)
     66  \brief computation on TArray */
    5567template <class T>
    5668inline TArray<T> asin(const TArray<T>& a)
    5769  { MathArray<T> ma;   return( ma.ApplyFunction(a, asin) ); }
    5870
     71/*! \ingroup TArray \fn acos(const TArray<T>& a)
     72  \brief computation on TArray */
    5973template <class T>
    6074inline TArray<T> acos(const TArray<T>& a)
    6175  { MathArray<T> ma;   return( ma.ApplyFunction(a, acos) ); }
    6276
     77/*! \ingroup TArray \fn atan(const TArray<T>& a)
     78  \brief computation on TArray */
    6379template <class T>
    6480inline TArray<T> atan(const TArray<T>& a)
    6581  { MathArray<T> ma;   return( ma.ApplyFunction(a, atan) ); }
    6682
     83/*! \ingroup TArray \fn exp(const TArray<T>& a)
     84  \brief computation on TArray */
    6785template <class T>
    6886inline TArray<T> exp(const TArray<T>& a)
    6987  { MathArray<T> ma;   return( ma.ApplyFunction(a, exp) ); }
    7088
     89/*! \ingroup TArray \fn lof(const TArray<T>& a)
     90  \brief computation on TArray */
    7191template <class T>
    7292inline TArray<T> log(const TArray<T>& a)
    7393  { MathArray<T> ma;   return( ma.ApplyFunction(a, log) ); }
    7494
     95/*! \ingroup TArray \fn log10(const TArray<T>& a)
     96  \brief computation on TArray */
    7597template <class T>
    7698inline TArray<T> log10(const TArray<T>& a)
     
    83105#endif
    84106
    85 //! Return \b mean and \b sigma of elements of array \b a
     107/*! \ingroup TArray \fn MeanSigma(const TArray<T>&,double&,double&)
     108  \brief Return \b mean and \b sigma of elements of array \b a */
    86109template <class T>
    87110inline double MeanSigma(const TArray<T>& a, double & mean, double & sig)
    88111  { MathArray<T> ma;   return( ma.MeanSigma(a, mean, sig) ); }
    89112
    90 //! Return \b mean of elements of array \b a
     113/*! \ingroup TArray \fn Mean(const TArray<T>&)
     114  \brief Return \b mean of elements of array \b a */
    91115template <class T>
    92116inline double Mean(const TArray<T>& a)
  • trunk/SophyaLib/TArray/sopemtx.h

    r956 r958  
    4848//------------------------------------------------------------
    4949
    50 /*! \ingroup TArray
    51     \fn LinSolveInPlace(TMatrix<r_4>&, TVector<r_4>&)
     50/*! \ingroup TArray \fn LinSolveInPlace(TMatrix<r_4>&,TVector<r_4>&)
    5251    \brief  Solve A*C = B for C in place and return determinant
    5352*/
     
    5958}
    6059
    61 /*! \ingroup TArray
    62     \fn LinSolveInPlace (TMatrix<r_8>&, TVector<r_8>&)
     60/*! \ingroup TArray \fn LinSolveInPlace(TMatrix<r_8>&,TVector<r_8>&)
    6361    \brief  Solve A*X = B in place and return determinant
    6462*/
  • trunk/SophyaLib/TArray/tarray.cc

    r926 r958  
    334334    uint_8 step = AvgStep();
    335335    pe = Data();
    336     for(k=0; k<totsize_; k++ )  pe[k*step] = seq(k);
     336    for(k=0; k<totsize_; k++ )  pe[k*step] = (T) seq(k);
    337337  }
    338338  else {    // Non regular data spacing ...
     
    344344    for(j=0; j<naxa; j++)  {
    345345      pe = mNDBlock.Begin()+Offset(ka,j);
    346       for(k=0; k<gpas; k++)  pe[k*step] = seq(j*gpas+k);
     346      for(k=0; k<gpas; k++)  pe[k*step] = (T) seq(j*gpas+k);
    347347    }
    348348  }
     
    807807{
    808808  if (maxprt < 0)  maxprt = max_nprt_;
    809   int_4 npr = 0;
     809  uint_4 npr = 0;
    810810  Show(os, si);
    811811  if (ndim_ < 1) return;
     
    822822            if(k0 > 0) os << ", "; 
    823823            os << Elem(k0, k1, k2, k3, k4);     npr++;
    824             if (npr >= maxprt) {
     824            if (npr >= (uint_4) maxprt) {
    825825              if (npr < totsize_)  os << "\n     .... " << endl; return;
    826826            }
  • trunk/SophyaLib/TArray/tarray.h

    r956 r958  
    165165// Surcharge d'operateurs A (+,-,*,/) (T) x
    166166
    167 //! Operator TArray = TArray + constant
     167/*! \ingroup TArray \fn operator+(const TArray<T>&,T)
     168  \brief Operator TArray = TArray + constant */
    168169template <class T> inline TArray<T> operator + (const TArray<T>& a, T b)
    169170    {TArray<T> result(a); result.SetTemp(true); result.Add(b); return result;}
    170171
    171 //! Operator TArray = constant + TArray
     172/*! \ingroup TArray \fn operator+(T,const TArray<T>&)
     173  \brief Operator TArray = constant + TArray */
    172174template <class T> inline TArray<T> operator + (T b,const TArray<T>& a)
    173175    {TArray<T> result(a); result.SetTemp(true); result.Add(b); return result;}
    174176
    175 //! Operator TArray = TArray - constant
     177/*! \ingroup TArray \fn operator-(const TArray<T>&,T)
     178  \brief Operator TArray = TArray - constant */
    176179template <class T> inline TArray<T> operator - (const TArray<T>& a, T b)
    177180    {TArray<T> result(a); result.SetTemp(true); result.Sub(b); return result;}
    178181
    179 //! Operator TArray = constant - TArray
     182/*! \ingroup TArray \fn operator-(T,const TArray<T>&)
     183  \brief Operator TArray = constant - TArray */
    180184template <class T> inline TArray<T> operator - (T b,const TArray<T>& a)
    181185    {TArray<T> result(a); result.SetTemp(true); result.SubInv(b); return result;}
    182186
    183 //! Operator TArray = TArray * constant
     187/*! \ingroup TArray \fn operator*(const TArray<T>&,T)
     188  \brief Operator TArray = TArray * constant */
    184189template <class T> inline TArray<T> operator * (const TArray<T>& a, T b)
    185190    {TArray<T> result(a); result.SetTemp(true); result.Mul(b); return result;}
    186191
    187 //! Operator TArray = constant * TArray
     192/*! \ingroup TArray \fn operator*(T,const TArray<T>&)
     193  \brief Operator TArray = constant * TArray */
    188194template <class T> inline TArray<T> operator * (T b,const TArray<T>& a)
    189195    {TArray<T> result(a); result.SetTemp(true); result.Mul(b); return result;}
    190196
    191 //! Operator TArray = TArray / constant
     197/*! \ingroup TArray \fn operator/(const TArray<T>&,T)
     198  \brief Operator TArray = TArray / constant */
    192199template <class T> inline TArray<T> operator / (const TArray<T>& a, T b)
    193200    {TArray<T> result(a); result.SetTemp(true); result.DivInv(b); return result;}
     
    196203// Surcharge d'operateurs C = A (+,-) B
    197204
    198 //! Operator TArray = TArray + TArray
     205/*! \ingroup TArray \fn operator+(const TArray<T>&,const TArray<T>&)
     206  \brief Operator TArray = TArray + TArray */
    199207template <class T>
    200208inline TArray<T> operator + (const TArray<T>& a,const TArray<T>& b)
    201209    {TArray<T> result(a); result.SetTemp(true); result.AddElt(b); return result;}
    202210
    203 //! Operator TArray = TArray - TArray
     211/*! \ingroup TArray \fn operator-(const TArray<T>&,const TArray<T>&)
     212  \brief Operator TArray = TArray - TArray */
    204213template <class T>
    205214inline TArray<T> operator - (const TArray<T>& a,const TArray<T>& b)
  • trunk/SophyaLib/TArray/tmatrix.cc

    r926 r958  
    1 // $Id: tmatrix.cc,v 1.7 2000-04-13 18:39:14 ansari Exp $
     1// $Id: tmatrix.cc,v 1.8 2000-04-18 13:38:52 ansari Exp $
    22//                         C.Magneville          04/99
    33#include "machdefs.h"
     
    290290{
    291291  if (maxprt < 0)  maxprt = max_nprt_;
    292   int_4 npr = 0;
     292  uint_4 npr = 0;
    293293  Show(os, si);
    294294  if (ndim_ < 1)  return;
     
    299299      if(kc > 0) os << ", "; 
    300300      os << (*this)(kr, kc);   npr++;
    301       if (npr >= maxprt) {
     301      if (npr >= (uint_4) maxprt) {
    302302        if (npr < totsize_)  os << "\n     .... " << endl; return;
    303303      }
  • trunk/SophyaLib/TArray/tmatrix.h

    r956 r958  
    126126}
    127127
    128 
    129128// Surcharge d'operateurs C = A (+,-) B
    130129// $CHECK$ Reza 3/4/2000 Pas necessaire  de redefinir les operateurs
     
    132131// Doit-on le faire aussi pour les constantes ? - Fin de $CHECK$ Reza 3/4/2000
    133132
    134 //! + : add matrixes \b a and \b b
     133/*! \ingroup TArray \fn operator+(const TMatrix<T>&,const TMatrix<T>&)
     134  \brief + : add matrixes \b a and \b b */
    135135template <class T>
    136136inline TMatrix<T> operator + (const TMatrix<T>& a,const TMatrix<T>& b)
    137137    {TMatrix<T> result(a); result.SetTemp(true); result.AddElt(b); return result;}
    138138
    139 //! - : substract matrixes \b a and \b b
     139/*! \ingroup TArray \fn operator-(const TMatrix<T>&,const TMatrix<T>&)
     140  \brief \- : substract matrixes \b a and \b b */
    140141template <class T>
    141142inline TMatrix<T> operator - (const TMatrix<T>& a,const TMatrix<T>& b)
     
    143144
    144145// Surcharge d'operateurs C = A * B
    145 //! - : multiply matrixes \b a and \b b
     146/*! \ingroup TArray \fn operator*(const TMatrix<T>&,const TMatrix<T>&)
     147  \brief * : multiply matrixes \b a and \b b */
    146148template <class T> inline TMatrix<T> operator * (const TMatrix<T>& a, const TMatrix<T>& b)
    147149{ TMatrix<T> result(a); result.SetTemp(true); return(result.Multiply(b)); }
Note: See TracChangeset for help on using the changeset viewer.