68 A_ =
dynamic_cast<Epetra_CrsMatrix *
> (Problem->GetOperator());
69 X_ = Problem->GetLHS();
70 B_ = Problem->GetRHS();
72 AG_ =
new Epetra_CrsGraph(
A_->Graph() );
75 int NumMyCols =
AG_->NumMyCols();
76 int NumMyEqs =
A_->NumMyRows();
77 int GlobalMaxNumIndices =
AG_->GlobalMaxNumIndices();
81 for(
int i = 0; i < NumMyCols; i++ )
83 for(
int i = 0; i < NumMyEqs; i++ )
85 assert(
AG_->ExtractMyRowView( i, NumIndices, xIndices ) == 0 );
86 for(
int j = 0; j < NumIndices; j++ )
90 for(
int i = 0; i < NumMyCols; i++ )
102 for(
int i=0; i<NumMyCols; i++) {
112 int m =
A_->NumGlobalRows();
113 int n =
A_->NumGlobalCols();
123 X_->ExtractView( &rhs_x, &LDA_x );
124 dCreate_Dense_Matrix( &(
data_->
X), m, 1, rhs_x, m, SLU_DN, SLU_D, SLU_GE);
125 B_->ExtractView( &rhs_b, &LDA_b );
126 dCreate_Dense_Matrix( &(
data_->
B), m, 1, rhs_b, m, SLU_DN, SLU_D, SLU_GE);
133 ferr_ =
new double[1];
134 berr_ =
new double[1];
177 int NumMyCols =
AG_->NumMyCols();
178 int NumMyEqs =
A_->NumMyRows();
179 int GlobalMaxNumIndices =
AG_->GlobalMaxNumIndices();
184 for (
int i = 0; i < NumMyCols; i++ )
187 for (
int i = 0; i < NumMyEqs; i++ )
189 assert(
A_->ExtractMyRowView( i, NumIndices, xValues, xIndices) == 0 );
190 int ii =
A_->GRID(i);
191 for (
int j = 0; j < NumIndices; j++ )
193 int TransRow = xIndices[j];
214 int m =
A_->NumGlobalRows();
216 int permt = perm_type;
217 if( m < 3 ) permt = 0;
227 if( Verbose ) cout <<
"MATRIX COPIED!" << endl;
231 char fact, trans, refact, equed;
233 if( Trans ) trans =
'T';
236 if( Equil ) fact =
'E';
247 if( !Factor ) fact =
'F';
250 if( Equil ) equed =
'B';
257 if( Verbose ) cout <<
"TRANS: " << trans << endl;
258 if( Verbose ) cout <<
"REFACT: " << refact << endl;
265 if( info ) cout <<
"WARNING: SuperLU returned with error code = " << info << endl;
269 cout <<
"SYSTEM DIRECT SOLVED!" << endl;
271 cout <<
"SuperLU INFO: " << info <<
"\n\n";
272 cout <<
" ncols = " <<
A_->NumGlobalCols() << endl;
274 cout <<
"SuperLU Memory Usage\n";
275 cout <<
"--------------------\n";
279 cout <<
"--------------------\n\n";
281 if (m<200) dPrint_CompCol_Matrix(
"A", &(
data_->
A));
285 if (m<200) dPrint_Dense_Matrix(
"B", &(
data_->
B));
286 if (m<200) dPrint_Dense_Matrix(
"X", &(
data_->
X));
int Solve(bool Verbose=false, bool Equil=true, bool Factor=true, int perm_type=2, double pivot_thresh=-1, bool Refact=true, bool Trans=false)
All computation is performed during the call to Solve()