ALPSCore reference
|
Class representing a piecewise polynomial and utilities. More...
#include <piecewise_polynomial.hpp>
Public Member Functions | |
piecewise_polynomial () | |
piecewise_polynomial (int k, const std::vector< double > §ion_edges) | |
Construct an object set to zero. More... | |
piecewise_polynomial (int n_section, const std::vector< double > §ion_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... | |
T | compute_value (double x) const |
Compute the value at x. More... | |
T | 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 > | |
T | 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) |
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.
|
inline |
Definition at line 180 of file piecewise_polynomial.hpp.
|
inline |
Construct an object set to zero.
Definition at line 183 of file piecewise_polynomial.hpp.
|
inline |
Definition at line 194 of file piecewise_polynomial.hpp.
|
inline |
Return the coefficient of $x^p$ for the given section.
Definition at line 247 of file piecewise_polynomial.hpp.
|
inline |
Return a reference to the coefficient of $x^p$ for the given section.
Definition at line 257 of file piecewise_polynomial.hpp.
|
inline |
Compute the value at x.
Definition at line 272 of file piecewise_polynomial.hpp.
|
inline |
Compute the value at x. x must be in the given section.
Definition at line 280 of file piecewise_polynomial.hpp.
|
inline |
Find the section involving the given x.
Definition at line 298 of file piecewise_polynomial.hpp.
|
inline |
Load from a hdf5 file.
Definition at line 368 of file piecewise_polynomial.hpp.
|
inline |
Load from HDF5.
Definition at line 385 of file piecewise_polynomial.hpp.
|
inline |
Number of sections.
Definition at line 222 of file piecewise_polynomial.hpp.
|
inline |
Copy operator.
Definition at line 205 of file piecewise_polynomial.hpp.
|
inline |
Returns whether or not two objects are numerically the same.
Definition at line 352 of file piecewise_polynomial.hpp.
|
inline |
Order of the polynomial.
Definition at line 217 of file piecewise_polynomial.hpp.
|
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.
|
inline |
Save to a hdf5 file.
Definition at line 359 of file piecewise_polynomial.hpp.
|
inline |
Save to HDF5.
Definition at line 379 of file piecewise_polynomial.hpp.
|
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.
|
inline |
Return a refence to end points.
Definition at line 239 of file piecewise_polynomial.hpp.
|
inline |
Set to zero.
Definition at line 267 of file piecewise_polynomial.hpp.
|
inline |
Compute squared norm.
Definition at line 347 of file piecewise_polynomial.hpp.
|
friend |
|
friend |
|
friend |
|
friend |
Definition at line 135 of file piecewise_polynomial.hpp.