|
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_LINEARPROBLEM_BTF_H 00030 #define EpetraExt_LINEARPROBLEM_BTF_H 00031 00032 #include <EpetraExt_Transform.h> 00033 00034 #include <vector> 00035 #include <map> 00036 #include <set> 00037 00038 class Epetra_LinearProblem; 00039 class Epetra_VbrMatrix; 00040 class Epetra_MultiVector; 00041 class Epetra_Vector; 00042 class Epetra_CrsMatrix; 00043 class Epetra_CrsGraph; 00044 class Epetra_Map; 00045 class Epetra_BlockMap; 00046 class Epetra_SerialDenseMatrix; 00047 00048 namespace EpetraExt { 00049 00050 class LinearProblem_BTF : public SameTypeTransform<Epetra_LinearProblem> { 00051 00052 public: 00053 00054 ~LinearProblem_BTF(); 00055 00056 LinearProblem_BTF( double thres = 0.0, 00057 int verbose = 0 ) 00058 : NewMap_(0), 00059 NewMatrix_(0), 00060 NewGraph_(0), 00061 NewLHS_(0), 00062 NewRHS_(0), 00063 NewProblem_(0), 00064 OrigGraph_(0), 00065 OrigMatrix_(0), 00066 OrigRHS_(0), 00067 OrigLHS_(0), 00068 OrigProblem_(0), 00069 threshold_(thres), 00070 verbose_(verbose), 00071 changedLP_(false) 00072 {} 00073 00074 NewTypeRef operator()( OriginalTypeRef orig ); 00075 00076 bool fwd(); 00077 bool rvs(); 00078 00079 bool changedLP() { return changedLP_; } 00080 00081 private: 00082 00083 void deleteNewObjs_(); 00084 00085 Epetra_BlockMap * NewMap_; 00086 00087 Epetra_LinearProblem * NewProblem_; 00088 00089 Epetra_VbrMatrix * NewMatrix_; 00090 Epetra_CrsGraph * NewGraph_; 00091 00092 Epetra_MultiVector * NewLHS_; 00093 Epetra_MultiVector * NewRHS_; 00094 00095 Epetra_Map * OrigRowMap_; 00096 Epetra_Map * OrigColMap_; 00097 Epetra_LinearProblem * OrigProblem_; 00098 Epetra_CrsGraph * OrigGraph_; 00099 Epetra_CrsMatrix * OrigMatrix_; 00100 Epetra_MultiVector * OrigLHS_; 00101 Epetra_MultiVector * OrigRHS_; 00102 00103 std::vector<int> OldGlobalElements_; 00104 00105 std::vector< std::set<int> > ZeroElements_; 00106 00107 std::vector< std::vector<Epetra_SerialDenseMatrix*> > Blocks_; 00108 std::vector<int> BlockDim_; 00109 std::vector<int> BlockCnt_; 00110 std::map<int,int> BlockRowMap_; 00111 std::map<int,int> SubBlockRowMap_; 00112 std::map<int,int> BlockColMap_; 00113 std::map<int,int> SubBlockColMap_; 00114 00115 std::vector< std::vector<int> > NewBlockRows_; 00116 00117 const double threshold_; 00118 const int verbose_; 00119 00120 bool changedLP_; 00121 }; 00122 00123 } //namespace EpetraExt 00124 00125 #endif //EpetraExt_LINEARPROBLEM_BTF_H
1.7.4