42 #include "Teuchos_UnitTestHarness.hpp"
43 #include "HYPRE_IJ_mv.h"
60 #include "Teuchos_ParameterList.hpp"
61 #include "Teuchos_ParameterEntry.hpp"
62 #include "Teuchos_ParameterListExceptions.hpp"
63 #include "Teuchos_Array.hpp"
72 const double tol = 1E-6;
79 TEST_EQUALITY(Matrix->
Filled(),
true);
81 for(
int i = 0; i < Matrix->
NumMyRows(); i++){
84 TEST_EQUALITY(entries, 1);
86 Teuchos::Array<double> Values; Values.resize(entries);
87 Teuchos::Array<int> Indices; Indices.resize(entries);
88 ierr += Matrix->
ExtractMyRowCopy(i, entries, numentries, &Values[0], &Indices[0]);
89 TEST_EQUALITY(ierr, 0);
90 TEST_EQUALITY(numentries,1);
91 for(
int j = 0; j < numentries; j++){
92 TEST_FLOATING_EQUALITY(Values[j],1.0,
tol);
93 TEST_EQUALITY(Indices[j],i);
108 ierr += Matrix->
Multiply(
false, X, Y);
111 TEST_EQUALITY(ierr, 0);
127 ierr += Matrix->
Multiply(
false, X, Y1);
128 ierr += TestMat->
Multiply(
false, X, Y2);
132 ierr += Matrix->
Multiply(
false, Y1, X);
133 ierr += TestMat->
Multiply(
false, Y1, Y2);
137 ierr += Matrix->
Multiply(
false, Y2, X);
138 ierr += TestMat->
Multiply(
false, Y2, Y1);
141 TEST_EQUALITY_CONST(ierr, 0);
158 ierr += Matrix->
Multiply(
true, X, Y1);
159 ierr += TestMat->
Multiply(
true, X, Y2);
162 TEST_EQUALITY(ierr, 0);
180 TEST_EQUALITY(ierr, 0);
197 TEST_EQUALITY(ierr, 0);
215 TEST_EQUALITY(ierr, 0);
233 TEST_EQUALITY(ierr, 0);
251 TEST_EQUALITY(ierr, 0);
261 double norm1 = Matrix->
NormInf();
262 double norm2 = TestMat->
NormInf();
264 TEST_FLOATING_EQUALITY(norm1, norm2,
tol);
273 double norm1 = Matrix->
NormOne();
274 double norm2 = TestMat->
NormOne();
276 TEST_FLOATING_EQUALITY(norm1, norm2,
tol);
289 TEST_EQUALITY(nnz1, nnz2);
302 TEST_EQUALITY(rows1, rows2);
315 TEST_EQUALITY(cols1, cols2);
328 TEST_EQUALITY(hdiag1, Ediag2);
341 TEST_EQUALITY(nnz1, nnz2);
354 TEST_EQUALITY(rows1, rows2);
367 TEST_EQUALITY(cols1, cols2);
380 TEST_EQUALITY(diag1, diag2);
393 TEST_EQUALITY(ent1, ent2);
464 Matrix->
Solve(
false,
false,
false, RHS, X);