ROL
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ROL::Sketch< Real > Class Template Reference

Provides an interface for randomized sketching. More...

#include <ROL_Sketch.hpp>

Public Member Functions

virtual ~Sketch (void)
 
 Sketch (const Vector< Real > &x, int ncol, int rank, Real orthTol=1e-8, int orthIt=2, bool truncate=false, unsigned dom_seed=0, unsigned rng_seed=0)
 
void setStream (Ptr< std::ostream > &out)
 
void reset (bool randomize=true)
 
void setRank (int rank)
 
void update (void)
 
int advance (Real nu, const Vector< Real > &h, int col, Real eta=1.0)
 
int reconstruct (Vector< Real > &a, const int col)
 
bool test (const int rank, std::ostream &outStream=std::cout, const int verbosity=0)
 

Private Member Functions

void mgs2 (std::vector< Ptr< Vector< Real > > > &Y) const
 
int LSsolver (LA::Matrix< Real > &A, LA::Matrix< Real > &B, bool trans=false) const
 
int lowRankApprox (LA::Matrix< Real > &A, int r) const
 
int computeP (void)
 
int computeQ (void)
 
int computeC (void)
 
bool testQ (std::ostream &outStream=std::cout, const int verbosity=0)
 
bool testP (std::ostream &outStream=std::cout, const int verbosity=0)
 

Private Attributes

std::vector< Ptr< Vector< Real > > > Y_
 
LA::Matrix< Real > X_
 
LA::Matrix< Real > Z_
 
LA::Matrix< Real > C_
 
std::vector< Ptr< Vector< Real > > > Upsilon_
 
std::vector< Ptr< Vector< Real > > > Phi_
 
LA::Matrix< Real > Omega_
 
LA::Matrix< Real > Psi_
 
int maxRank_
 
int ncol_
 
int rank_
 
int k_
 
int s_
 
const Real orthTol_
 
const int orthIt_
 
const bool truncate_
 
LAPACK< int, Real > lapack_
 
bool flagP_
 
bool flagQ_
 
bool flagC_
 
Ptr< std::ostream > out_
 
Ptr< Elementwise::NormalRandom< Real > > nrand_
 
Ptr< std::mt19937_64 > gen_
 
Ptr< std::normal_distribution< Real > > dist_
 

Detailed Description

template<class Real>
class ROL::Sketch< Real >

Provides an interface for randomized sketching.


Definition at line 31 of file ROL_Sketch.hpp.

Constructor & Destructor Documentation

◆ ~Sketch()

template<class Real >
virtual ROL::Sketch< Real >::~Sketch ( void  )
inlinevirtual

Definition at line 209 of file ROL_Sketch.hpp.

◆ Sketch()

template<class Real >
ROL::Sketch< Real >::Sketch ( const Vector< Real > &  x,
int  ncol,
int  rank,
Real  orthTol = 1e-8,
int  orthIt = 2,
bool  truncate = false,
unsigned  dom_seed = 0,
unsigned  rng_seed = 0 
)
inline

Member Function Documentation

◆ mgs2()

template<class Real >
void ROL::Sketch< Real >::mgs2 ( std::vector< Ptr< Vector< Real > > > &  Y) const
inlineprivate

◆ LSsolver()

template<class Real >
int ROL::Sketch< Real >::LSsolver ( LA::Matrix< Real > &  A,
LA::Matrix< Real > &  B,
bool  trans = false 
) const
inlineprivate

Definition at line 89 of file ROL_Sketch.hpp.

References ROL::Sketch< Real >::lapack_.

Referenced by ROL::Sketch< Real >::computeC().

◆ lowRankApprox()

template<class Real >
int ROL::Sketch< Real >::lowRankApprox ( LA::Matrix< Real > &  A,
int  r 
) const
inlineprivate

Definition at line 109 of file ROL_Sketch.hpp.

References ROL::Sketch< Real >::lapack_, and zero.

Referenced by ROL::Sketch< Real >::computeC().

◆ computeP()

template<class Real >
int ROL::Sketch< Real >::computeP ( void  )
inlineprivate

◆ computeQ()

template<class Real >
int ROL::Sketch< Real >::computeQ ( void  )
inlineprivate

◆ computeC()

template<class Real >
int ROL::Sketch< Real >::computeC ( void  )
inlineprivate

◆ setStream()

template<class Real >
void ROL::Sketch< Real >::setStream ( Ptr< std::ostream > &  out)
inline

Definition at line 239 of file ROL_Sketch.hpp.

References ROL::Sketch< Real >::out_.

◆ reset()

template<class Real >
void ROL::Sketch< Real >::reset ( bool  randomize = true)
inline

◆ setRank()

template<class Real >
void ROL::Sketch< Real >::setRank ( int  rank)
inline

