4 #if defined(Amesos_SHOW_DEPRECATED_WARNINGS)
6 #warning "The Amesos package is deprecated"
38 const bool UseTranspose,
39 const std::string prefix)
const
43 int NumVectors = X.NumVectors();
45 for (
int i = 0 ; i < NumVectors ; ++i)
47 Matrix.
Multiply(UseTranspose, *X(i), Ax);
48 Ax.Update(1.0, *B(i), -1.0);
52 std::cout << prefix <<
" : vector " << i <<
", ||Ax - b|| = "
60 const std::string prefix)
const
64 int NumVectors = X.NumVectors();
66 for (
int i = 0 ; i < NumVectors ; ++i)
68 X(i)->Norm2(&NormLHS);
69 B(i)->Norm2(&NormRHS);
70 if (X.Comm().MyPID() == 0)
71 std::cout << prefix <<
" : vector " << i <<
", ||x|| = " << NormLHS
72 <<
", ||b|| = " << NormRHS << std::endl;
79 std::cout <<
"--------------------------------------------";
80 std::cout <<
"--------------------------------" << std::endl;
87 switch(MaxProcesses) {
89 MaxProcesses = MaxProcs;
92 MaxProcesses = (int) sqrt(1.0 * MaxProcs);
100 if (MaxProcesses <= 0) MaxProcesses = 1;
101 if (MaxProcesses > MaxProcs) MaxProcesses = MaxProcs;
void PrintLine() const
Prints line on std::cout.
void SetMaxProcesses(int &MaxProcesses, const Epetra_RowMatrix &A)
virtual int MyPID() const =0
Amesos_Utils()
Default constructor.
~Amesos_Utils()
Default destructor.
virtual const Epetra_Comm & Comm() const =0
virtual const Epetra_BlockMap & Map() const =0
virtual long long NumGlobalNonzeros64() const =0
virtual int Multiply(bool TransA, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const =0
virtual int NumProc() const =0
void ComputeTrueResidual(const Epetra_RowMatrix &Matrix, const Epetra_MultiVector &X, const Epetra_MultiVector &B, const bool UseTranspose, const std::string prefix) const
Computes the true residual, B - Matrix * X, and prints the results.
virtual long long NumGlobalRows64() const =0
void ComputeVectorNorms(const Epetra_MultiVector &X, const Epetra_MultiVector &B, const std::string prefix) const
Computes the norms of X and B and print the results.
Amesos_Utils: Collections of basic utilities.