Belos  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BelosRCGIter.hpp
Go to the documentation of this file.
1 //@HEADER
2 // ************************************************************************
3 //
4 // Belos: Block Linear Solvers Package
5 // Copyright 2004 Sandia Corporation
6 //
7 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
8 // the U.S. Government retains certain rights in this software.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
38 //
39 // ************************************************************************
40 //@HEADER
41 
42 #ifndef BELOS_RCG_ITER_HPP
43 #define BELOS_RCG_ITER_HPP
44 
49 #include "BelosConfigDefs.hpp"
50 #include "BelosTypes.hpp"
51 
52 #include "BelosLinearProblem.hpp"
53 #include "BelosMatOrthoManager.hpp"
54 #include "BelosOutputManager.hpp"
55 #include "BelosStatusTest.hpp"
56 #include "BelosOperatorTraits.hpp"
57 #include "BelosMultiVecTraits.hpp"
58 
59 #include "Teuchos_BLAS.hpp"
60 #include "Teuchos_LAPACK.hpp"
63 #include "Teuchos_ScalarTraits.hpp"
65 #include "Teuchos_TimeMonitor.hpp"
66 
67 // MLP Remove after debugging
68 #include <fstream>
69 #include <iomanip>
70 
82 namespace Belos {
83 
85 
86 
91  template <class ScalarType, class MV>
92  struct RCGIterState {
97  int curDim;
98 
101 
104 
107 
110 
112  bool existU;
113 
116 
123 
126 
131 
132 
133  RCGIterState() : curDim(0), P(Teuchos::null), Ap(Teuchos::null), r(Teuchos::null),
134  z(Teuchos::null),
135  existU(false),
136  U(Teuchos::null), AU(Teuchos::null),
137  Alpha(Teuchos::null), Beta(Teuchos::null), D(Teuchos::null), rTz_old(Teuchos::null),
138  Delta(Teuchos::null), LUUTAU(Teuchos::null), ipiv(Teuchos::null)
139  {}
140  };
141 
143 
145 
146 
158  class RCGIterInitFailure : public BelosError {public:
159  RCGIterInitFailure(const std::string& what_arg) : BelosError(what_arg)
160  {}};
161 
168  class RCGIterFailure : public BelosError {public:
169  RCGIterFailure(const std::string& what_arg) : BelosError(what_arg)
170  {}};
171 
178  class RCGIterOrthoFailure : public BelosError {public:
179  RCGIterOrthoFailure(const std::string& what_arg) : BelosError(what_arg)
180  {}};
181 
188  class RCGIterLAPACKFailure : public BelosError {public:
189  RCGIterLAPACKFailure(const std::string& what_arg) : BelosError(what_arg)
190  {}};
191 
193 
194 
195  template<class ScalarType, class MV, class OP>
196  class RCGIter : virtual public Iteration<ScalarType,MV,OP> {
197 
198  public:
199 
200  //
201  // Convenience typedefs
202  //
207 
209 
210 
219  const Teuchos::RCP<OutputManager<ScalarType> > &printer,
221  Teuchos::ParameterList &params );
222 
224  virtual ~RCGIter() {};
226 
227 
229 
230 
243  void iterate();
244 
259  void initialize(RCGIterState<ScalarType,MV> &newstate);
260 
264  void initialize()
265  {
267  initialize(empty);
268  }
269 
271 
273 
274 
276  int getNumIters() const { return iter_; }
277 
279  void resetNumIters( int iter = 0 ) { iter_ = iter; }
280 
283  Teuchos::RCP<const MV> getNativeResiduals( std::vector<MagnitudeType> *norms ) const { return r_; }
284 
286 
291  Teuchos::RCP<MV> getCurrentUpdate() const { return Teuchos::null; }
292 
294  int getCurSubspaceDim() const {
295  if (!initialized_) return 0;
296  return curDim_;
297  };
298 
300  int getMaxSubspaceDim() const { return numBlocks_+1; }
301 
303 
304 
306 
307 
309  const LinearProblem<ScalarType,MV,OP>& getProblem() const { return *lp_; }
310 
312  int getNumBlocks() const { return numBlocks_; }
313 
315  void setNumBlocks(int numBlocks) { setSize( recycleBlocks_, numBlocks ); };
316 
318  int getRecycledBlocks() const { return recycleBlocks_; }
319 
321  void setRecycledBlocks(int recycleBlocks) { setSize( recycleBlocks, numBlocks_ ); };
322 
324  int getBlockSize() const { return 1; }
325 
327  void setBlockSize(int blockSize) {
328  TEUCHOS_TEST_FOR_EXCEPTION(blockSize!=1,std::invalid_argument,
329  "Belos::RCGIter::setBlockSize(): Cannot use a block size that is not one.");
330  }
331 
333  void setSize( int recycleBlocks, int numBlocks );
334 
336  bool isInitialized() { return initialized_; }
337 
339 
340  private:
341 
342  //
343  // Internal methods
344  //
345 
346  //
347  // Classes input through constructor that define the linear problem to be solved.
348  //
352 
353  //
354  // Algorithmic parameters
355  //
356  // numBlocks_ is the size of the allocated space for the Krylov basis, in blocks.
357  int numBlocks_;
358 
359  // recycleBlocks_ is the size of the allocated space for the recycled subspace, in blocks.
360  int recycleBlocks_;
361 
362  //
363  // Current solver state
364  //
365  // initialized_ specifies that the basis vectors have been initialized and the iterate() routine
366  // is capable of running; _initialize is controlled by the initialize() member method
367  // For the implications of the state of initialized_, please see documentation for initialize()
368  bool initialized_;
369 
370  // Current subspace dimension, and number of iterations performed.
371  int curDim_, iter_;
372 
373  //
374  // State Storage
375  //
376  // Search vectors
377  Teuchos::RCP<MV> P_;
378  //
379  // A times current search vector
380  Teuchos::RCP<MV> Ap_;
381  //
382  // Residual vector
383  Teuchos::RCP<MV> r_;
384  //
385  // Preconditioned residual
386  Teuchos::RCP<MV> z_;
387  //
388  // Flag to indicate that the recycle space should be used
389  bool existU_;
390  // Recycled subspace and its image
391  Teuchos::RCP<MV> U_, AU_;
392  //
393  // Coefficients arising in RCG iteration
395  //
396  // Solutions to local least-squares problems
398  //
399  // The LU factorization of the matrix U^T A U
401  //
402  // Data from LU factorization of UTAU
404  //
405  // The scalar r'*z
407  };
408 
410  // Constructor.
411  template<class ScalarType, class MV, class OP>
413  const Teuchos::RCP<OutputManager<ScalarType> > &printer,
415  Teuchos::ParameterList &params ):
416  lp_(problem),
417  om_(printer),
418  stest_(tester),
419  numBlocks_(0),
420  recycleBlocks_(0),
421  initialized_(false),
422  curDim_(0),
423  iter_(0)
424  {
425  // Get the maximum number of blocks allowed for this Krylov subspace
426  TEUCHOS_TEST_FOR_EXCEPTION(!params.isParameter("Num Blocks"), std::invalid_argument,
427  "Belos::RCGIter::constructor: mandatory parameter \"Num Blocks\" is not specified.");
428  int nb = Teuchos::getParameter<int>(params, "Num Blocks");
429 
430  TEUCHOS_TEST_FOR_EXCEPTION(!params.isParameter("Recycled Blocks"), std::invalid_argument,
431  "Belos::RCGIter::constructor: mandatory parameter \"Recycled Blocks\" is not specified.");
432  int rb = Teuchos::getParameter<int>(params, "Recycled Blocks");
433 
434  // Set the number of blocks and allocate data
435  setSize( rb, nb );
436  }
437 
439  // Set the block size and make necessary adjustments.
440  template <class ScalarType, class MV, class OP>
441  void RCGIter<ScalarType,MV,OP>::setSize( int recycleBlocks, int numBlocks )
442  {
443 
444  TEUCHOS_TEST_FOR_EXCEPTION(numBlocks <= 0, std::invalid_argument, "Belos::RCGIter::setSize() was passed a non-positive argument for \"Num Blocks\".");
445  TEUCHOS_TEST_FOR_EXCEPTION(recycleBlocks <= 0, std::invalid_argument, "Belos::RCGIter::setSize() was passed a non-positive argument for \"Recycled Blocks\".");
446  TEUCHOS_TEST_FOR_EXCEPTION(recycleBlocks >= numBlocks, std::invalid_argument, "Belos::RCGIter::setSize() the number of recycled blocks is larger than the allowable subspace.");
447 
448  numBlocks_ = numBlocks;
449  recycleBlocks_ = recycleBlocks;
450 
451  }
452 
454  // Initialize this iteration object
455  template <class ScalarType, class MV, class OP>
457  {
458 
459  if (newstate.P != Teuchos::null &&
460  newstate.Ap != Teuchos::null &&
461  newstate.r != Teuchos::null &&
462  newstate.z != Teuchos::null &&
463  newstate.U != Teuchos::null &&
464  newstate.AU != Teuchos::null &&
465  newstate.Alpha != Teuchos::null &&
466  newstate.Beta != Teuchos::null &&
467  newstate.D != Teuchos::null &&
468  newstate.Delta != Teuchos::null &&
469  newstate.LUUTAU != Teuchos::null &&
470  newstate.ipiv != Teuchos::null &&
471  newstate.rTz_old != Teuchos::null) {
472 
473  curDim_ = newstate.curDim;
474  P_ = newstate.P;
475  Ap_ = newstate.Ap;
476  r_ = newstate.r;
477  z_ = newstate.z;
478  existU_ = newstate.existU;
479  U_ = newstate.U;
480  AU_ = newstate.AU;
481  Alpha_ = newstate.Alpha;
482  Beta_ = newstate.Beta;
483  D_ = newstate.D;
484  Delta_ = newstate.Delta;
485  LUUTAU_ = newstate.LUUTAU;
486  ipiv_ = newstate.ipiv;
487  rTz_old_ = newstate.rTz_old;
488  }
489  else {
490 
491  TEUCHOS_TEST_FOR_EXCEPTION(newstate.P == Teuchos::null,std::invalid_argument,
492  "Belos::RCGIter::initialize(): RCGIterState does not have P initialized.");
493 
494  TEUCHOS_TEST_FOR_EXCEPTION(newstate.Ap == Teuchos::null,std::invalid_argument,
495  "Belos::RCGIter::initialize(): RCGIterState does not have Ap initialized.");
496 
497  TEUCHOS_TEST_FOR_EXCEPTION(newstate.r == Teuchos::null,std::invalid_argument,
498  "Belos::RCGIter::initialize(): RCGIterState does not have r initialized.");
499 
500  TEUCHOS_TEST_FOR_EXCEPTION(newstate.z == Teuchos::null,std::invalid_argument,
501  "Belos::RCGIter::initialize(): RCGIterState does not have z initialized.");
502 
503  TEUCHOS_TEST_FOR_EXCEPTION(newstate.U == Teuchos::null,std::invalid_argument,
504  "Belos::RCGIter::initialize(): RCGIterState does not have U initialized.");
505 
506  TEUCHOS_TEST_FOR_EXCEPTION(newstate.AU == Teuchos::null,std::invalid_argument,
507  "Belos::RCGIter::initialize(): RCGIterState does not have AU initialized.");
508 
509  TEUCHOS_TEST_FOR_EXCEPTION(newstate.Alpha == Teuchos::null,std::invalid_argument,
510  "Belos::RCGIter::initialize(): RCGIterState does not have Alpha initialized.");
511 
512  TEUCHOS_TEST_FOR_EXCEPTION(newstate.Beta == Teuchos::null,std::invalid_argument,
513  "Belos::RCGIter::initialize(): RCGIterState does not have Beta initialized.");
514 
515  TEUCHOS_TEST_FOR_EXCEPTION(newstate.D == Teuchos::null,std::invalid_argument,
516  "Belos::RCGIter::initialize(): RCGIterState does not have D initialized.");
517 
518  TEUCHOS_TEST_FOR_EXCEPTION(newstate.Delta == Teuchos::null,std::invalid_argument,
519  "Belos::RCGIter::initialize(): RCGIterState does not have Delta initialized.");
520 
521  TEUCHOS_TEST_FOR_EXCEPTION(newstate.LUUTAU == Teuchos::null,std::invalid_argument,
522  "Belos::RCGIter::initialize(): RCGIterState does not have LUUTAU initialized.");
523 
524  TEUCHOS_TEST_FOR_EXCEPTION(newstate.ipiv == Teuchos::null,std::invalid_argument,
525  "Belos::RCGIter::initialize(): RCGIterState does not have ipiv initialized.");
526 
527  TEUCHOS_TEST_FOR_EXCEPTION(newstate.rTz_old == Teuchos::null,std::invalid_argument,
528  "Belos::RCGIter::initialize(): RCGIterState does not have rTz_old initialized.");
529 
530  }
531 
532  // the solver is initialized
533  initialized_ = true;
534 
535  }
536 
538  // Iterate until the status test informs us we should stop.
539  template <class ScalarType, class MV, class OP>
541  {
542  TEUCHOS_TEST_FOR_EXCEPTION( initialized_ == false, RCGIterFailure,
543  "Belos::RCGIter::iterate(): RCGIter class not initialized." );
544 
545  // We'll need LAPACK
547 
548  // Create convenience variables for zero and one.
549  ScalarType one = Teuchos::ScalarTraits<ScalarType>::one();
550  ScalarType zero = Teuchos::ScalarTraits<ScalarType>::zero();
551 
552  // Allocate memory for scalars
553  std::vector<int> index(1);
555 
556  // Get the current solution std::vector.
557  Teuchos::RCP<MV> cur_soln_vec = lp_->getCurrLHSVec();
558 
559  // Check that the current solution std::vector only has one column.
560  TEUCHOS_TEST_FOR_EXCEPTION( MVT::GetNumberVecs(*cur_soln_vec) != 1, RCGIterFailure,
561  "Belos::RCGIter::iterate(): current linear system has more than one std::vector!" );
562 
563  // Compute the current search dimension.
564  int searchDim = numBlocks_+1;
565 
566  // index of iteration within current cycle
567  int i_ = 0;
568 
570  // iterate until the status test tells us to stop.
571  //
572  // also break if our basis is full
573  //
574  Teuchos::RCP<const MV> p_ = Teuchos::null;
575  Teuchos::RCP<MV> pnext_ = Teuchos::null;
576  while (stest_->checkStatus(this) != Passed && curDim_+1 <= searchDim) {
577 
578  // Ap = A*p;
579  index.resize( 1 );
580  index[0] = i_;
581  p_ = MVT::CloneView( *P_, index );
582  lp_->applyOp( *p_, *Ap_ );
583 
584  // d = p'*Ap;
585  MVT::MvTransMv( one, *p_, *Ap_, pAp );
586  (*D_)(i_,0) = pAp(0,0);
587 
588  // alpha = rTz_old / pAp
589  (*Alpha_)(i_,0) = (*rTz_old_)(0,0) / pAp(0,0);
590 
591  // Check that alpha is a positive number
592  TEUCHOS_TEST_FOR_EXCEPTION( SCT::real(pAp(0,0)) <= zero, RCGIterFailure, "Belos::RCGIter::iterate(): non-positive value for p^H*A*p encountered!" );
593 
594  // x = x + (alpha * p);
595  MVT::MvAddMv( one, *cur_soln_vec, (*Alpha_)(i_,0), *p_, *cur_soln_vec );
596  lp_->updateSolution();
597 
598  // r = r - (alpha * Ap);
599  MVT::MvAddMv( one, *r_, -(*Alpha_)(i_,0), *Ap_, *r_ );
600 
601  std::vector<MagnitudeType> norm(1);
602  MVT::MvNorm( *r_, norm );
603 //printf("i = %i\tnorm(r) = %e\n",i_,norm[0]);
604 
605  // z = M\r
606  if ( lp_->getLeftPrec() != Teuchos::null ) {
607  lp_->applyLeftPrec( *r_, *z_ );
608  }
609  else if ( lp_->getRightPrec() != Teuchos::null ) {
610  lp_->applyRightPrec( *r_, *z_ );
611  }
612  else {
613  z_ = r_;
614  }
615 
616  // rTz_new = r'*z;
617  MVT::MvTransMv( one, *r_, *z_, rTz );
618 
619  // beta = rTz_new/rTz_old;
620  (*Beta_)(i_,0) = rTz(0,0) / (*rTz_old_)(0,0);
621 
622  // rTz_old = rTz_new;
623  (*rTz_old_)(0,0) = rTz(0,0);
624 
625  // get pointer for next p
626  index.resize( 1 );
627  index[0] = i_+1;
628  pnext_ = MVT::CloneViewNonConst( *P_, index );
629 
630  if (existU_) {
631  // mu = UTAU \ (AU'*z);
632  Teuchos::SerialDenseMatrix<int,ScalarType> mu( Teuchos::View, *Delta_, recycleBlocks_, 1, 0, i_ );
633  MVT::MvTransMv( one, *AU_, *z_, mu );
634  char TRANS = 'N';
635  int info;
636  lapack.GETRS( TRANS, recycleBlocks_, 1, LUUTAU_->values(), LUUTAU_->stride(), &(*ipiv_)[0], mu.values(), mu.stride(), &info );
638  "Belos::RCGIter::solve(): LAPACK GETRS failed to compute a solution.");
639  // p = -(U*mu) + (beta*p) + z (in two steps)
640  // p = (beta*p) + z;
641  MVT::MvAddMv( (*Beta_)(i_,0), *p_, one, *z_, *pnext_ );
642  // pnext = -(U*mu) + (one)*pnext;
643  MVT::MvTimesMatAddMv( -one, *U_, mu, one, *pnext_ );
644  }
645  else {
646  // p = (beta*p) + z;
647  MVT::MvAddMv( (*Beta_)(i_,0), *p_, one, *z_, *pnext_ );
648  }
649 
650  // Done with this view; release pointer
651  p_ = Teuchos::null;
652  pnext_ = Teuchos::null;
653 
654  // increment iteration count and dimension index
655  i_++;
656  iter_++;
657  curDim_++;
658 
659  } // end while (statusTest == false)
660 
661  }
662 
663 } // end Belos namespace
664 
665 #endif /* BELOS_RCG_ITER_HPP */
ScalarType * values() const
Teuchos::RCP< MV > r
The current residual.
Collection of types and exceptions used within the Belos solvers.
Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > rTz_old
Belos&#39;s basic output manager for sending information of select verbosity levels to the appropriate ou...
Teuchos::RCP< MV > P
The current Krylov basis.
Teuchos::RCP< std::vector< int > > ipiv
Data from LU factorization of U^T A U.
Class which manages the output and verbosity of the Belos solvers.
void setNumBlocks(int numBlocks)
Set the maximum number of blocks used by the iterative solver.
RCGIterOrthoFailure(const std::string &what_arg)
Teuchos::RCP< MV > AU
int getNumBlocks() const
Get the maximum number of blocks used by the iterative solver in solving this linear problem...
RCGIterFailure is thrown when the RCGIter object is unable to compute the next iterate in the RCGIter...
RCGIterOrthoFailure is thrown when the RCGIter object is unable to compute independent direction vect...
Teuchos::RCP< MV > getCurrentUpdate() const
Get the current update to the linear system.
Pure virtual base class for defining the status testing capabilities of Belos.
Teuchos::RCP< MV > U
The recycled subspace and its image.
Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > LUUTAU
The LU factorization of the matrix U^T A U.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > Beta
Declaration of basic traits for the multivector type.
This class implements the RCG iteration, where a single-std::vector Krylov subspace is constructed...
int getRecycledBlocks() const
Get the maximum number of recycled blocks used by the iterative solver in solving this linear problem...
void GETRS(const char TRANS, const OrdinalType n, const OrdinalType nrhs, const ScalarType *A, const OrdinalType lda, const OrdinalType *IPIV, ScalarType *B, const OrdinalType ldb, OrdinalType *info) const
int getMaxSubspaceDim() const
Get the maximum dimension allocated for the search subspace.
const LinearProblem< ScalarType, MV, OP > & getProblem() const
Get a constant reference to the linear problem.
OperatorTraits< ScalarType, MV, OP > OPT
int getNumIters() const
Get the current iteration count.
A pure virtual class for defining the status tests for the Belos iterative solvers.
Class which defines basic traits for the operator type.
MultiVecTraits< ScalarType, MV > MVT
virtual ~RCGIter()
Destructor.
RCGIterLAPACKFailure(const std::string &what_arg)
Traits class which defines basic operations on multivectors.
void setSize(int recycleBlocks, int numBlocks)
Set the maximum number of blocks used by the iterative solver and the number of recycled vectors...
bool isParameter(const std::string &name) const
Structure to contain pointers to RCGIter state variables.
bool existU
Flag to indicate the recycle space should be used.
Teuchos::RCP< const MV > getNativeResiduals(std::vector< MagnitudeType > *norms) const
Get the norms of the residuals native to the solver.
Teuchos::RCP< MV > z
The current preconditioned residual.
Teuchos::RCP< MV > Ap
A times current search vector.
RCGIterInitFailure(const std::string &what_arg)
RCGIter(const Teuchos::RCP< LinearProblem< ScalarType, MV, OP > > &problem, const Teuchos::RCP< OutputManager< ScalarType > > &printer, const Teuchos::RCP< StatusTest< ScalarType, MV, OP > > &tester, Teuchos::ParameterList &params)
RCGIter constructor with linear problem, solver utilities, and parameter list of solver options...
int getBlockSize() const
Get the blocksize to be used by the iterative solver in solving this linear problem.
A linear system to solve, and its associated information.
Class which describes the linear problem to be solved by the iterative solver.
RCGIterFailure(const std::string &what_arg)
Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > Alpha
Coefficients arising in RCG iteration.
RCGIterInitFailure is thrown when the RCGIter object is unable to generate an initial iterate in the ...
int getCurSubspaceDim() const
Get the dimension of the search subspace used to generate the current solution to the linear problem...
int curDim
The current dimension of the reduction.
void setRecycledBlocks(int recycleBlocks)
Set the maximum number of recycled blocks used by the iterative solver.
void initialize()
Initialize the solver with the initial vectors from the linear problem or random data.
Class which defines basic traits for the operator type.
Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > D
void iterate()
This method performs RCG iterations until the status test indicates the need to stop or an error occu...
Parent class to all Belos exceptions.
Definition: BelosTypes.hpp:60
void resetNumIters(int iter=0)
Reset the iteration count.
RCGIterLAPACKFailure is thrown when a nonzero return value is passed back from an LAPACK routine...
void setBlockSize(int blockSize)
Set the blocksize.
Belos header file which uses auto-configuration information to include necessary C++ headers...
Teuchos::ScalarTraits< ScalarType > SCT
bool isInitialized()
States whether the solver has been initialized or not.
Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > Delta
Solutions to local least-squares problems.
OrdinalType stride() const
Templated virtual class for providing orthogonalization/orthonormalization methods with matrix-based ...
SCT::magnitudeType MagnitudeType