Changeset 805 in Sophya for trunk/SophyaLib/NTools


Ignore:
Timestamp:
Apr 3, 2000, 7:41:08 PM (25 years ago)
Author:
ansari
Message:

Adaptation aux modifications de TArray<T>/TVector<T> - linfit.cc integre
a TArray/sopemtx.cc - Reza 03/04/2000

Location:
trunk/SophyaLib/NTools
Files:
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/NTools/NTools.o.list

    r756 r805  
    1919imageop.o
    2020integ.o
    21 linfit.o
    2221matxop.o
    2322median.o
  • trunk/SophyaLib/NTools/fftmserver.cc

    r717 r805  
    184184void FFTMayerServer::FFTForward(TVector< r_4 > const & in, TVector< complex<r_4> > & out)
    185185{
    186  r_4 a,b,c,d;
     186 r_4 a,b;
    187187 int i,j,k;
    188188 int n = in.NElts();
     
    227227void FFTMayerServer::FFTBackward(TVector< complex<r_4> > const & in, TVector< r_4 > & out)
    228228{
    229  r_4 a,b,c,d;
     229 r_4 a,b;
    230230 int i,j,k;
    231231 int n = in.NElts();
     
    269269void FFTMayerServer::FFTForward(TVector< r_8 > const & in, TVector< complex<r_8> > & out)
    270270{
    271  r_8 a,b,c,d;
     271 r_8 a,b;
    272272 int i,j,k;
    273273 int n = in.NElts();
     
    311311void FFTMayerServer::FFTBackward(TVector< complex<r_8> > const & in, TVector< r_8 > & out)
    312312{
    313  r_8 a,b,c,d;
     313 r_8 a,b;
    314314 int i,j,k;
    315315 int n = in.NElts();
     
    356356  if (n < 2) return(true);
    357357  int nc = n;
    358   int r;
    359358  while (nc > 1) {
    360359    if (nc%2 != 0)  return(true);
  • trunk/SophyaLib/NTools/fftpserver.cc

    r791 r805  
    288288  out.ReSize(ncs);
    289289  out(0) = complex<r_8> (in(0),0.);
    290   int k;
    291290  for(int k=1;k<nc;k++)
    292291    out(k) =  complex<r_4> (in(2*k-1), in(2*k));
     
    303302  out.ReSize(ncs);
    304303  out(0) = complex<r_4> (in(0),0.);
    305   int k;
    306304  for(int k=1;k<nc;k++)
    307305    out(k) =  complex<r_4> (in(2*k-1), in(2*k));
  • trunk/SophyaLib/NTools/linfit.h

    r552 r805  
    11// This may look like C code, but it is really -*- C++ -*-
    22//
    3 // $Id: linfit.h,v 1.6 1999-11-05 13:08:30 ansari Exp $
     3// $Id: linfit.h,v 1.7 2000-04-03 17:41:07 ansari Exp $
    44//
    55
     
    99#define LINFIT_SEEN
    1010
    11 #include "machdefs.h"
    12 #include "tvector.h"
     11// Mis ds TArray/sopemtx.h  - fichier garde pour back-compatibilite
     12//                                       Reza 03/2000
     13#include "sopemtx.h"
    1314
    14 namespace SOPHYA {
    15 
    16 class LinFitter {
    17 public :
    18                 LinFitter();
    19   virtual       ~LinFitter();
    20 
    21   double        LinFit(const Vector& x, const Vector& y, int nf,
    22                        double (*f)(int, double), Vector& c);
    23 // fit lineaire des y en tant que somme de c(i)f(i,x), i=0..nf-1;
    24 
    25   double        LinFit(const Matrix& fx, const Vector& y, Vector& c);
    26 // fit lineaire des y en tant que somme de c(i)f(i,x), i=0..nf-1,
    27 // la matrice fx contient les valeurs des f:
    28 // fx(i,j) = f(i, x(j)).
    29                      
    30   double        LinFit(const Vector& x, const Vector& y, const Vector& errY2, int nf,
    31                        double (*f)(int, double), Vector& c, Vector& errC);
    32 // fit lineaire des y en tant que somme de c(i)f(i,x), i=0..nf-1,
    33 // errY2 contient les carres des erreurs sur les Y.
    34 // au retour, errC contient les erreurs sur les coefs.
    35 
    36   double        LinFit(const Matrix& fx, const Vector& y, const Vector& errY2,
    37                        Vector& c, Vector& errC);
    38 // fit lineaire des y en tant que somme de c(i)f(i,x), i=0..nf-1,
    39 // la matrice fx contient les valeurs des f:
    40 // fx(i,j) = f(i, x(j)).
    41 // errY2 contient les carres des erreurs sur les Y.
    42 // au retour, errC contient les erreurs sur les coefs.
    43 };
    44 
    45 } // Fin du namespace
    4615
    4716#endif // LINFIT_SEEN
  • trunk/SophyaLib/NTools/objfitter.h

    r756 r805  
    6060
    6161
    62 #endif   // ARRFITTER_SEEN
     62#endif   // OBJFITTER_SEEN
  • trunk/SophyaLib/NTools/poly.cc

    r540 r805  
    22#include "poly.h"
    33#include "linfit.h"
     4#include "fioarr.h"
    45
    56//++
     
    254255
    255256//++
    256 void Poly::Print(ostream& s) const
     257void Poly::Print(ostream& s, int_4 , bool ) const
    257258//
    258259//      Impresssion.
     
    484485  Poly2 tmp(*this);
    485486  Vector::Realloc((degreX+1)*(degreY+1));
    486   Reset();
     487  DataBlock().Reset();
    487488  maxDegX = degreX;
    488489  maxDegY = degreY;
     
    721722
    722723//++
    723 void Poly2::Print(ostream& s) const
     724void Poly2::Print(ostream& s, int_4 , bool ) const
    724725//
    725726//      Impression sur stream s.
  • trunk/SophyaLib/NTools/poly.h

    r552 r805  
    11// This may look like C code, but it is really -*- C++ -*-
    22//
    3 // $Id: poly.h,v 1.4 1999-11-05 13:08:31 ansari Exp $
     3// $Id: poly.h,v 1.5 2000-04-03 17:41:08 ansari Exp $
    44//
    55
     
    3434  inline void Realloc(int n, bool force=false) {Vector::Realloc(n+1,force);}
    3535
    36   inline double operator[](int i) const {return Element(i);}
    37   inline double& operator[](int i) {dirty = 1; return Element(i);}
     36  //  Pour compatibilite PEIDA  - Reza 03/2000
     37  inline double Element(int i) const { return Elem(i,0,0,0,0); }
     38  inline double & Element(int i)  { return Elem(i,0,0,0,0); }
     39
     40  inline double operator[](int i) const {return Elem(i,0,0,0,0);}
     41  inline double& operator[](int i) {dirty = 1; return Elem(i,0,0,0,0);}
    3842  // Retourne le coefficient de degre i
    3943
     
    6872  Poly2 operator() (Poly2 const& b) const;
    6973
    70   void Print(ostream& s) const;
     74  void Print(ostream& s, int_4 maxprt=-1, bool si=false) const;
    7175
    7276  double Fit(Vector const& x, Vector const& y, int degre);
     
    131135  inline int Deg()  const {UpdateDegIfDirty(); return deg;}
    132136  // les degres partiels en x et y, et totaux.
     137
     138  //  Pour compatibilite PEIDA  - Reza 03/2000
     139  inline double Element(int i) const { return Elem(i,0,0,0,0); }
     140  inline double & Element(int i)  { return Elem(i,0,0,0,0); }
    133141
    134142  double operator()(double x, double y) const;
     
    183191  void Realloc(int degreX, int degreY);
    184192
    185   void Print(ostream& s) const;
     193  void Print(ostream& s, int_4 maxprt=-1, bool si=false) const;
    186194
    187195private:
Note: See TracChangeset for help on using the changeset viewer.