44 #include <Epetra_LinearProblem.h>
45 #include <Epetra_CrsMatrix.h>
46 #include <Epetra_Vector.h>
53 int lsize = (int) lScaleVecs_.size();
54 for(
int i = 0; i < lsize; ++i )
55 delete lScaleVecs_[i];
56 int rsize = (int) rScaleVecs_.size();
57 for(
int i = 0; i < rsize; ++i )
58 delete rScaleVecs_[i];
72 if( lScale_ !=
None && !lScaleVecs_.size() )
74 lScaleVecs_.resize(iters_);
75 for(
int i = 0; i < iters_; ++i )
78 if( rScale_ !=
None && !rScaleVecs_.size() )
80 rScaleVecs_.resize(iters_);
81 for(
int i = 0; i < iters_; ++i )
85 for(
int i = 0; i < iters_; ++i )
96 lScaleVecs_[i]->Reciprocal( *(lScaleVecs_[i]) );
103 for(
int j = 0; j < numVals; ++j ) (*(lScaleVecs_[i]))[j] = pow( (*(lScaleVecs_[i]))[j], expFac_ );
105 newObj_->LeftScale( *lScaleVecs_[i] );
107 if( rScale_ !=
None )
116 rScaleVecs_[i]->Reciprocal( *(rScaleVecs_[i]) );
123 for(
int j = 0; j < numVals; ++j ) (*(rScaleVecs_[i]))[j] = pow( (*(rScaleVecs_[i]))[j], expFac_ );
125 newObj_->RightScale( *rScaleVecs_[i] );
139 if( !scaled_ ) std::cout <<
"EpetraExt::LinearProblem_Scale::rvs() : Problem Not Scaled!\n";
143 for(
int i = 0; i < iters_; ++i )
145 int loc = iters_-i-1;
146 if( rScale_ !=
None )
148 rScaleVecs_[loc]->Reciprocal( *(rScaleVecs_[loc]) );
149 newObj_->RightScale( *(rScaleVecs_[loc]) );
151 if( lScale_ !=
None )
153 lScaleVecs_[loc]->Reciprocal( *(lScaleVecs_[loc]) );
154 newObj_->LeftScale( *(lScaleVecs_[loc]) );
int ExtractDiagonalCopy(Epetra_Vector &Diagonal) const
int InvColSums(Epetra_Vector &x) const
bool fwd()
Applies forward scaling.
int InvRowSums(Epetra_Vector &x) const
bool rvs()
Reverses scaling.
~LinearProblem_Scale()
Destructor.
int InvRowMaxs(Epetra_Vector &x) const
int InvColMaxs(Epetra_Vector &x) const