11#ifndef ANASAZI_STATUS_TEST_ORDEREDRESNORM_HPP
12#define ANASAZI_STATUS_TEST_ORDEREDRESNORM_HPP
22#include "Teuchos_ScalarTraits.hpp"
50template <
class ScalarType,
class MV,
class OP>
54 typedef typename Teuchos::ScalarTraits<ScalarType>::magnitudeType MagnitudeType;
55 typedef Teuchos::ScalarTraits<MagnitudeType> MT;
141 test_->clearStatus();
148 void setAuxVals(
const std::vector<
typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> &
vals) {
150 ivals_.resize(rvals_.size(),MT::zero());
158 void setAuxVals(
const std::vector<
typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> &
rvals,
const std::vector<
typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> &
ivals) {
168 void getAuxVals(std::vector<
typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> &
rvals, std::vector<
typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> &
ivals)
const {
184 std::vector<int> ind_;
186 std::vector<MagnitudeType> rvals_, ivals_;
187 Teuchos::RCP<SortManager<typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> > sorter_;
188 Teuchos::RCP<StatusTest<ScalarType,MV,OP> > test_;
192template <
class ScalarType,
class MV,
class OP>
200template <
class ScalarType,
class MV,
class OP>
227 test_->checkStatus(
solver);
228 std::vector<int>
cwhch( test_->whichVecs() );
231 std::vector<Value<ScalarType> >
solval =
solver->getRitzValues();
281 std::vector<int>::iterator
end;
285 ind_.resize(
end - ind_.begin());
288 if (ind_.size() >= (
unsigned int)quorum_) {
298template <
class ScalarType,
class MV,
class OP>
303 os <<
ind <<
"- StatusTestWithOrdering: ";
306 os <<
"Passed" << std::endl;
309 os <<
"Failed" << std::endl;
312 os <<
"Undefined" << std::endl;
316 os <<
ind <<
" Quorum: " << quorum_ << std::endl;
318 os <<
ind <<
" Auxiliary values: ";
319 if (rvals_.size() > 0) {
320 for (
unsigned int i=0;
i<rvals_.size();
i++) {
321 os <<
"(" << rvals_[
i] <<
", " << ivals_[
i] <<
") ";
326 os <<
"[empty]" << std::endl;
330 os <<
ind <<
" Which vectors: ";
331 if (ind_.size() > 0) {
332 for (
unsigned int i=0;
i<ind_.size();
i++)
os << ind_[
i] <<
" ";
336 os <<
"[empty]" << std::endl;
Declaration and definition of Anasazi::StatusTest.
Anasazi's templated virtual class for constructing an operator that can interface with the OperatorTr...
Operator()
Default constructor.
Anasazi's templated pure virtual class for managing the sorting of approximate eigenvalues computed b...
Exception thrown to signal error in a status test during Anasazi::StatusTest::checkStatus().
A status test for testing the norm of the eigenvectors residuals along with a set of auxiliary eigenv...
std::ostream & print(std::ostream &os, int indent=0) const
Output formatted description of stopping test to output stream.
void clearStatus()
Clears the results of the last status test.
int getQuorum() const
Get quorum.
void getAuxVals(std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > &rvals, std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > &ivals) const
Get the auxiliary eigenvalues.
int howMany() const
Get the number of vectors that passed the test.
void setAuxVals(const std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > &rvals, const std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > &ivals)
Set the auxiliary eigenvalues.
TestStatus checkStatus(Eigensolver< ScalarType, MV, OP > *solver)
virtual ~StatusTestWithOrdering()
Destructor.
TestStatus getStatus() const
Return the result of the most recent checkStatus call, or undefined if it has not been run.
void setAuxVals(const std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > &vals)
Set the auxiliary eigenvalues.
void setQuorum(int quorum)
Set quorum.
std::vector< int > whichVecs() const
Get the indices for the vectors that passed the test.
StatusTestWithOrdering(Teuchos::RCP< StatusTest< ScalarType, MV, OP > > test, Teuchos::RCP< SortManager< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > > sorter, int quorum=-1)
Constructor.
void reset()
Informs the status test that it should reset its internal configuration to the uninitialized state.
Common interface of stopping criteria for Anasazi's solvers.
Namespace Anasazi contains the classes, structs, enums and utilities used by the Anasazi package.
TestStatus
Enumerated type used to pass back information from a StatusTest.