42 #ifndef __Belos_OrthoManagerFactory_hpp
43 #define __Belos_OrthoManagerFactory_hpp
46 #ifdef HAVE_BELOS_TSQR
48 #endif // HAVE_BELOS_TSQR
55 #include <Teuchos_StandardCatchMacros.hpp>
81 template<
class Scalar,
class MV,
class OP>
85 std::vector<std::string> theList_;
90 #ifdef HAVE_BELOS_TSQR
94 #endif // HAVE_BELOS_TSQR
103 #ifdef HAVE_BELOS_TSQR
105 return (name ==
"TSQR");
108 #endif // HAVE_BELOS_TSQR
115 theList_[index++] =
"ICGS";
116 theList_[index++] =
"IMGS";
117 theList_[index++] =
"DGKS";
118 #ifdef HAVE_BELOS_TSQR
119 theList_[index++] =
"TSQR";
120 #endif // HAVE_BELOS_TSQR
121 theList_[index++] =
"Simple";
132 const std::vector<std::string>&
139 return (std::find (theList_.begin(), theList_.end(), name) != theList_.end());
148 "Invalid number " << numValid <<
" of valid MatOrtho"
149 "Manager names. Please report this bug to the Belos "
152 for (
int k = 0; k < numValid - 1; ++k)
153 out <<
"\"" << theList_[k] <<
"\", ";
156 out <<
"\"" << theList_[numValid-1] <<
"\"";
167 std::ostringstream os;
192 if (name ==
"DGKS") {
193 return Belos::getDGKSDefaultParameters<Scalar, MV, OP> ();
195 #ifdef HAVE_BELOS_TSQR
196 else if (name ==
"TSQR") {
200 #endif // HAVE_BELOS_TSQR
201 else if (name ==
"ICGS") {
202 return Belos::getICGSDefaultParameters<Scalar, MV, OP> ();
204 else if (name ==
"IMGS") {
205 return Belos::getIMGSDefaultParameters<Scalar, MV, OP> ();
207 else if (name ==
"Simple") {
213 "Invalid orthogonalization manager name \"" << name
215 <<
". For many of the test executables, the "
216 "orthogonalization manager name often corresponds "
217 "to the \"ortho\" command-line argument.");
240 if (name ==
"DGKS") {
241 return Belos::getDGKSFastParameters<Scalar, MV, OP> ();
243 #ifdef HAVE_BELOS_TSQR
244 else if (name ==
"TSQR") {
248 #endif // HAVE_BELOS_TSQR
249 else if (name ==
"ICGS") {
250 return Belos::getICGSFastParameters<Scalar, MV, OP> ();
252 else if (name ==
"IMGS") {
253 return Belos::getIMGSFastParameters<Scalar, MV, OP> ();
255 else if (name ==
"Simple") {
261 "Invalid orthogonalization manager name \"" << name
263 <<
". For many of the test executables, the "
264 "orthogonalization manager name often corresponds "
265 "to the \"ortho\" command-line argument.");
295 const std::string& label,
298 #ifdef HAVE_BELOS_TSQR
300 #endif // HAVE_BELOS_TSQR
307 if (ortho ==
"DGKS") {
309 return rcp (
new ortho_type (params, label, M));
311 #ifdef HAVE_BELOS_TSQR
312 else if (ortho ==
"TSQR") {
314 return rcp (
new ortho_type (params, label, M));
316 #endif // HAVE_BELOS_TSQR
317 else if (ortho ==
"ICGS") {
319 return rcp (
new ortho_type (params, label, M));
321 else if (ortho ==
"IMGS") {
323 return rcp (
new ortho_type (params, label, M));
325 else if (ortho ==
"Simple") {
327 "SimpleOrthoManager does not yet support "
328 "the MatOrthoManager interface");
331 "Invalid orthogonalization manager name: Valid names"
333 "the test executables, the orthogonalization manager"
334 " name often corresponds to the \"ortho\" command-"
359 const std::string& label,
362 #ifdef HAVE_BELOS_TSQR
364 #endif // HAVE_BELOS_TSQR
367 if (ortho ==
"Simple") {
369 "SimpleOrthoManager is not yet supported "
370 "when the operator M is nontrivial (i.e., "
374 #ifdef HAVE_BELOS_TSQR
383 else if (ortho ==
"TSQR" && M.
is_null()) {
386 #endif // HAVE_BELOS_TSQR
396 #endif // __Belos_OrthoManagerFactory_hpp
Belos's basic output manager for sending information of select verbosity levels to the appropriate ou...
Teuchos::RCP< Belos::OrthoManager< Scalar, MV > > makeOrthoManager(const std::string &ortho, const Teuchos::RCP< const OP > &M, const Teuchos::RCP< OutputManager< Scalar > > &outMan, const std::string &label, const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
Return an instance of the specified OrthoManager subclass.
Class which manages the output and verbosity of the Belos solvers.
static bool isRankRevealing(const std::string &name)
Is the given MatOrthoManager subclass rank-reealing?
Teuchos::RCP< const Teuchos::ParameterList > getFastParameters()
Get "fast" parameters for TsqrMatOrthoManager.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Teuchos::RCP< const Teuchos::ParameterList > getDefaultParameters(const std::string &name) const
Default parameters for the given MatOrthoManager subclass.
static int numOrthoManagers()
Number of MatOrthoManager subclasses this factory recognizes.
std::string validNamesString() const
List (as a string) of recognized MatOrthoManager names.
Iterated Modified Gram-Schmidt (IMGS) implementation of the Belos::OrthoManager class.
Simple OrthoManager implementation for benchmarks.
OrthoManagerFactory()
Constructor.
Classical Gram-Schmidt (with DGKS correction) implementation of the Belos::OrthoManager class...
Teuchos::RCP< const Teuchos::ParameterList > getFastParameters()
Get a "fast" list of parameters.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Simple OrthoManager implementation for benchmarks.
bool isValidName(const std::string &name) const
Whether this factory recognizes the MatOrthoManager with the given name.
std::ostream & printValidNames(std::ostream &out) const
Print all recognized MatOrthoManager names to the given ostream.
const std::string & defaultName() const
Name of the "default" MatOrthoManager subclass.
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
Get a default list of parameters.
Enumeration of all valid Belos (Mat)OrthoManager classes.
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
Get default parameters for TsqrMatOrthoManager.
Iterated Classical Gram-Schmidt (ICGS) implementation of the Belos::OrthoManager class.
An implementation of the Belos::MatOrthoManager that performs orthogonalization using multiple steps ...
An implementation of the Belos::MatOrthoManager that performs orthogonalization using multiple steps ...
#define TEUCHOS_UNREACHABLE_RETURN(dummyReturnVal)
An implementation of the Belos::MatOrthoManager that performs orthogonalization using (potentially) m...
Orthogonalization manager based on Tall Skinny QR (TSQR)
Teuchos::RCP< const Teuchos::ParameterList > getFastParameters(const std::string &name) const
"Fast" parameters for the given MatOrthoManager subclass.
const std::vector< std::string > & validNames() const
List of MatOrthoManager subclasses this factory recognizes.
MatOrthoManager subclass using TSQR or DGKS.
Belos header file which uses auto-configuration information to include necessary C++ headers...
TSQR-based OrthoManager subclass.
Teuchos::RCP< Belos::MatOrthoManager< Scalar, MV, OP > > makeMatOrthoManager(const std::string &ortho, const Teuchos::RCP< const OP > &M, const Teuchos::RCP< OutputManager< Scalar > > &, const std::string &label, const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
Return an instance of the specified MatOrthoManager subclass.