17#include "ROL_LAPACK.hpp"
32 template <
typename T>
using ROL::Ptr = ROL::Ptr<T>;
33 template <
typename T>
using vector = std::vector<T>;
40 typedef ROL::ParameterList
PL;
95 Q_.push_back(b.clone());
118 PL &krylovList = parlist.sublist(
"General").sublist(
"Krylov");
119 PL &lanczosList = krylovList.sublist(
"Lanczos");
121 Real tol_default = std::sqrt(ROL_EPSILON<Real>());
123 maxit_ = krylovList_.get(
"Iteration Limit",10);
124 tol_beta_ = lanczosList.get(
"Beta Relative Tolerance", tol_default);
125 tol_ortho_ = lanczosList.get(
"Orthogonality Tolerance", tol_default);
151 void reset(
const V &x0,
const V &b,
const LO &A, Real &tol ) {
156 Q_[0]->axpy(-1.0,*
u_);
178 delta =
u_->dot(*(V_[k-1]));
179 u_->axpy(-delta,*(V_[k-1]));
181 delta =
u_->dot(*(V_[k]));
185 u_->axpy(-delta,*(V_[
k_]));
193 V_[k+1]->scale(1.0/
beta_[k+1]);
196 Real dotprod = V_[k+1]->dot(*(V_[0]));
210 std::vector<Real> Z(1,0);
214 const char COMPZ =
'N':
223 else if( INFO > 0 ) {
231 const char TRANS =
'N';
248 lapack_->GTTRS(TRANS,
k_,1,&dl[0],&
d_[0],&
du_[0],&
du2_[0],&
ipiv_[0],&
y_[0],
k_,&INFO);
typename PV< Real >::size_type size_type
Contains definitions of custom data types in ROL.
Interface for computing the Lanczos vectors and approximate solutions to symmetric indefinite linear ...
template vector< Real > size_type uint
FLAG_SOLVE solve(V &x, Real tau=0)
vector< ROL::Ptr< V > > Q_
void reset(const V &x0, const V &b, const LO &A, Real &tol)
void eigenvalues(std::vector< Real > &E)
ROL::LAPACK< int, Real > lapack_
void initialize(const V &b)
void initialize(const V &x0, const V &b, const LO &A, Real &tol)
FLAG_ITERATE iterate(const OP &A, Real &tol)
Lanczos(ROL::ParameterList &PL)
LinearOperator< Real > OP
Provides the interface to apply a linear operator.
virtual void apply(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const =0
Apply linear operator.
Defines the linear algebra or vector space interface.