Actual source code: taomat_petsc.h

      1: #ifndef TAOPETSCMAT_H
      2: #define TAOPETSCMAT_H

     4:  #include taomat.h
      5: #include "petscksp.h"

      7: class TaoMatPetsc: public TaoMat{

      9:  protected:

     11:   Mat pm;
     12:   MatStructure preflag;
     13:   Mat pm_pre;
     14:   PetscViewer pmatviewer;

     16:  public:

     18:   TaoMatPetsc( Mat M );
     19:   ~TaoMatPetsc();

     21:   int SetPetscViewer(PetscViewer);
     22:   int SetMatrix(Mat, Mat, MatStructure);
     23:   int GetMatrix(Mat*, Mat*, MatStructure*);

     25:
     26:   /*
     27:      The following methods are implementations of
     28:      the virtual methods in the base class
     29:   */

     31:   int Compatible(TaoVec*, TaoVec*, TaoTruth*);

     33:   int GetDimensions( int*, int * );
     34:   int Multiply(TaoVec*,TaoVec*);
     35:   int MultiplyTranspose(TaoVec*,TaoVec*);

     37:   int SetDiagonal(TaoVec*);
     38:   int AddDiagonal(TaoVec*);
     39:   int GetDiagonal(TaoVec*);
     40:   int ShiftDiagonal(double);

     42:   int RowScale(TaoVec*);
     43:   int ColScale(TaoVec*);

     45:   int CreateReducedMatrix(TaoIndexSet*,TaoIndexSet*,TaoMat**);
     46:   int SetReducedMatrix(TaoMat*,TaoIndexSet*,TaoIndexSet*);

     48:   int D_Fischer(TaoVec *, TaoVec *, TaoVec *, TaoVec *,
     49:                 TaoVec *, TaoVec *, TaoVec *, TaoVec *);
     50:   int D_SFischer(TaoVec *, TaoVec *, TaoVec *, TaoVec *, double,
     51:                  TaoVec *, TaoVec *, TaoVec *, TaoVec *, TaoVec *);

     53:   int Norm1(double*);

     55:   int View();

     57:   /*
     58:      The following methods are not currently needed by TAO
     59:      but may be needed in the future.
     60:   */
     61:   int Clone(TaoMat**);
     62:   int CopyFrom(TaoMat*);
     63:   int MultiplyAdd(TaoVec*,TaoVec*,TaoVec*);
     64:   int MultiplyTransposeAdd(TaoVec*,TaoVec*,TaoVec*);

     66: };

     68: #endif