51 #include "ROL_LAPACK.hpp"
66 template <
typename T>
using ROL::Ptr = ROL::Ptr<T>;
67 template <
typename T>
using vector = std::vector<T>;
74 typedef ROL::ParameterList
PL;
129 Q_.push_back(b.clone());
152 PL &krylovList = parlist.sublist(
"General").sublist(
"Krylov");
153 PL &lanczosList = krylovList.sublist(
"Lanczos");
155 Real tol_default = std::sqrt(ROL_EPSILON<Real>());
157 maxit_ = krylovList_.get(
"Iteration Limit",10);
158 tol_beta_ = lanczosList.get(
"Beta Relative Tolerance", tol_default);
159 tol_ortho_ = lanczosList.get(
"Orthogonality Tolerance", tol_default);
185 void reset(
const V &x0,
const V &b,
const LO &A, Real &tol ) {
190 Q_[0]->axpy(-1.0,*
u_);
199 return ITERATE_MAX_REACHED;
212 delta =
u_->dot(*(V_[k-1]));
213 u_->axpy(-delta,*(V_[k-1]));
215 delta =
u_->dot(*(V_[k]));
219 u_->axpy(-delta,*(V_[k_]));
223 return ITERATE_SMALL_BETA;
227 V_[k+1]->scale(1.0/
beta_[k+1]);
230 Real dotprod = V_[k+1]->dot(*(V_[0]));
233 return ITERATE_ORTHO_TOL;
238 return ITERATE_SUCCESS;
244 std::vector<Real> Z(1,0);
248 const char COMPZ =
'N':
255 return SOLVE_ILLEGAL_VALUE;
257 else if( INFO > 0 ) {
258 return SOLVE_SINGULAR_U;
265 const char TRANS =
'N';
282 lapack_->GTTRS(TRANS,k_,1,&dl[0],&
d_[0],&
du_[0],&
du2_[0],&
ipiv_[0],&
y_[0],k_,&INFO);
291 #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)