Factorize a function on the continuous using natural grid#

inline auto xfac::grid::QuadratureGK15(double a = 0, double b = 1)#

Gauss Kronrod quadrature as defined at boost::math::quadrature::gauss_kronrod<double, 15>

template<class T, class Index>
class CTensorCI2 : public xfac::TensorCI2<T>#

This class is a TensorCI2 built form an arbitrary function f(u1,u2,…un) where ui can be anything as long as the user provides a list of possible values for each one. Apart from the TensorCI2 including its (discrete) tensor train, the main output is the continuous tensor train: an effective separation of variables.

Public Functions

inline CTensorCI2(function<T(vector<Index>)> f_, vector<vector<Index>> const &xi_, TensorCI2Param par = {})#

constructs a rank-1 CTensorCI2 from a function f:(u1,u2,…,un)->T where ui is in xi[i].

inline CTensorTrain<T, Index> get_CTensorTrain() const#

returns the underline continuous tensor train

inline arma::Mat<T> get_T_at(size_t p, Index x) const#

returns the matrix obtained when evaluating the tensor T[p] at value x, i.e., A(i,j)=fc( xi(Ip[i]) + x + xi(Jp[j]) ) where xi() converts to grid point a given MultiIndex and Ip, Jp are the pivot indices at bond p, as defined in TensorCI2.

inline arma::Mat<T> get_TP1_at(size_t p, Index x) const#

return the value of get_T_at(p,x)*P[p]^-1 where P[p] is the pivot matrix at bond p.

inline arma::Mat<T> get_P1T_at(size_t p, Index x) const#

return the value of get_T_at(p,x)*P[p]^-1 where P[p] is the pivot matrix at bond p.

Public Members

function<T(vector<Index>)> fc#

the original function

vector<vector<Index>> xi#

the original grid

template<class T, class Index>
struct CTensorTrain#

stores a continuous tensor train, i.e., a list of 3-leg tensors where one of the legs is an Index type (i.e. a double).

Public Functions

inline T eval(vector<Index> const &xs) const#

evaluate the c-tensor train at a given multi index.

inline TensorTrain<T> getTensorTrain(vector<vector<Index>> const&) const#

return the TensorTrain generated by sampling the CTensorTrain in a grid xi.

Public Members

vector< std::function< arma::Mat< T >Index)> > M

list of 3-leg tensors