Actual source code: taolinearsolver_ga.c

      1: #include "tao_general.h"
      2: #include "taomat_ga.h"
      3: #include "taovec_ga.h"
      4: #include "taolinearsolver_ga.h"

      6: TaoLinearSolverGa::TaoLinearSolverGa():TaoLinearSolver() {
      7:   linear_iters=0;
      8:   mm = 0;
      9: }

     11: int
     12: TaoLinearSolverGa::SetOperator(TaoMat* m1){
     13:   TaoFunctionBegin;
     14:   mm = ((TaoMatGa *)m1)->GetMat();
     15:   TaoFunctionReturn(0);
     16: }

     19: int
     20: TaoLinearSolverGa::SetTrustRadius(double rad){
     21:   TaoFunctionBegin;
     22:   GA_Error ("TaoLinearSolverGA::SetTrustRadius() not defined: ", 0L);
     23:   TaoFunctionReturn(1);
     24: }

     26: int
     27: TaoLinearSolverGa::Solve(TaoVec* v1, TaoVec* v2){
     28:   GAVec g_vv=((TaoVecGa *)v1)->GetVec();
     29:   GAVec g_ww=((TaoVecGa *)v2)->GetVec();
     30:   TaoFunctionBegin;
     31:   GA_Copy(g_vv, g_ww);
     32:   GA_Lu_solve('N', mm, g_ww);
     33:   TaoFunctionReturn(0);
     34: }

     36: int
     37: TaoLinearSolverGa::GetNumberIterations(int * iters){
     38:   TaoFunctionBegin;
     39:   *iters=linear_iters;
     40:   TaoFunctionReturn(0);
     41: }

     43: int
     44: TaoLinearSolverGa::SetTolerances(double rtol, double atol, double dtol,
     45:                                  int maxits){
     46:   TaoFunctionBegin;
     47:   GA_Error ("TaoLinearSolverGA::SetTolerances() not defined: ", 0L);
     48:   TaoFunctionReturn(1);
     49: }

     51: int
     52: TaoLinearSolverGa::View(){
     53:   TaoFunctionBegin;
     54:   GA_Error ("TaoLinearSolverGA::View() not defined: ", 0L);
     55:   TaoFunctionReturn(1);
     56: }

     58: int
     59: TaoLinearSolverGa::SetOptions(){
     60:   TaoFunctionBegin;
     61:   GA_Error ("TaoLinearSolverGA::SetOptions() not defined: ", 0L);
     62:   TaoFunctionReturn(1);
     63: }

     65: int
     66: TaoLinearSolverGa::Duplicate(TaoLinearSolver**M){
     67:   TaoFunctionBegin;
     68:   *M = new TaoLinearSolverGa(*this);
     69:   TaoFunctionReturn(0);
     70: }