Changeset 508 in Sophya for trunk/SophyaLib/NTools/cvector.h


Ignore:
Timestamp:
Oct 25, 1999, 12:36:22 PM (26 years ago)
Author:
ansari
Message:

Vector/Matrix OVector/OMatrix cmv 25/10/99

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/NTools/cvector.h

    r307 r508  
    1313// Vecteur colonne, en fait une matrice avec une seule colonne, pour faire
    1414// des operations matricielles.
    15 class Vector : public Matrix {
     15class OVector : public OMatrix {
    1616  friend class TVector<r_8>;
    1717public:
    1818  // Constructeur, n = nombre d'elements.
    19   EXPLICIT Vector(int n=1);
     19  EXPLICIT OVector(int n=1);
    2020  // Constructeur, a partir des valeurs. Pas d'allocation.
    21   Vector(int n, double* values);
     21  OVector(int n, double* values);
    2222  // Constructeur par copie
    23   Vector(const Vector& v);
     23  OVector(const OVector& v);
    2424  // Constructeur par "copie" a partir d'une matrice, qui doit avoir une colonne
    2525  // <thrown> sizeMismatchErr </thrown>
    26   Vector(const Matrix& a);
     26  OVector(const OMatrix& a);
    2727  // Constructeur par copie a partir d'un TVector<r_8>
    28   Vector(const TVector<r_8>& v);
     28  OVector(const TVector<r_8>& v);
    2929
    3030  // Construction automatique pour PPF
     
    3232  enum {classId = ClassId_Vector};
    3333  int_4                 ClassId() const         { return classId; }
    34   static PPersist*      Create() {return new Vector(1);}
     34  static PPersist*      Create() {return new OVector(1);}
    3535  // </group>
    3636 
     
    3939  void Realloc(int n, bool force=false);
    4040
    41   Vector& operator = (const Vector& v);
    42   Vector& operator = (double x);
     41  OVector& operator = (const OVector& v);
     42  OVector& operator = (double x);
    4343
    4444  // Acces aux elements
     
    5050  // produit scalaire
    5151  // <group>
    52   friend double operator* (const Vector& v1, const Vector& v2);
    53   friend Vector operator* (const Vector& v, double b)
    54   {return Vector(((Matrix const&)v) * b);}
     52  friend double operator* (const OVector& v1, const OVector& v2);
     53  friend OVector operator* (const OVector& v, double b)
     54  {return OVector(((OMatrix const&)v) * b);}
    5555  // </group>
    5656  // produit matrice*vecteur
    57   friend Vector operator* (const Matrix& a, const Vector& b)
    58   {return Vector(a * ((Matrix const&) (b)));}
     57  friend OVector operator* (const OMatrix& a, const OVector& b)
     58  {return OVector(a * ((OMatrix const&) (b)));}
    5959
    6060  // Nombre de lignes du vecteur
     
    6262
    6363  // Resolution du systeme A*C = B
    64   friend double LinSolve(const Matrix& a, const Vector& b, Vector& c);
     64  friend double LinSolve(const OMatrix& a, const OVector& b, OVector& c);
    6565 
    6666  // Resolution du systeme A*C = B, avec C retourne dans B
    67   friend double LinSolveInPlace(Matrix& a, Vector& b);
     67  friend double LinSolveInPlace(OMatrix& a, OVector& b);
    6868
    6969  // Residus et fonction fittees.
    70   Vector FitResidus(GeneralFit& gfit,double xorg=0.,double dx=1.);
    71   Vector FitFunction(GeneralFit& gfit,double xorg=0.,double dx=1.);
     70  OVector FitResidus(GeneralFit& gfit,double xorg=0.,double dx=1.);
     71  OVector FitFunction(GeneralFit& gfit,double xorg=0.,double dx=1.);
    7272
    7373};
    7474
    7575
    76 inline Vector& Vector::operator = (const Vector& v)
    77 { Matrix::operator =(v); return *this; }
     76inline OVector& OVector::operator = (const OVector& v)
     77{ OMatrix::operator =(v); return *this; }
    7878
    7979
    80 inline double const& Vector::operator()(int n) const
     80inline double const& OVector::operator()(int n) const
    8181{
    8282#ifdef RGCHECK
     
    8787
    8888
    89 inline double& Vector::operator()(int n)
     89inline double& OVector::operator()(int n)
    9090{
    9191#ifdef RGCHECK
     
    9595}
    9696
    97 inline void Vector::Realloc(int n, bool force)
    98 { Matrix::Realloc(n,1,force);}
     97inline void OVector::Realloc(int n, bool force)
     98{ OMatrix::Realloc(n,1,force);}
    9999
    100100
Note: See TracChangeset for help on using the changeset viewer.