/Users/jack/Code/basso_dev/inc/SuperLUSolverCSR.h

Go to the documentation of this file.
00001 
00012 #ifndef _SUPERLU_SOLVER_CSR_BASSO_H_
00013 #define _SUPERLU_SOLVER_CSR_BASSO_H_
00014 
00015 #include "basso.h"
00016 #include "Solver.h"
00017 #include "gmm_superlu_interface.h"
00018 
00019 namespace basso {
00020 
00021 
00028         class SuperLUSolverCSR : public Solver<DynamicCSRMatrix>
00029         {
00030         public:
00031                 SuperLUSolverCSR( DynamicCSRMatrix &K, nArray &f ) 
00032                         : Solver<DynamicCSRMatrix>(K,f) { ordering=1; }
00033 
00034                 virtual int Solve( nArray &d );
00035 
00041                 void SetOrdering( int ord ) { if ( ord>=0 && ord<3 ) ordering=ord; }
00042                 
00044                 Numeric ConditionEstimate() const 
00045                         { 
00046                                 if ( Solved() ) 
00047                                         return condest; 
00048                                 WarningMessage("SuperLUSolverCSR::ConditionEstimate","sytem not yet solved");
00049                                 return 0;
00050                         }
00051 
00052         protected:
00053                 int ordering;
00054                 Numeric condest;
00055 
00056         };
00057 
00058 
00059         int SuperLUSolverCSR::Solve( nArray &d )
00060         {
00061                 CSRMatrix Kcsr(NumEquations(),NumEquations());
00062                 clean(*Kptr,1e-12);
00063                 copy(*Kptr,Kcsr);
00064                 SuperLU_solve( Kcsr, d, *fptr, condest, ordering );
00065                 solved=true;
00066                 return 0;
00067         }
00068 
00069 } // end namespace
00070 
00071 #endif

Generated on Sat Jan 19 09:03:57 2008 for Basso by  doxygen 1.5.2