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_);
165 return ITERATE_MAX_REACHED;
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_]));
189 return ITERATE_SMALL_BETA;
193 V_[k+1]->scale(1.0/
beta_[k+1]);
196 Real dotprod = V_[k+1]->dot(*(V_[0]));
199 return ITERATE_ORTHO_TOL;
204 return ITERATE_SUCCESS;
210 std::vector<Real> Z(1,0);
214 const char COMPZ =
'N':
221 return SOLVE_ILLEGAL_VALUE;
223 else if( INFO > 0 ) {
224 return SOLVE_SINGULAR_U;
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);
257 #endif // ROL_LANCZOS_H
void reset(const V &x0, const V &b, const LO &A, Real &tol)
typename PV< Real >::size_type size_type
FLAG_SOLVE solve(V &x, Real tau=0)
ROL::LAPACK< int, Real > lapack_
Contains definitions of custom data types in ROL.
LinearOperator< Real > OP
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.
FLAG_ITERATE iterate(const OP &A, Real &tol)
Interface for computing the Lanczos vectors and approximate solutions to symmetric indefinite linear ...
Lanczos(ROL::ParameterList &PL)
Provides the interface to apply a linear operator.
vector< ROL::Ptr< V > > Q_
void initialize(const V &b)
template vector< Real > size_type uint
void initialize(const V &x0, const V &b, const LO &A, Real &tol)
void eigenvalues(std::vector< Real > &E)