Actual source code: taovec.h

  1: #ifndef TAOVECTOR_H
  2: #define TAOVECTOR_H


  5: #include "tao_basictypes.h"


  8: /** 
  9:     An abstract class representing the implementation of a TAO Vector. 
 10: */
 11: class TaoIndexSet;

 13: class TaoVec {

 15: protected:
 16:   
 17: public:

 19:   virtual ~TaoVec(void){};
 20:   
 21:   virtual int Clone(TaoVec**);
 22:   int CloneVecs(int, TaoVec***);
 23:   int DestroyVecs(int, TaoVec**);

 25:   virtual int Compatible(TaoVec*, TaoTruth*);

 27:   /** Set all elements of this Tao Vector to zero. */
 28:   virtual int SetToZero();
 29:   /** Set all elements of this Tao Vector to the constant value c */
 30:   virtual int SetToConstant( double );

 32:   /** Copy the elements of one vector to another */
 33:   virtual int CopyFrom( TaoVec* );

 35:   virtual int ScaleCopyFrom( double, TaoVec* );

 37:   /** Return the norm of this Tao Vector. */
 38:   virtual int NormInfinity( double* );
 39:   virtual int Norm1( double* );
 40:   virtual int Norm2( double* );
 41:   virtual int Norm2squared( double* );

 43:   /** Multiply the components of this Tao Vector by the components of v. */
 44:   virtual int PointwiseMultiply( TaoVec* , TaoVec* );

 46:   /** Divide the components of this Tao Vector by the components of v. */
 47:   virtual int PointwiseDivide( TaoVec* , TaoVec* );

 49:   /** Set the elements of one vector to the mi of corresponding elements of two compatible vectors */
 50:   virtual int PointwiseMaximum( TaoVec* , TaoVec*);
 51:   virtual int PointwiseMinimum( TaoVec* , TaoVec*);

 53:   virtual int Median( TaoVec* , TaoVec* , TaoVec* );

 55:   /** Calculate the Billups composition form of the Fischer function given
 56:       x, f, l, u.  The smoothed version takes the smoothing parameter for each
 57:       component as an additional argument.
 58:   */
 59:   virtual int  Fischer(TaoVec *, TaoVec *, TaoVec *, TaoVec *);
 60:   virtual int SFischer(TaoVec *, TaoVec *, TaoVec *, TaoVec *, double);

 62:   /** Scale each element of this Tao Vector by the constant alpha */
 63:   virtual int Scale( double );

 65:   /** this += alpha * x */
 66:   virtual int Axpy  ( double , TaoVec* );

 68:   /** this = alpha * this + x */
 69:   virtual int Aypx  ( double , TaoVec* );

 71:   virtual int Axpby  ( double , TaoVec*, double  );

 73:   /** this = alpha * x + beta *y */
 74:   virtual int Waxpby( double , TaoVec*, double , TaoVec* );

 76:   /** Take the absolute value of the elements */
 77:   virtual int AbsoluteValue( );

 79:   /** Take the minimum of the absolute value of the elements */
 80:   virtual int MinElement(double *);

 82:   /** Add c to the elements of this Tao Vector */
 83:   virtual int AddConstant( double );

 85:   /** Return the dot product of this Tao Vector with v */
 86:   virtual int Dot( TaoVec* , double *);

 88:   /** Negate all the elements of this Tao Vector. */
 89:   virtual int Negate();

 91:   /** Invert (1/x) the elements of this Tao Vector. */
 92:   virtual int Reciprocal();

 94:   /** Take square root of the elements of this Tao Vector. */
 95:   virtual int Sqrt();
 96:   virtual int Pow( double );

 98:   /* Replace each element with a -1, 0, or 1, depending on its sign.  */
 99:   virtual int Sign();

101:   /** Get the dimension of the vector space */
102:   virtual int GetDimension( int* );

104:   /* View */
105:   virtual int View();

107:   /* stepMax */
108:   virtual int StepMax( TaoVec* , double* );
109:   virtual int StepBoundInfo(TaoVec* ,TaoVec*,TaoVec*,double*,double*,double*);
110:   virtual int BoundGradientProjection(TaoVec*,TaoVec*,TaoVec*, TaoVec*);

112:   /* Functionality for working in a reduced space */
113:   virtual int SetReducedVec(TaoVec*, TaoIndexSet*);

115:   virtual int ReducedCopyFromFull(TaoVec*, TaoIndexSet*);
116:   virtual int ReducedXPY(TaoVec *, TaoIndexSet*);

118:   virtual int CreateIndexSet(TaoIndexSet**);

120:   virtual int GetArray(TaoScalar **, int*);
121:   virtual int RestoreArray(TaoScalar **, int*);
122: };

124: #endif