ALPSCore reference
Public Member Functions | Friends | List of all members
alps::gf::piecewise_polynomial< T > Class Template Reference

Class representing a piecewise polynomial and utilities. More...

#include <piecewise_polynomial.hpp>

Collaboration diagram for alps::gf::piecewise_polynomial< T >:
Collaboration graph

Public Member Functions

 piecewise_polynomial ()
 
 piecewise_polynomial (int k, const std::vector< double > &section_edges)
 Construct an object set to zero. More...
 
 piecewise_polynomial (int n_section, const std::vector< double > &section_edges, const boost::multi_array< T, 2 > &coeff)
 
piecewise_polynomial< T > & operator= (const piecewise_polynomial< T > &other)
 Copy operator. More...
 
int order () const
 Order of the polynomial. More...
 
int num_sections () const
 Number of sections. More...
 
double section_edge (int i) const
 Return an end point. The index i runs from 0 (smallest) to num_sections()+1 (largest). More...
 
const std::vector< double > & section_edges () const
 Return a refence to end points. More...
 
const T & coefficient (int i, int p) const
 Return the coefficient of $x^p$ for the given section. More...
 
T & coefficient (int i, int p)
 Return a reference to the coefficient of $x^p$ for the given section. More...
 
void set_zero ()
 Set to zero. More...
 
compute_value (double x) const
 Compute the value at x. More...
 
compute_value (double x, int section) const
 Compute the value at x. x must be in the given section. More...
 
int find_section (double x) const
 Find the section involving the given x. More...
 
template<class T2 >
overlap (const piecewise_polynomial< T2 > &other) const
 Compute overlap <this | other> with complex conjugate. The two objects must have the same sections. More...
 
double squared_norm () const
 Compute squared norm. More...
 
bool operator== (const piecewise_polynomial< T > &other) const
 Returns whether or not two objects are numerically the same. More...
 
void save (alps::hdf5::archive &ar, const std::string &path) const
 Save to a hdf5 file. More...
 
void load (alps::hdf5::archive &ar, const std::string &path)
 Load from a hdf5 file. More...
 
void save (alps::hdf5::archive &ar) const
 Save to HDF5. More...
 
void load (alps::hdf5::archive &ar)
 Load from HDF5. More...
 

Friends

template<typename TT >
class piecewise_polynomial
 
template<typename TT , typename Op >
piecewise_polynomial< TT > detail::do_op (const piecewise_polynomial< TT > &f1, const piecewise_polynomial< TT > &f2, const Op &op)
 
template<typename TT >
piecewise_polynomial< TT > operator+ (const piecewise_polynomial< TT > &f1, const piecewise_polynomial< TT > &f2)
 
template<typename TT >
piecewise_polynomial< TT > operator- (const piecewise_polynomial< TT > &f1, const piecewise_polynomial< TT > &f2)
 
template<typename TT >
const piecewise_polynomial< TT > operator* (TT scalar, const piecewise_polynomial< TT > &pp)
 

Detailed Description

template<typename T>
class alps::gf::piecewise_polynomial< T >

Class representing a piecewise polynomial and utilities.

Class for representing a piecewise polynomial A function is represented by a polynomial in each section [x_n, x_{n+1}).

Definition at line 32 of file piecewise_polynomial.hpp.

Constructor & Destructor Documentation

template<typename T>
alps::gf::piecewise_polynomial< T >::piecewise_polynomial ( )
inline

Definition at line 180 of file piecewise_polynomial.hpp.

template<typename T>
alps::gf::piecewise_polynomial< T >::piecewise_polynomial ( int  k,
const std::vector< double > &  section_edges 
)
inline

Construct an object set to zero.

Definition at line 183 of file piecewise_polynomial.hpp.

template<typename T>
alps::gf::piecewise_polynomial< T >::piecewise_polynomial ( int  n_section,
const std::vector< double > &  section_edges,
const boost::multi_array< T, 2 > &  coeff 
)
inline

Definition at line 194 of file piecewise_polynomial.hpp.

Member Function Documentation

template<typename T>
const T& alps::gf::piecewise_polynomial< T >::coefficient ( int  i,
int  p 
) const
inline

Return the coefficient of $x^p$ for the given section.

Definition at line 247 of file piecewise_polynomial.hpp.

template<typename T>
T& alps::gf::piecewise_polynomial< T >::coefficient ( int  i,
int  p 
)
inline

Return a reference to the coefficient of $x^p$ for the given section.

Definition at line 257 of file piecewise_polynomial.hpp.

