58 M_VectorList.push_back (newVector);
63 if (M_VectorList.size() == 0)
66 M_CorrelationMatrix.Shape (0, 0);
71 std::list<VectorEpetra>::iterator it = M_VectorList.begin();
75 for ( ; it != M_VectorList.end(); ++it)
80 MeanVector /= M_VectorList.size();
84 std::vector<VectorEpetra> corrVectorsList (M_VectorList.begin(), M_VectorList.end() );
85 std::vector<VectorEpetra>::iterator cit;
86 for (cit = corrVectorsList.begin(); cit != corrVectorsList.end(); ++cit)
93 M_CorrelationMatrix.Shape (corrVectorsList.size(), corrVectorsList.size() );
95 for (size_t i (0); i < M_VectorList.size(); ++i)
97 for (size_t j (i); j < M_VectorList.size(); ++j)
99 M_CorrelationMatrix (i, j) = corrVectorsList[i].dot (corrVectorsList[j]);
100 M_CorrelationMatrix (j, i) = M_CorrelationMatrix (i, j);
133 std::cout <<
"Norm of the mean vector changed" << std::endl;
137 std::cout <<
"Norm of the mean vector unchanged" << std::endl;
145 std::cout.precision (15);
147 std::cout <<
"Real referenceMeanNorm = " << M_NormMean <<
";" << std::endl;
149 std::cout <<
"Epetra_SerialDenseMatrix refM(" 150 << M_CorrelationMatrix.M() <<
"," << M_CorrelationMatrix.N() <<
");" 153 for (
int i (0); i < M_CorrelationMatrix.M(); ++i)
155 for (
int j (0); j < M_CorrelationMatrix.M(); ++j)
157 std::cout <<
"refM(" << i <<
"," << j <<
") = " << M_CorrelationMatrix (i, j) <<
"; ";
159 std::cout << std::endl;
VectorEpetra - The Epetra Vector format Wrapper.
void updateInverseJacobian(const UInt &iQuadPt)
virtual ~VerifySolutions()
void Print() const
Print Mean and Correlation matrix as c++ lines ready to be inserted into the test.
void ComputeCorrelation()
Compute the correlation matrix and norm of the mean.
void PushBack(VectorEpetra const &newVector)
Add a vector to the list of stored vectors.
double Real
Generic real data.
This class helps the testsuites in verifying that the solutions do not change from one execution to t...
bool Check(Real referenceMean, Real tol) const
Checks that the current norm of the mean of the vectors is the same as the one provided by the user...
Real norm2() const
Compute and return the norm 2.