42 #include "Ifpack_CrsRiluk.h"
43 #include "Epetra_Comm.h"
44 #include "Epetra_Map.h"
45 #include "Epetra_CrsGraph.h"
46 #include "Epetra_VbrMatrix.h"
47 #include "Epetra_RowMatrix.h"
48 #include "Epetra_MultiVector.h"
50 #include <Teuchos_ParameterList.hpp>
51 #include <ifp_parameters.h>
55 : UserMatrixIsVbr_(false),
56 UserMatrixIsCrs_(false),
58 Comm_(Graph_in.Comm()),
62 ValuesInitialized_(false),
76 : UserMatrixIsVbr_(FactoredMatrix.UserMatrixIsVbr_),
77 UserMatrixIsCrs_(FactoredMatrix.UserMatrixIsCrs_),
78 IsOverlapped_(FactoredMatrix.IsOverlapped_),
79 Graph_(FactoredMatrix.Graph_),
80 IlukRowMap_(FactoredMatrix.IlukRowMap_),
81 IlukDomainMap_(FactoredMatrix.IlukDomainMap_),
82 IlukRangeMap_(FactoredMatrix.IlukRangeMap_),
83 Comm_(FactoredMatrix.Comm_),
84 UseTranspose_(FactoredMatrix.UseTranspose_),
85 NumMyDiagonals_(FactoredMatrix.NumMyDiagonals_),
86 Allocated_(FactoredMatrix.Allocated_),
87 ValuesInitialized_(FactoredMatrix.ValuesInitialized_),
88 Factored_(FactoredMatrix.Factored_),
89 RelaxValue_(FactoredMatrix.RelaxValue_),
90 Athresh_(FactoredMatrix.Athresh_),
91 Rthresh_(FactoredMatrix.Rthresh_),
92 Condest_(FactoredMatrix.Condest_),
93 OverlapMode_(FactoredMatrix.OverlapMode_)
95 L_ = Teuchos::rcp(
new Epetra_CrsMatrix(FactoredMatrix.
L()) );
96 U_ = Teuchos::rcp(
new Epetra_CrsMatrix(FactoredMatrix.
U()) );
97 D_ = Teuchos::rcp(
new Epetra_Vector(FactoredMatrix.
D()) );
98 if (IlukRowMap_!=Teuchos::null) IlukRowMap_ = Teuchos::rcp(
new Epetra_Map(*IlukRowMap_) );
99 if (IlukDomainMap_!=Teuchos::null) IlukDomainMap_ = Teuchos::rcp(
new Epetra_Map(*IlukDomainMap_) );
100 if (IlukRangeMap_!=Teuchos::null) IlukRangeMap_ = Teuchos::rcp(
new Epetra_Map(*IlukRangeMap_) );
106 ValuesInitialized_ =
false;
111 int Ifpack_CrsRiluk::AllocateCrs() {
114 L_ = Teuchos::rcp(
new Epetra_CrsMatrix(Copy, Graph_.
L_Graph()) );
115 U_ = Teuchos::rcp(
new Epetra_CrsMatrix(Copy, Graph_.
U_Graph()) );
116 D_ = Teuchos::rcp(
new Epetra_Vector(Graph_.
L_Graph().RowMap()) );
117 L_Graph_ = Teuchos::null;
118 U_Graph_ = Teuchos::null;
123 int Ifpack_CrsRiluk::AllocateVbr() {
127 EPETRA_CHK_ERR(BlockMap2PointMap(Graph_.
L_Graph().RowMap(), &IlukRowMap_));
128 EPETRA_CHK_ERR(BlockMap2PointMap(Graph_.
U_Graph().DomainMap(), &IlukDomainMap_));
129 EPETRA_CHK_ERR(BlockMap2PointMap(Graph_.
L_Graph().RangeMap(), &IlukRangeMap_));
132 U_DomainMap_ = IlukDomainMap_;
133 L_RangeMap_ = IlukRangeMap_;
135 if (
Graph().LevelFill()) {
136 L_Graph_ = Teuchos::rcp(
new Epetra_CrsGraph(Copy, *IlukRowMap_, *IlukRowMap_, 0) );
137 U_Graph_ = Teuchos::rcp(
new Epetra_CrsGraph(Copy, *IlukRowMap_, *IlukRowMap_, 0) );
138 EPETRA_CHK_ERR(BlockGraph2PointGraph(Graph_.
L_Graph(), *L_Graph_,
false));
139 EPETRA_CHK_ERR(BlockGraph2PointGraph(Graph_.
U_Graph(), *U_Graph_,
true));
141 L_Graph_->FillComplete(*IlukRowMap_, *IlukRangeMap_);
142 U_Graph_->FillComplete(*IlukDomainMap_, *IlukRowMap_);
144 L_ = Teuchos::rcp(
new Epetra_CrsMatrix(Copy, *L_Graph_) );
145 U_ = Teuchos::rcp(
new Epetra_CrsMatrix(Copy, *U_Graph_) );
146 D_ = Teuchos::rcp(
new Epetra_Vector(*IlukRowMap_) );
150 L_ = Teuchos::rcp(
new Epetra_CrsMatrix(Copy, *IlukRowMap_, *IlukRowMap_, 0) );
151 U_ = Teuchos::rcp(
new Epetra_CrsMatrix(Copy, *IlukRowMap_, *IlukRowMap_, 0) );
152 D_ = Teuchos::rcp(
new Epetra_Vector(*IlukRowMap_) );
153 L_Graph_ = Teuchos::null;
154 U_Graph_ = Teuchos::null;
162 bool cerr_warning_if_unused)
165 params.double_params[Ifpack::relax_value] = RelaxValue_;
166 params.double_params[Ifpack::absolute_threshold] = Athresh_;
167 params.double_params[Ifpack::relative_threshold] = Rthresh_;
168 params.overlap_mode = OverlapMode_;
170 Ifpack::set_parameters(parameterlist, params, cerr_warning_if_unused);
172 RelaxValue_ = params.double_params[Ifpack::relax_value];
173 Athresh_ = params.double_params[Ifpack::absolute_threshold];
174 Rthresh_ = params.double_params[Ifpack::relative_threshold];
175 OverlapMode_ = params.overlap_mode;
183 UserMatrixIsCrs_ =
true;
185 if (!Allocated()) AllocateCrs();
187 Teuchos::RefCountPtr<Epetra_CrsMatrix> OverlapA = Teuchos::rcp( (Epetra_CrsMatrix *) &A,
false );
191 OverlapA = Teuchos::rcp(
new Epetra_CrsMatrix(Copy, *Graph_.
OverlapGraph()) );
192 EPETRA_CHK_ERR(OverlapA->Import(A, *Graph_.
OverlapImporter(), Insert));
193 EPETRA_CHK_ERR(OverlapA->FillComplete());
197 int MaxNumEntries = OverlapA->MaxNumEntries();
200 U_DomainMap_ = Teuchos::rcp( &(A.DomainMap()),
false );
201 L_RangeMap_ = Teuchos::rcp( &(A.RangeMap()),
false );
204 EPETRA_CHK_ERR(InitAllValues(*OverlapA, MaxNumEntries));
212 UserMatrixIsVbr_ =
true;
214 if (!Allocated()) AllocateVbr();
226 Teuchos::RefCountPtr<Epetra_VbrMatrix> OverlapA = Teuchos::rcp( (Epetra_VbrMatrix *) &A,
false );
230 OverlapA = Teuchos::rcp(
new Epetra_VbrMatrix(Copy, *Graph_.
OverlapGraph()) );
231 EPETRA_CHK_ERR(OverlapA->Import(A, *Graph_.
OverlapImporter(), Insert));
232 EPETRA_CHK_ERR(OverlapA->FillComplete());
238 int MaxNumEntries = OverlapA->MaxNumNonzeros();
242 EPETRA_CHK_ERR(InitAllValues(*OverlapA, MaxNumEntries));
248 int Ifpack_CrsRiluk::InitAllValues(
const Epetra_RowMatrix & OverlapA,
int MaxNumEntries) {
252 int NumIn, NumL, NumU;
254 int NumNonzeroDiags = 0;
257 vector<int> InI(MaxNumEntries);
258 vector<int> LI(MaxNumEntries);
259 vector<int> UI(MaxNumEntries);
260 vector<double> InV(MaxNumEntries);
261 vector<double> LV(MaxNumEntries);
262 vector<double> UV(MaxNumEntries);
264 bool ReplaceValues = (L_->StaticGraph() || L_->IndicesAreLocal());
273 EPETRA_CHK_ERR(D_->ExtractView(&DV));
280 EPETRA_CHK_ERR(OverlapA.ExtractMyRowCopy(i, MaxNumEntries, NumIn, &InV[0], &InI[0]));
288 for (j=0; j< NumIn; j++) {
293 DV[i] += Rthresh_ * InV[j] + EPETRA_SGN(InV[j]) * Athresh_;
296 else if (k < 0) {EPETRA_CHK_ERR(-1);}
312 if (DiagFound) NumNonzeroDiags++;
313 else DV[i] = Athresh_;
317 EPETRA_CHK_ERR(L_->ReplaceMyValues(i, NumL, &LV[0], &LI[0]));
320 EPETRA_CHK_ERR(L_->InsertMyValues(i, NumL, &LV[0], &LI[0]));
326 EPETRA_CHK_ERR(U_->ReplaceMyValues(i, NumU, &UV[0], &UI[0]));
329 EPETRA_CHK_ERR(U_->InsertMyValues(i, NumU, &UV[0], &UI[0]));
335 if (!ReplaceValues) {
340 EPETRA_CHK_ERR(L_->FillComplete(L_->RowMatrixColMap(), *L_RangeMap_));
341 EPETRA_CHK_ERR(U_->FillComplete(*U_DomainMap_, U_->RowMatrixRowMap()));
346 SetValuesInitialized(
true);
349 int TotalNonzeroDiags = 0;
350 EPETRA_CHK_ERR(Graph_.
L_Graph().RowMap().Comm().SumAll(&NumNonzeroDiags, &TotalNonzeroDiags, 1));
351 NumMyDiagonals_ = NumNonzeroDiags;
352 if (NumNonzeroDiags !=
NumMyRows()) ierr = 1;
364 SetValuesInitialized(
false);
369 double MinDiagonalValue = Epetra_MinDouble;
370 double MaxDiagonalValue = 1.0/MinDiagonalValue;
374 int * LI=0, * UI = 0;
375 double * LV=0, * UV = 0;
376 int NumIn, NumL, NumU;
379 int MaxNumEntries = L_->MaxNumEntries() + U_->MaxNumEntries() + 1;
381 vector<int> InI(MaxNumEntries);
382 vector<double> InV(MaxNumEntries);
386 ierr = D_->ExtractView(&DV);
388 #ifdef IFPACK_FLOPCOUNTERS
389 int current_madds = 0;
398 for (j=0; j<
NumMyCols(); j++) colflag[j] = - 1;
404 NumIn = MaxNumEntries;
405 EPETRA_CHK_ERR(L_->ExtractMyRowCopy(i, NumIn, NumL, &InV[0], &InI[0]));
412 EPETRA_CHK_ERR(U_->ExtractMyRowCopy(i, NumIn-NumL-1, NumU, &InV[NumL+1], &InI[NumL+1]));
418 for (j=0; j<NumIn; j++) colflag[InI[j]] = j;
420 double diagmod = 0.0;
422 for (
int jj=0; jj<NumL; jj++) {
424 double multiplier = InV[jj];
428 EPETRA_CHK_ERR(U_->ExtractMyRowView(j, NumUU, UUV, UUI));
430 if (RelaxValue_==0.0) {
431 for (k=0; k<NumUU; k++) {
432 int kk = colflag[UUI[k]];
434 InV[kk] -= multiplier*UUV[k];
435 #ifdef IFPACK_FLOPCOUNTERS
442 for (k=0; k<NumUU; k++) {
443 int kk = colflag[UUI[k]];
444 if (kk>-1) InV[kk] -= multiplier*UUV[k];
445 else diagmod -= multiplier*UUV[k];
446 #ifdef IFPACK_FLOPCOUNTERS
453 EPETRA_CHK_ERR(L_->ReplaceMyValues(i, NumL, LV, LI));
458 if (RelaxValue_!=0.0) {
459 DV[i] += RelaxValue_*diagmod;
463 if (fabs(DV[i]) > MaxDiagonalValue) {
464 if (DV[i] < 0) DV[i] = - MinDiagonalValue;
465 else DV[i] = MinDiagonalValue;
470 for (j=0; j<NumU; j++) UV[j] *= DV[i];
473 EPETRA_CHK_ERR(U_->ReplaceMyValues(i, NumU, UV, UI));
477 for (j=0; j<NumIn; j++) colflag[InI[j]] = -1;
482 if( !L_->LowerTriangular() )
484 if( !U_->UpperTriangular() )
487 #ifdef IFPACK_FLOPCOUNTERS
490 double current_flops = 2 * current_madds;
491 double total_flops = 0;
493 EPETRA_CHK_ERR(Graph_.
L_Graph().RowMap().Comm().SumAll(¤t_flops, &total_flops, 1));
496 total_flops += (double) L_->NumGlobalNonzeros();
497 total_flops += (double) D_->GlobalLength();
498 if (RelaxValue_!=0.0) total_flops += 2 * (double)D_->GlobalLength();
500 UpdateFlops(total_flops);
511 Epetra_MultiVector& Y)
const {
517 Teuchos::RefCountPtr<Epetra_MultiVector> X1;
518 Teuchos::RefCountPtr<Epetra_MultiVector> Y1;
519 EPETRA_CHK_ERR(GenerateXY(Trans, X, Y, &X1, &Y1));
523 bool UnitDiagonal =
true;
525 #ifdef IFPACK_FLOPCOUNTERS
526 Epetra_Flops * counter = this->GetFlopCounter();
528 L_->SetFlopCounter(*counter);
529 Y1->SetFlopCounter(*counter);
530 U_->SetFlopCounter(*counter);
536 EPETRA_CHK_ERR(L_->Solve(Lower, Trans, UnitDiagonal, *X1, *Y1));
537 EPETRA_CHK_ERR(Y1->Multiply(1.0, *D_, *Y1, 0.0));
538 EPETRA_CHK_ERR(U_->Solve(Upper, Trans, UnitDiagonal, *Y1, *Y1));
539 if (IsOverlapped_) {EPETRA_CHK_ERR(Y.Export(*Y1,*L_->Exporter(), OverlapMode_));}
542 EPETRA_CHK_ERR(U_->Solve(Upper, Trans, UnitDiagonal, *X1, *Y1));
543 EPETRA_CHK_ERR(Y1->Multiply(1.0, *D_, *Y1, 0.0));
544 EPETRA_CHK_ERR(L_->Solve(Lower, Trans, UnitDiagonal, *Y1, *Y1));
545 if (IsOverlapped_) {EPETRA_CHK_ERR(Y.Export(*Y1,*U_->Importer(), OverlapMode_));}
552 Epetra_MultiVector& Y)
const {
558 Teuchos::RefCountPtr<Epetra_MultiVector> X1;
559 Teuchos::RefCountPtr<Epetra_MultiVector> Y1;
560 EPETRA_CHK_ERR(GenerateXY(Trans, X, Y, &X1, &Y1));
562 #ifdef IFPACK_FLOPCOUNTERS
563 Epetra_Flops * counter = this->GetFlopCounter();
565 L_->SetFlopCounter(*counter);
566 Y1->SetFlopCounter(*counter);
567 U_->SetFlopCounter(*counter);
572 EPETRA_CHK_ERR(U_->Multiply(Trans, *X1, *Y1));
573 EPETRA_CHK_ERR(Y1->Update(1.0, *X1, 1.0));
574 EPETRA_CHK_ERR(Y1->ReciprocalMultiply(1.0, *D_, *Y1, 0.0));
575 Epetra_MultiVector Y1temp(*Y1);
576 EPETRA_CHK_ERR(L_->Multiply(Trans, Y1temp, *Y1));
577 EPETRA_CHK_ERR(Y1->Update(1.0, Y1temp, 1.0));
578 if (IsOverlapped_) {EPETRA_CHK_ERR(Y.Export(*Y1,*L_->Exporter(), OverlapMode_));}
582 EPETRA_CHK_ERR(L_->Multiply(Trans, *X1, *Y1));
583 EPETRA_CHK_ERR(Y1->Update(1.0, *X1, 1.0));
584 EPETRA_CHK_ERR(Y1->ReciprocalMultiply(1.0, *D_, *Y1, 0.0));
585 Epetra_MultiVector Y1temp(*Y1);
586 EPETRA_CHK_ERR(U_->Multiply(Trans, Y1temp, *Y1));
587 EPETRA_CHK_ERR(Y1->Update(1.0, Y1temp, 1.0));
588 if (IsOverlapped_) {EPETRA_CHK_ERR(Y.Export(*Y1,*L_->Exporter(), OverlapMode_));}
596 ConditionNumberEstimate = Condest_;
600 Epetra_Vector Ones(U_->DomainMap());
601 Epetra_Vector OnesResult(L_->RangeMap());
604 EPETRA_CHK_ERR(
Solve(Trans, Ones, OnesResult));
605 EPETRA_CHK_ERR(OnesResult.Abs(OnesResult));
606 EPETRA_CHK_ERR(OnesResult.MaxValue(&ConditionNumberEstimate));
607 Condest_ = ConditionNumberEstimate;
611 int Ifpack_CrsRiluk::BlockGraph2PointGraph(
const Epetra_CrsGraph & BG, Epetra_CrsGraph & PG,
bool Upper) {
613 if (!BG.IndicesAreLocal()) {EPETRA_CHK_ERR(-1);}
615 int * ColFirstPointInElementList = BG.RowMap().FirstPointInElementList();
616 int * ColElementSizeList = BG.RowMap().ElementSizeList();
617 if (BG.Importer()!=0) {
618 ColFirstPointInElementList = BG.ImportMap().FirstPointInElementList();
619 ColElementSizeList = BG.ImportMap().ElementSizeList();
622 int Length = (BG.MaxNumIndices()+1) * BG.ImportMap().MaxMyElementSize();
623 vector<int> tmpIndices(Length);
625 int BlockRow, BlockOffset, NumEntries;
629 int NumMyRows_tmp = PG.NumMyRows();
631 for (
int i=0; i<NumMyRows_tmp; i++) {
632 EPETRA_CHK_ERR(BG.RowMap().FindLocalElementID(i, BlockRow, BlockOffset));
633 EPETRA_CHK_ERR(BG.ExtractMyRowView(BlockRow, NumBlockEntries, BlockIndices));
635 int * ptr = &tmpIndices[0];
637 int RowDim = BG.RowMap().ElementSize(BlockRow);
644 int jstop = EPETRA_MIN(NumMyRows_tmp,i+RowDim-BlockOffset);
645 for (
int j= jstart; j< jstop; j++) {*ptr++ = j; NumEntries++;}
648 for (
int j=0; j<NumBlockEntries; j++) {
649 int ColDim = ColElementSizeList[BlockIndices[j]];
650 NumEntries += ColDim;
651 assert(NumEntries<=Length);
652 int Index = ColFirstPointInElementList[BlockIndices[j]];
653 for (
int k=0; k < ColDim; k++) *ptr++ = Index++;
659 int jstart = EPETRA_MAX(0,i-RowDim+1);
661 for (
int j = jstart; j < jstop; j++) {*ptr++ = j; NumEntries++;}
664 EPETRA_CHK_ERR(PG.InsertMyIndices(i, NumEntries, &tmpIndices[0]));
672 int Ifpack_CrsRiluk::BlockMap2PointMap(
const Epetra_BlockMap & BlockMap, Teuchos::RefCountPtr<Epetra_Map>* PointMap) {
678 int MaxElementSize = BlockMap.MaxElementSize();
679 int PtNumMyElements = BlockMap.NumMyPoints();
680 vector<int> PtMyGlobalElements;
681 if (PtNumMyElements>0) PtMyGlobalElements.resize(PtNumMyElements);
683 int NumMyElements = BlockMap.NumMyElements();
686 for (
int i=0; i<NumMyElements; i++) {
687 int StartID = BlockMap.GID(i)*MaxElementSize;
688 int ElementSize = BlockMap.ElementSize(i);
689 for (
int j=0; j<ElementSize; j++) PtMyGlobalElements[curID++] = StartID+j;
691 assert(curID==PtNumMyElements);
693 (*PointMap) = Teuchos::rcp(
new Epetra_Map(-1, PtNumMyElements, &PtMyGlobalElements[0], BlockMap.IndexBase(), BlockMap.Comm()) );
695 if (!BlockMap.PointSameAs(*(*PointMap))) {EPETRA_CHK_ERR(-1);}
699 int Ifpack_CrsRiluk::GenerateXY(
bool Trans,
700 const Epetra_MultiVector& Xin,
const Epetra_MultiVector& Yin,
701 Teuchos::RefCountPtr<Epetra_MultiVector>* Xout,
702 Teuchos::RefCountPtr<Epetra_MultiVector>* Yout)
const {
706 if (Xin.NumVectors()!=Yin.NumVectors()) EPETRA_CHK_ERR(-1);
709 (*Xout) = Teuchos::rcp( (Epetra_MultiVector *) &Xin,
false );
710 (*Yout) = Teuchos::rcp( (Epetra_MultiVector *) &Yin,
false );
711 if (!IsOverlapped_ && UserMatrixIsCrs_)
return(0);
713 if (UserMatrixIsVbr_) {
714 if (VbrX_!=Teuchos::null) {
715 if (VbrX_->NumVectors()!=Xin.NumVectors()) {
716 VbrX_ = Teuchos::null;
717 VbrY_ = Teuchos::null;
720 if (VbrX_==Teuchos::null) {
721 VbrX_ = Teuchos::rcp(
new Epetra_MultiVector(View, *U_DomainMap_, (*Xout)->Pointers(), (*Xout)->NumVectors()) );
722 VbrY_ = Teuchos::rcp(
new Epetra_MultiVector(View, *L_RangeMap_, (*Yout)->Pointers(), (*Yout)->NumVectors()) );
725 EPETRA_CHK_ERR(VbrX_->ResetView((*Xout)->Pointers()));
726 EPETRA_CHK_ERR(VbrY_->ResetView((*Yout)->Pointers()));
734 if (OverlapX_!=Teuchos::null) {
735 if (OverlapX_->NumVectors()!=Xin.NumVectors()) {
736 OverlapX_ = Teuchos::null;
737 OverlapY_ = Teuchos::null;
740 if (OverlapX_==Teuchos::null) {
741 OverlapX_ = Teuchos::rcp(
new Epetra_MultiVector(U_->RowMatrixColMap(), (*Xout)->NumVectors()) );
742 OverlapY_ = Teuchos::rcp(
new Epetra_MultiVector(L_->RowMatrixRowMap(), (*Yout)->NumVectors()) );
745 EPETRA_CHK_ERR(OverlapX_->Import(*(*Xout),*U_->Importer(), Insert));
748 EPETRA_CHK_ERR(OverlapX_->Import(*(*Xout),*L_->Exporter(), Insert));
767 Epetra_CrsMatrix & L = (Epetra_CrsMatrix &) A.
L();
768 Epetra_CrsMatrix & U = (Epetra_CrsMatrix &) A.
U();
769 Epetra_Vector & D = (Epetra_Vector &) A.
D();
773 os <<
" Level of Fill = "; os << LevelFill;
776 os <<
" Level of Overlap = "; os << LevelOverlap;
780 os <<
" Lower Triangle = ";
786 os <<
" Inverse of Diagonal = ";
792 os <<
" Upper Triangle = ";
int Multiply(bool Trans, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns the result of multiplying U, D and L in that order on an Epetra_MultiVector X in Y...
Ifpack_CrsRiluk: A class for constructing and using an incomplete lower/upper (ILU) factorization of ...
int Condest(bool Trans, double &ConditionNumberEstimate) const
Returns the maximum over all the condition number estimate for each local ILU set of factors...
const Epetra_CrsMatrix & L() const
Returns the address of the L factor associated with this factored matrix.
virtual Epetra_CrsGraph & L_Graph()
Returns the graph of lower triangle of the ILU(k) graph as a Epetra_CrsGraph.
virtual Epetra_CrsGraph * OverlapGraph() const
Returns the the overlapped graph.
Ifpack_IlukGraph: A class for constructing level filled graphs for use with ILU(k) class precondition...
virtual const Epetra_BlockMap & DomainMap() const
Returns the Epetra_BlockMap object associated with the domain of this matrix operator.
virtual int LevelFill() const
Returns the level of fill used to construct this graph.
virtual Epetra_CrsGraph & U_Graph()
Returns the graph of upper triangle of the ILU(k) graph as a Epetra_CrsGraph.
int SetParameters(const Teuchos::ParameterList ¶meterlist, bool cerr_warning_if_unused=false)
Set parameters using a Teuchos::ParameterList object.
int NumMyCols() const
Returns the number of local matrix columns.
int InitValues(const Epetra_CrsMatrix &A)
Initialize L and U with values from user matrix A.
const Epetra_CrsMatrix & U() const
Returns the address of the L factor associated with this factored matrix.
virtual int LevelOverlap() const
Returns the level of overlap used to construct this graph.
virtual Epetra_Import * OverlapImporter() const
Returns the importer used to create the overlapped graph.
int Solve(bool Trans, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns the result of a Ifpack_CrsRiluk forward/back solve on a Epetra_MultiVector X in Y (works for ...
bool Factored() const
If factor is completed, this query returns true, otherwise it returns false.
int NumMyRows() const
Returns the number of local matrix rows.
bool ValuesInitialized() const
If values have been initialized, this query returns true, otherwise it returns false.
const Epetra_Vector & D() const
Returns the address of the D factor associated with this factored matrix.
virtual ~Ifpack_CrsRiluk()
Ifpack_CrsRiluk Destructor.
int Factor()
Compute ILU factors L and U using the specified graph, diagonal perturbation thresholds and relaxatio...
const Ifpack_IlukGraph & Graph() const
Returns the address of the Ifpack_IlukGraph associated with this factored matrix. ...
Ifpack_CrsRiluk(const Ifpack_IlukGraph &Graph_in)
Ifpack_CrsRiluk constuctor with variable number of indices per row.