|
EpetraExt Development
|
00001 //@HEADER 00002 // *********************************************************************** 00003 // 00004 // EpetraExt: Epetra Extended - Linear Algebra Services Package 00005 // Copyright (2001) Sandia Corporation 00006 // 00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive 00008 // license for use of this work by or on behalf of the U.S. Government. 00009 // 00010 // This library is free software; you can redistribute it and/or modify 00011 // it under the terms of the GNU Lesser General Public License as 00012 // published by the Free Software Foundation; either version 2.1 of the 00013 // License, or (at your option) any later version. 00014 // 00015 // This library is distributed in the hope that it will be useful, but 00016 // WITHOUT ANY WARRANTY; without even the implied warranty of 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 // Lesser General Public License for more details. 00019 // 00020 // You should have received a copy of the GNU Lesser General Public 00021 // License along with this library; if not, write to the Free Software 00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00023 // USA 00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 00025 // 00026 // *********************************************************************** 00027 //@HEADER 00028 00029 #ifndef EPETRAEXT_BLOCKJACOBI_LINEARPROBLEM_H 00030 #define EPETRAEXT_BLOCKJACOBI_LINEARPROBLEM_H 00031 00032 #include <EpetraExt_Transform.h> 00033 00034 #include <vector> 00035 00036 class Epetra_LinearProblem; 00037 class Epetra_VbrMatrix; 00038 class Epetra_SerialDenseSVD; 00039 class Epetra_SerialDenseMatrix; 00040 00041 namespace EpetraExt { 00042 00043 class LinearProblem_BlockJacobi : public SameTypeTransform<Epetra_LinearProblem> { 00044 00045 public: 00046 00047 ~LinearProblem_BlockJacobi(); 00048 00049 LinearProblem_BlockJacobi( int verbose = 0, 00050 int thresholding = 0, 00051 double rthresh = 0.0, 00052 double athresh = 0.0, 00053 bool removeDiag = false ) 00054 : NumBlocks_(0), 00055 NewProblem_(0), 00056 NewMatrix_(0), 00057 thresholding_(thresholding), 00058 rthresh_(rthresh), 00059 athresh_(athresh), 00060 removeDiag_(removeDiag), 00061 verbose_(verbose) 00062 {} 00063 00064 NewTypeRef operator()( OriginalTypeRef orig ); 00065 00066 bool fwd(); 00067 bool rvs(); 00068 00069 void RThresh( double val ) { rthresh_ = val; } 00070 00071 private: 00072 00073 int NumBlocks_; 00074 00075 double rthresh_; 00076 double athresh_; 00077 const int thresholding_; 00078 00079 const bool removeDiag_; 00080 00081 Epetra_LinearProblem * NewProblem_; 00082 Epetra_VbrMatrix * NewMatrix_; 00083 00084 std::vector<Epetra_SerialDenseMatrix**> VbrBlocks_; 00085 std::vector<int> VbrBlockCnt_; 00086 std::vector<int> VbrBlockDim_; 00087 std::vector<int*> VbrBlockIndices_; 00088 00089 std::vector<Epetra_SerialDenseSVD*> SVDs_; 00090 std::vector<Epetra_SerialDenseMatrix*> Inverses_; 00091 std::vector<Epetra_SerialDenseMatrix*> RHSBlocks_; 00092 00093 const int verbose_; 00094 }; 00095 00096 } //namespace EpetraExt 00097 00098 #endif //EPETRAEXT_BLOCKJACOBI_LINEARPROBLEM_H
1.7.4