Actual source code: taolinearsolver.c

      1: #include "tao_solver.h"    /*I "tao_solver.h"  I*/
     2:  #include taolinearsolver.h

      6: /*@C
      7:    TaoLinearSolverDestroy - Destroys the TaoLinearSolver object.

      9:    Input Parameter:
     10: .  TKSP - the linear solver

     12:    Level: beginner
     13: .seealso: TaoLinearSolve()

     15: .keywords: linear solver

     17: @*/
     18: int TaoLinearSolverDestroy( TaoLinearSolver* TKSP){
     19:   TaoFunctionBegin;
     20:   if (TKSP){
     21:     TKSP->rref--;
     22:     if (TKSP->rref<1) {
     23:       delete TKSP;
     24:     }
     25:   }
     26:   TaoFunctionReturn(0);
     27: }

     32: /*@C
     33:    PreSolve - Prepares a matrix for the linear solve.

     35:    Input Parameter:
     36: .  M - the matrix

     38:    Level: intermediate
     39: @*/
     40: int TaoLinearSolver::PreSolve(TaoMat* M){
     41:   TaoFunctionBegin;
     42:   SETERRQ(56,"Operation not defined");
     43:   /* TaoFunctionReturn(1); */
     44: }

     49: int TaoLinearSolver::MinQuadraticTrustRegion(TaoVec*tv,TaoVec*tw,double rr, TaoTruth*tt){
     50:   TaoFunctionBegin;
     51:   SETERRQ(56,"Operation not defined");
     52:   /* TaoFunctionReturn(1); */
     53: }

     57: /*@C
     58:    Solve - Finds the solution to A x = b .

     60:    Input Parameter:
     61: .  b - the right-hand side

     63:    Output Parameter:
     64: +  x - the solution
     65: -  flag - TAO_TRUE if successful solve, TAO_FALSE otherwise.

     67:    Level: intermediate
     68: @*/
     69: int TaoLinearSolver::Solve(TaoVec* b, TaoVec* x, TaoTruth *flag){
     70:   TaoFunctionBegin;
     71:   SETERRQ(56,"Operation not defined");
     72:   /* TaoFunctionReturn(1); */
     73: }

     77: /*@C
     78:    GetNumberIterations - Gets the number of iterations used to solve the system.

     80:    Output Parameter:
     81: .  iters - the number of iterations

     83:    Level: intermediate
     84: @*/
     85: int TaoLinearSolver::GetNumberIterations(int * iters){
     86:   int info;
     87:   TaoFunctionBegin;
     88:   info = PetscLogInfo((0,"TaoLinearSolver::GetNumberIterations() iterations not available.\n")); CHKERRQ(info);
     89:   TaoFunctionReturn(0);
     90: }

     94: /*@C
     95:    SetTolerances - Sets the convergence tolerances for solving the linear system.

     97:    Input Parameter:
     98: +  rtol - the relative tolerance
     99: .  atol - the absolute tolerance
    100: .  dtol - the divergence tolerance
    101: -  maxits - the maximum number of iterates

    103:    Level: intermediate
    104: @*/
    105: int TaoLinearSolver::SetTolerances(double rtol, double atol, double dtol, int maxits){
    106:   int info;
    107:   TaoFunctionBegin;
    108:   info = PetscLogInfo((0,"TaoLinearSolver::SetTolerances() method not defined. Options ignored\n")); CHKERRQ(info);
    109:   TaoFunctionReturn(0);
    110: }

    114: /*@C
    115:   SetOptions - Sets any relevant options from the command line.

    117:   Input Parameters: none
    118:
    119:   Level: intermediate
    120: @*/
    121: int TaoLinearSolver::SetOptions(){
    122:   int info;
    123:   TaoFunctionBegin;
    124:   info = PetscLogInfo((0,"TaoLinearSolver::SetOptions(): method not defined or implemented.\n")); CHKERRQ(info);
    125:   info = TaoOptionsHead("TaoLinearSolverOptions:  Not currently implemented through TAO");CHKERRQ(info);
    126:   info = TaoOptionsTail();CHKERRQ(info);
    127:   TaoFunctionReturn(0);
    128: }

    132: /*@C
    133:   View - Views the linear solver.

    135:   Input Parameters: none
    136:
    137:   Level: intermediate
    138: @*/
    139: int TaoLinearSolver::View(){
    140:   int info;
    141:   TaoFunctionBegin;
    142:   info = PetscLogInfo((0,"TaoLinearSolver::View() method not defined.\n")); CHKERRQ(info);
    143:   info = TaoPrintStatement(0,"  TaoLinearSolverView: No information available: \n");CHKERRQ(info);
    144:   TaoFunctionReturn(0);
    145: }