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:   void* VecObject;

     23:   virtual int Clone(TaoVec**);
     24:   int CloneVecs(int, TaoVec***);
     25:   int DestroyVecs(int, TaoVec**);

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

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

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

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

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

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

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

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

     54:   virtual int PointwiseMinimum( TaoVec* , TaoVec*);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    106:   /* stepMax */
    107:   //  virtual int StepMax2( TaoVec* , TaoVec*, TaoVec*, double* );

    109:   virtual int StepMax( TaoVec* , double* );
    110:   virtual int StepBoundInfo(TaoVec* ,TaoVec*,TaoVec*,double*,double*,double*);
    111:   virtual int BoundGradientProjection(TaoVec*,TaoVec*,TaoVec*, TaoVec*);

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

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

    119:   virtual int CreateIndexSet(TaoIndexSet**);

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

    125: #endif