25 #ifdef HAVE_BELOS_TRIUTILS
26 #include "Trilinos_Util_iohb.h"
33 using namespace Teuchos;
35 int main(
int argc,
char *argv[])
42 MPI_Init(&argc,&argv);
50 MPI_Comm_rank(MPI_COMM_WORLD, &MyPID);
56 std::string
filename(
"mhd1280b.cua");
62 cmdp.
setOption(
"verbose",
"quiet",&verbose,
"Print messages and results.");
63 cmdp.
setOption(
"debug",
"quiet",&verbose,
"Print messages and results.");
64 cmdp.
setOption(
"filename",&filename,
"Filename for Harwell-Boeing test matrix.");
72 typedef std::complex<double> ST;
87 #ifndef HAVE_BELOS_TRIUTILS
88 std::cout <<
"This test requires Triutils. Please configure with --enable-triutils." << std::endl;
102 info = readHB_newmat_double(filename.c_str(),&dim,&dim2,&nnz,&colptr,&rowind,&dvals);
103 if (info == 0 || nnz < 0) {
105 <<
"Warning reading '" << filename <<
"'" << std::endl
106 <<
"End Result: TEST FAILED" << std::endl;
113 std::vector<ST> cvals(nnz);
114 for (
int ii=0; ii<nnz; ii++) {
115 cvals[ii] = ST(dvals[ii*2],dvals[ii*2+1]);
123 std::vector<ScalarTraits<ST>::magnitudeType> v(blockSize);
125 MVT::MvNorm(*ivec,v);
131 ierr = Belos::TestMultiVecTraits<ST,MV>(MyOM,ivec);
134 MyOM->print(
Belos::Warnings,
"*** MyMultiVec<std::complex> PASSED TestMultiVecTraits()\n");
137 MyOM->print(
Belos::Warnings,
"*** MyMultiVec<std::complex> FAILED TestMultiVecTraits() ***\n\n");
141 ierr = Belos::TestOperatorTraits<ST,MV,OP>(MyOM,ivec,A2);
144 MyOM->print(
Belos::Warnings,
"*** MyOperator<std::complex> PASSED TestOperatorTraits()\n");
147 MyOM->print(
Belos::Warnings,
"*** MyOperator<std::complex> FAILED TestOperatorTraits() ***\n\n");
151 ierr = Belos::TestOperatorTraits<ST,MV,OP>(MyOM,ivec,A1);
154 MyOM->print(
Belos::Warnings,
"*** MyBetterOperator<std::complex> PASSED TestOperatorTraits()\n");
157 MyOM->print(
Belos::Warnings,
"*** MyBetterOperator<std::complex> FAILED TestOperatorTraits() ***\n\n");
178 return ( success ? EXIT_SUCCESS : EXIT_FAILURE );
Belos's basic output manager for sending information of select verbosity levels to the appropriate ou...
Class which manages the output and verbosity of the Belos solvers.
int main(int argc, char *argv[])
Traits class which defines basic operations on multivectors.
Simple example of a user's defined Belos::MultiVec class.
Alternative run-time polymorphic interface for operators.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
void setOption(const char option_true[], const char option_false[], bool *option_val, const char documentation[]=NULL)
#define TEUCHOS_STANDARD_CATCH_STATEMENTS(VERBOSE, ERR_STREAM, SUCCESS_FLAG)
Test routines for MultiVecTraits and OperatorTraits conformity.
EParseCommandLineReturn parse(int argc, char *argv[], std::ostream *errout=&std::cerr) const
Simple example of a user's defined Belos::Operator class.
Interface for multivectors used by Belos' linear solvers.
Belos header file which uses auto-configuration information to include necessary C++ headers...
Simple example of a user's defined Belos::Operator class.