MADNESS  version 0.9
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
madness::SRConf< T > Class Template Reference

#include <srconf.h>

Collaboration diagram for madness::SRConf< T >:
Collaboration graph
[legend]

Public Types

typedef Tensor< T > tensorT
 

Public Member Functions

 SRConf ()
 default ctor More...
 
 SRConf (const unsigned int &dim, const unsigned int &k, const TensorType &tt)
 ctor with dimensions for a vector configuration (tested) More...
 
 SRConf (const SRConf &rhs)
 copy ctor (tested); shallow copy More...
 
 SRConf (const Tensor< double > &weights, const std::vector< Tensor< T > > &vectors, const unsigned int &dim, const unsigned int maxk, const TensorType &tt)
 ctor with provided weights and effective vectors; shallow copy More...
 
 SRConf (const tensorT &vector1)
 explicit ctor with one vector (aka full representation), shallow More...
 
 SRConf (const Tensor< double > &weights, const tensorT &vector1, const tensorT &vector2, const unsigned int &dim, const unsigned int maxk)
 explicit ctor with two vectors (aka SVD), shallow More...
 
SRConfoperator= (const SRConf &rhs)
 assignment operator (tested), shallow copy of vectors More...
 
const SRConf get_configs (const int &start, const int &end) const
 
 ~SRConf ()
 dtor More...
 
template<typename Archive >
void serialize (Archive &ar)
 
TensorType type () const
 return the tensor type More...
 
bool has_data () const
 does this have any data? More...
 
void orthonormalize (const double &thresh)
 orthonormalize this More...
 
Tensor< T > & ref_vector (const unsigned int &idim)
 return reference to one of the vectors F More...
 
const Tensor< T > & ref_vector (const unsigned int &idim) const
 return reference to one of the vectors F More...
 
bool has_structure () const
 return if this has a tensor structure (has not been flattened) More...
 
int dim_per_vector () const
 return the number of physical dimensions More...
 
double weights (const unsigned int &i) const
 return the weight More...
 

Static Public Member Functions

static int max_sigma (const double &thresh, const int &rank, const Tensor< double > &w)
 

Public Attributes

unsigned int dim_
 the number of dimensions (the order of the tensor) More...
 
Tensor< typename Tensor< T >
::scalar_type > 
weights_
 for each configuration the weight; length should be r More...
 
std::vector< tensorTvector_
 
long rank_
 what is the rank of this More...
 
unsigned int maxk_
 
std::vector< Slices_
 
TensorType tensortype_
 how will this be represented More...
 

Static Public Attributes

static const bool check_orthonormality =false
 check orthonormality at low rank additions More...
 

Friends

class GenTensor< T >
 
SRConf< T > copy (const SRConf< T > &rhs)
 deep copy of rhs, shrink More...
 
const SRConf< Q > &lhs if ((lhs.has_no_data()) or(rhs.has_no_data())) return 0.0
 
bool compatible (const SRConf &lhs, const SRConf &rhs)
 check compatibility More...
 

Detailed Description

template<typename T>
class madness::SRConf< T >

A SRConf handles all the configurations in a Separated Representation.

Member Typedef Documentation

template<typename T>
typedef Tensor<T> madness::SRConf< T >::tensorT

Constructor & Destructor Documentation

template<typename T>
madness::SRConf< T >::SRConf ( )
inline

default ctor

template<typename T>
madness::SRConf< T >::SRConf ( const unsigned int &  dim,
const unsigned int &  k,
const TensorType tt 
)
inline

ctor with dimensions for a vector configuration (tested)

References madness::SRConf< T >::has_structure(), and madness::TT_FULL.

template<typename T>
madness::SRConf< T >::SRConf ( const SRConf< T > &  rhs)
inline

copy ctor (tested); shallow copy

References madness::SRConf< T >::has_structure().

template<typename T>
madness::SRConf< T >::SRConf ( const Tensor< double > &  weights,
const std::vector< Tensor< T > > &  vectors,
const unsigned int &  dim,
const unsigned int  maxk,
const TensorType tt 
)
inline

ctor with provided weights and effective vectors; shallow copy

References madness::SRConf< T >::has_structure(), and madness::SRConf< T >::weights().

template<typename T>
madness::SRConf< T >::SRConf ( const tensorT vector1)
inline

explicit ctor with one vector (aka full representation), shallow

References madness::SRConf< T >::has_structure().

template<typename T>
madness::SRConf< T >::SRConf ( const Tensor< double > &  weights,
const tensorT vector1,
const tensorT vector2,
const unsigned int &  dim,
const unsigned int  maxk 
)
inline