◆ update()

template<class Real >
void ROL::Sketch< Real >::update ( void  )
inline

Definition at line 288 of file ROL_Sketch.hpp.

References ROL::Sketch< Real >::reset().

Referenced by ROL::Sketch< Real >::test().

◆ advance()

template<class Real >
int ROL::Sketch< Real >::advance ( Real  nu,
const Vector< Real > &  h,
int  col,
Real  eta = 1.0 
)
inline

◆ reconstruct()

template<class Real >
int ROL::Sketch< Real >::reconstruct ( Vector< Real > &  a,
const int  col 
)
inline

◆ test()

template<class Real >
bool ROL::Sketch< Real >::test ( const int  rank,
std::ostream &  outStream = std::cout,
const int  verbosity = 0 
)
inline

◆ testQ()

template<class Real >
bool ROL::Sketch< Real >::testQ ( std::ostream &  outStream = std::cout,
const int  verbosity = 0 
)
inlineprivate

◆ testP()

template<class Real >
bool ROL::Sketch< Real >::testP ( std::ostream &  outStream = std::cout,
const int  verbosity = 0 
)
inlineprivate

Member Data Documentation

◆ Y_

template<class Real >
std::vector<Ptr<Vector<Real> > > ROL::Sketch< Real >::Y_
private

◆ X_

template<class Real >
LA::Matrix<Real> ROL::Sketch< Real >::X_
private

◆ Z_

template<class Real >
LA::Matrix<Real> ROL::Sketch< Real >::Z_
private

◆ C_

template<class Real >
LA::Matrix<Real> ROL::Sketch< Real >::C_
private

◆ Upsilon_

template<class Real >
std::vector<Ptr<Vector<Real> > > ROL::Sketch< Real >::Upsilon_
private

◆ Phi_

template<class Real >
std::vector<Ptr<Vector<Real> > > ROL::Sketch< Real >::Phi_
private

◆ Omega_

template<class Real >
LA::Matrix<Real> ROL::Sketch< Real >::Omega_
private

◆ Psi_

template<class Real >
LA::Matrix<Real> ROL::Sketch< Real >::Psi_
private

◆ maxRank_

template<class Real >
int ROL::Sketch< Real >::maxRank_
private

Definition at line 41 of file ROL_Sketch.hpp.

Referenced by ROL::Sketch< Real >::setRank(), and ROL::Sketch< Real >::Sketch().

◆ ncol_

template<class Real >
int ROL::Sketch< Real >::ncol_
private

◆ rank_

template<class Real >
int ROL::Sketch< Real >::rank_
private

◆ k_

template<class Real >
int ROL::Sketch< Real >::k_
private

◆ s_

template<class Real >
int ROL::Sketch< Real >::s_
private

◆ orthTol_

template<class Real >
const Real ROL::Sketch< Real >::orthTol_
private

Definition at line 43 of file ROL_Sketch.hpp.

Referenced by ROL::Sketch< Real >::mgs2().

◆ orthIt_

template<class Real >
const int ROL::Sketch< Real >::orthIt_
private

Definition at line 44 of file ROL_Sketch.hpp.

Referenced by ROL::Sketch< Real >::mgs2().

◆ truncate_

template<class Real >
const bool ROL::Sketch< Real >::truncate_
private

Definition at line 46 of file ROL_Sketch.hpp.

Referenced by ROL::Sketch< Real >::computeC().

◆ lapack_

template<class Real >
LAPACK<int,Real> ROL::Sketch< Real >::lapack_
private

◆ flagP_

template<class Real >
bool ROL::Sketch< Real >::flagP_
private

◆ flagQ_

template<class Real >
bool ROL::Sketch< Real >::flagQ_
private

◆ flagC_

template<class Real >
bool ROL::Sketch< Real >::flagC_
private

◆ out_

template<class Real >
Ptr<std::ostream> ROL::Sketch< Real >::out_
private

◆ nrand_

template<class Real >
Ptr<Elementwise::NormalRandom<Real> > ROL::Sketch< Real >::nrand_
private

Definition at line 54 of file ROL_Sketch.hpp.

Referenced by ROL::Sketch< Real >::reset(), and ROL::Sketch< Real >::Sketch().

◆ gen_

template<class Real >
Ptr<std::mt19937_64> ROL::Sketch< Real >::gen_
private

Definition at line 55 of file ROL_Sketch.hpp.

Referenced by ROL::Sketch< Real >::Sketch().

◆ dist_

template<class Real >
Ptr<std::normal_distribution<Real> > ROL::Sketch< Real >::dist_
private

Definition at line 56 of file ROL_Sketch.hpp.

Referenced by ROL::Sketch< Real >::Sketch().


The documentation for this class was generated from the following file: