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>
90 #ifdef HAVE_BELOS_TSQR 94 #endif // HAVE_BELOS_TSQR 103 #ifdef HAVE_BELOS_TSQR 105 return (name ==
"TSQR");
108 #endif // HAVE_BELOS_TSQR 118 #ifdef HAVE_BELOS_TSQR 120 #endif // HAVE_BELOS_TSQR 132 const std::vector<std::string>&
147 TEUCHOS_TEST_FOR_EXCEPTION(numValid <= 0, std::logic_error,
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;
189 Teuchos::RCP<const Teuchos::ParameterList>
192 if (name ==
"DGKS") {
196 #ifdef HAVE_BELOS_TSQR 197 else if (name ==
"TSQR") {
201 #endif // HAVE_BELOS_TSQR 202 else if (name ==
"ICGS") {
206 else if (name ==
"IMGS") {
210 else if (name ==
"Simple") {
215 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
216 "Invalid orthogonalization manager name \"" << name
218 <<
". For many of the test executables, the " 219 "orthogonalization manager name often corresponds " 220 "to the \"ortho\" command-line argument.");
223 return Teuchos::null;
240 Teuchos::RCP<const Teuchos::ParameterList>
243 if (name ==
"DGKS") {
247 #ifdef HAVE_BELOS_TSQR 248 else if (name ==
"TSQR") {
252 #endif // HAVE_BELOS_TSQR 253 else if (name ==
"ICGS") {
257 else if (name ==
"IMGS") {
261 else if (name ==
"Simple") {
266 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
267 "Invalid orthogonalization manager name \"" << name
269 <<
". For many of the test executables, the " 270 "orthogonalization manager name often corresponds " 271 "to the \"ortho\" command-line argument.");
274 return Teuchos::null;
297 Teuchos::RCP<Belos::MatOrthoManager<Scalar, MV, OP> >
299 const Teuchos::RCP<const OP>& M,
301 const std::string& label,
302 const Teuchos::RCP<Teuchos::ParameterList>& params)
304 #ifdef HAVE_BELOS_TSQR 306 #endif // HAVE_BELOS_TSQR 313 if (ortho ==
"DGKS") {
315 return rcp (
new dgks_type (params, label, M));
317 #ifdef HAVE_BELOS_TSQR 318 else if (ortho ==
"TSQR") {
320 return rcp (
new ortho_type (params, label, M));
322 #endif // HAVE_BELOS_TSQR 323 else if (ortho ==
"ICGS") {
325 return rcp (
new ortho_type (params, label, M));
327 else if (ortho ==
"IMGS") {
329 return rcp (
new ortho_type (params, label, M));
331 else if (ortho ==
"Simple") {
332 TEUCHOS_TEST_FOR_EXCEPTION(ortho ==
"Simple", std::logic_error,
333 "SimpleOrthoManager does not yet support " 334 "the MatOrthoManager interface");
336 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
337 "Invalid orthogonalization manager name: Valid names" 339 "the test executables, the orthogonalization manager" 340 " name often corresponds to the \"ortho\" command-" 342 return Teuchos::null;
361 Teuchos::RCP<Belos::OrthoManager<Scalar, MV> >
363 const Teuchos::RCP<const OP>& M,
365 const std::string& label,
366 const Teuchos::RCP<Teuchos::ParameterList>& params)
368 #ifdef HAVE_BELOS_TSQR 370 #endif // HAVE_BELOS_TSQR 373 if (ortho ==
"Simple") {
374 TEUCHOS_TEST_FOR_EXCEPTION(! M.is_null(), std::logic_error,
375 "SimpleOrthoManager is not yet supported " 376 "when the operator M is nontrivial (i.e., " 380 #ifdef HAVE_BELOS_TSQR 389 else if (ortho ==
"TSQR" && M.is_null()) {
392 #endif // HAVE_BELOS_TSQR 402 #endif // __Belos_OrthoManagerFactory_hpp Belos's basic output manager for sending information of select verbosity levels to the appropriate ou...
const std::vector< std::string > & validNames() const
List of MatOrthoManager subclasses this factory recognizes.
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.
Teuchos::RCP< const Teuchos::ParameterList > getFastParameters() const
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.
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
Get default parameters for TsqrMatOrthoManager.
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
static int numOrthoManagers()
Number of MatOrthoManager subclasses this factory recognizes.
std::ostream & printValidNames(std::ostream &out) const
Print all recognized MatOrthoManager names to the given ostream.
Teuchos::RCP< const Teuchos::ParameterList > getFastParameters() const
"Fast" but possibly unsafe or less accurate parameters.
Iterated Modified Gram-Schmidt (IMGS) implementation of the Belos::OrthoManager class.
Simple OrthoManager implementation for benchmarks.
Teuchos::RCP< Belos::MatOrthoManager< Scalar, MV, OP > > makeMatOrthoManager(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 MatOrthoManager subclass.
OrthoManagerFactory()
Constructor.
std::string validNamesString() const
List (as a string) of recognized MatOrthoManager names.
std::vector< std::string > theList_
List of valid OrthoManager names.
Classical Gram-Schmidt (with DGKS correction) implementation of the Belos::OrthoManager class...
Simple OrthoManager implementation for benchmarks.
const std::string & defaultName() const
Name of the "default" MatOrthoManager subclass.
Teuchos::RCP< const Teuchos::ParameterList > getDefaultParameters(const std::string &name) const
Default parameters for the given MatOrthoManager subclass.
Enumeration of all valid Belos (Mat)OrthoManager classes.
Teuchos::RCP< const Teuchos::ParameterList > getFastParameters(const std::string &name) const
"Fast" parameters for the given MatOrthoManager subclass.
bool isValidName(const std::string &name) const
Whether this factory recognizes the MatOrthoManager with the given name.
Iterated Classical Gram-Schmidt (ICGS) implementation of the Belos::OrthoManager class.
An implementation of the Belos::MatOrthoManager that performs orthogonalization using multiple steps ...
Teuchos::RCP< const Teuchos::ParameterList > getFastParameters() const
"Fast" but possibly unsafe or less accurate parameters.
An implementation of the Belos::MatOrthoManager that performs orthogonalization using multiple steps ...
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
An implementation of the Belos::MatOrthoManager that performs orthogonalization using (potentially) m...
Orthogonalization manager based on Tall Skinny QR (TSQR)
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< const Teuchos::ParameterList > getValidParameters() const