explicit ctor with two vectors (aka SVD), shallow

References madness::SRConf< T >::has_structure(), and madness::SRConf< T >::weights().

template<typename T>
madness::SRConf< T >::~SRConf ( )
inline

dtor

Member Function Documentation

template<typename T>
int madness::SRConf< T >::dim_per_vector ( ) const
inline

return the number of physical dimensions

References mpfr::dim().

template<typename T>
const SRConf madness::SRConf< T >::get_configs ( const int &  start,
const int &  end 
) const
inline
template<typename T>
bool madness::SRConf< T >::has_data ( ) const
inline

does this have any data?

References madness::TT_FULL.

template<typename T>
bool madness::SRConf< T >::has_structure ( ) const
inline
template<typename T>
static int madness::SRConf< T >::max_sigma ( const double &  thresh,
const int &  rank,
const Tensor< double > &  w 
)
inlinestatic

return the index of the last singular vector/value to meet the threshold (returns -1 if all meet threshold, i.e. || A ||_2 < threshold) given a matrix A in SVD form, truncate the singular values such that the accuracy threshold is still met.

Parameters
[in]threshthe threshold eps: || A - A(truncated) || < eps
[in]rankthe number of singular values in w [in] w the weights/singular values of A
Returns
i the index of s_max to contribute: w(Slice(0,i)); i.e. inclusive!

Referenced by madness::SeparatedConvolution< T, NDIM >::apply2(), madness::TensorTrain< T >::decompose(), madness::SeparatedConvolution< T, NDIM >::estimate_costs(), madness::ortho3(), and madness::TensorTrain< T >::truncate().

template<typename T>
SRConf& madness::SRConf< T >::operator= ( const SRConf< T > &  rhs)
inline
template<typename T>
void madness::SRConf< T >::orthonormalize ( const double &  thresh)
inline
template<typename T>
Tensor<T>& madness::SRConf< T >::ref_vector ( const unsigned int &  idim)
inline

return reference to one of the vectors F

Referenced by madness::SRConf< T >::get_configs(), and madness::SRConf< T >::operator=().

template<typename T>
const Tensor<T>& madness::SRConf< T >::ref_vector ( const unsigned int &  idim) const
inline

return reference to one of the vectors F

template<typename T>
template<typename Archive >
void madness::SRConf< T >::serialize ( Archive &  ar)
inline
template<typename T>
TensorType madness::SRConf< T >::type ( ) const
inline
template<typename T>
double madness::SRConf< T >::weights ( const unsigned int &  i) const
inline

return the weight

References madness::SRConf< T >::weights_.

Referenced by madness::ortho3(), and madness::SRConf< T >::SRConf().

Friends And Related Function Documentation

template<typename T>
bool compatible ( const SRConf< T > &  lhs,
const SRConf< T > &  rhs 
)
friend

check compatibility

template<typename T>
SRConf<T> copy ( const SRConf< T > &  rhs)
friend

deep copy of rhs, shrink

Referenced by madness::ortho5().

template<typename T>
friend class GenTensor< T >
friend
template<typename T>
const SRConf<Q>& lhs if ( (lhs.has_no_data()) or(rhs.has_no_data())  )
friend

Member Data Documentation

template<typename T>
const bool madness::SRConf< T >::check_orthonormality =false
static

check orthonormality at low rank additions

template<typename T>
unsigned int madness::SRConf< T >::dim_

the number of dimensions (the order of the tensor)

Referenced by madness::SRConf< T >::operator=().

template<typename T>
unsigned int madness::SRConf< T >::maxk_

the number of underlying basis functions the dimensions of vector_ will be vector_(rank,maxk), vector_(rank,maxk,maxk), etc

Referenced by madness::SRConf< T >::operator=().

template<typename T>
long madness::SRConf< T >::rank_

what is the rank of this

template<typename T>
std::vector<Slice> madness::SRConf< T >::s_

Slice containing the actual data in each vector, ignoring "empty" configurations; will maintain contiguity of the data.

Referenced by madness::SRConf< T >::operator=().

template<typename T>
TensorType madness::SRConf< T >::tensortype_

how will this be represented

Referenced by madness::SRConf< T >::operator=(), and madness::SRConf< T >::type().

template<typename T>
std::vector<tensorT> madness::SRConf< T >::vector_

for each (physical) dimension one Tensor of (logical) dimension (r,k) for vectors or (r,kprime,k) for operators

Referenced by madness::SRConf< T >::operator=().

template<typename T>
Tensor< typename Tensor<T>::scalar_type > madness::SRConf< T >::weights_

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