template<typename T>
T alps::gf::piecewise_polynomial< T >::compute_value ( double  x) const
inline

Compute the value at x.

Definition at line 272 of file piecewise_polynomial.hpp.

template<typename T>
T alps::gf::piecewise_polynomial< T >::compute_value ( double  x,
int  section 
) const
inline

Compute the value at x. x must be in the given section.

Definition at line 280 of file piecewise_polynomial.hpp.

template<typename T>
int alps::gf::piecewise_polynomial< T >::find_section ( double  x) const
inline

Find the section involving the given x.

Definition at line 298 of file piecewise_polynomial.hpp.

template<typename T>
void alps::gf::piecewise_polynomial< T >::load ( alps::hdf5::archive ar,
const std::string &  path 
)
inline

Load from a hdf5 file.

Definition at line 368 of file piecewise_polynomial.hpp.

template<typename T>
void alps::gf::piecewise_polynomial< T >::load ( alps::hdf5::archive ar)
inline

Load from HDF5.

Definition at line 385 of file piecewise_polynomial.hpp.

template<typename T>
int alps::gf::piecewise_polynomial< T >::num_sections ( ) const
inline

Number of sections.

Definition at line 222 of file piecewise_polynomial.hpp.

template<typename T>
piecewise_polynomial<T>& alps::gf::piecewise_polynomial< T >::operator= ( const piecewise_polynomial< T > &  other)
inline

Copy operator.

Definition at line 205 of file piecewise_polynomial.hpp.

template<typename T>
bool alps::gf::piecewise_polynomial< T >::operator== ( const piecewise_polynomial< T > &  other) const
inline

Returns whether or not two objects are numerically the same.

Definition at line 352 of file piecewise_polynomial.hpp.

template<typename T>
int alps::gf::piecewise_polynomial< T >::order ( ) const
inline

Order of the polynomial.

Definition at line 217 of file piecewise_polynomial.hpp.

template<typename T>
template<class T2 >
T alps::gf::piecewise_polynomial< T >::overlap ( const piecewise_polynomial< T2 > &  other) const
inline

Compute overlap <this | other> with complex conjugate. The two objects must have the same sections.

Definition at line 316 of file piecewise_polynomial.hpp.

template<typename T>
void alps::gf::piecewise_polynomial< T >::save ( alps::hdf5::archive ar,
const std::string &  path 
) const
inline

Save to a hdf5 file.

Definition at line 359 of file piecewise_polynomial.hpp.

template<typename T>
void alps::gf::piecewise_polynomial< T >::save ( alps::hdf5::archive ar) const
inline

Save to HDF5.

Definition at line 379 of file piecewise_polynomial.hpp.

template<typename T>
double alps::gf::piecewise_polynomial< T >::section_edge ( int  i) const
inline

Return an end point. The index i runs from 0 (smallest) to num_sections()+1 (largest).

Definition at line 230 of file piecewise_polynomial.hpp.

template<typename T>
const std::vector<double>& alps::gf::piecewise_polynomial< T >::section_edges ( ) const
inline

Return a refence to end points.

Definition at line 239 of file piecewise_polynomial.hpp.

template<typename T>
void alps::gf::piecewise_polynomial< T >::set_zero ( )
inline

Set to zero.

Definition at line 267 of file piecewise_polynomial.hpp.

template<typename T>
double alps::gf::piecewise_polynomial< T >::squared_norm ( ) const
inline

Compute squared norm.

Definition at line 347 of file piecewise_polynomial.hpp.

Friends And Related Function Documentation

template<typename T>
template<typename TT , typename Op >
piecewise_polynomial<TT> detail::do_op ( const piecewise_polynomial< TT > &  f1,
const piecewise_polynomial< TT > &  f2,
const Op &  op 
)
friend
template<typename T>
template<typename TT >
const piecewise_polynomial<TT> operator* ( TT  scalar,
const piecewise_polynomial< TT > &  pp 
)
friend
template<typename T>
template<typename TT >
piecewise_polynomial<TT> operator+ ( const piecewise_polynomial< TT > &  f1,
const piecewise_polynomial< TT > &  f2 
)
friend
template<typename T>
template<typename TT >
piecewise_polynomial<TT> operator- ( const piecewise_polynomial< TT > &  f1,
const piecewise_polynomial< TT > &  f2 
)
friend
template<typename T>
template<typename TT >
friend class piecewise_polynomial
friend

Definition at line 135 of file piecewise_polynomial.hpp.


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