Spectral Integral Suite in C++
sis::Chebfun< T > Class Template Reference

This is a chebfun analogue. Chebfun will represent both values in physical space or an array of Chebyshev-coefficients. Values can be in either space for calculations. To convert between physical values or Chebyshev coefficients, one can call Chebfun.c2p() and Chebfun.p2c(). More...

#include <sis.hpp>

Public Member Functions

 Chebfun ()
 Null constructor. More...
 
 Chebfun (const std::valarray< T > &in)
 constructor by an input valarray More...
 
 Chebfun (const Eigen::Array< T, Eigen::Dynamic, Eigen::Dynamic > &in)
 constructor by an input Eigen::Array<T,Eigen::Dynamic,1> More...
 
 Chebfun (const Chebfun &in)
 Copy conststructor. More...
 
void p2c ()
 Converts a Chebfun from values in physical-space to coefficients of Chebyshev polynomials. More...
 
void c2p ()
 Converts a Chebfun from Chebyshev coefficients to values in physical space. More...
 
Eigen::Array< T, Eigen::Dynamic, 1 > ev ()
 Returns property v in terms of Eigen::Array. More...
 
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > MultMat ()
 This function returns the Toeplitz + almost Hankel matrix needed to express multiplication of two Chebyshev series. This is used in solving for nonconstant coefficients. More...
 
void operator= (T right)
 Equating the Chebfun to a constant. More...
 
void operator= (const Chebfun &right)
 To assign a Chebfun through another Chebfun. More...
 
void operator= (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &right)
 To assign a Chebfun through a vector. More...
 
void operator= (const std::valarray< T > &right)
 To assign a Chebfun through a valarray. More...
 
void operator+= (const T &right)
 Adding constant to itself. More...
 
void operator+= (Chebfun right)
 Add a Chebfun to itself. If both are in same space, return will be in same space, else the lhs will retain space. More...
 
operator() (const T &a)
 To assign a Chebfun through a Array. More...
 
Chebfun< T > cumsum ()
 Returns a Chebfun that represents the indefinite integral of the Chebfun. More...
 
L2norm ()
 Returns the L2norm of the function. More...
 
bool isMachinePrecision ()
 
bool isMachinePrecisionHalf ()
 
trunc ()
 Provides the truncation defined in terms of the abs(last + last_but_one)/2.0. More...
 

Public Attributes

int dct_flag
 
std::valarray< T > v
 Stores a flag to denote if function is in Cheb-space or physical space. More...
 

Detailed Description

template<class T>
class sis::Chebfun< T >

This is a chebfun analogue. Chebfun will represent both values in physical space or an array of Chebyshev-coefficients. Values can be in either space for calculations. To convert between physical values or Chebyshev coefficients, one can call Chebfun.c2p() and Chebfun.p2c().

Definition at line 1150 of file sis.hpp.

Constructor & Destructor Documentation

◆ Chebfun() [1/4]

template<class T>
sis::Chebfun< T >::Chebfun ( )
inline

Null constructor.

By default the function is f(y) =y, with values in physical space.

Definition at line 1160 of file sis.hpp.

References sis::Chebfun< T >::dct_flag, sis::N, PI, SIS_PHYS_SPACE, and sis::Chebfun< T >::v.

◆ Chebfun() [2/4]

template<class T>
sis::Chebfun< T >::Chebfun ( const std::valarray< T > &  in)
inline

constructor by an input valarray

Definition at line 1167 of file sis.hpp.

References sis::Chebfun< T >::dct_flag, sis::N, SIS_PHYS_SPACE, and sis::Chebfun< T >::v.

◆ Chebfun() [3/4]

template<class T>
sis::Chebfun< T >::Chebfun ( const Eigen::Array< T, Eigen::Dynamic, Eigen::Dynamic > &  in)
inline

constructor by an input Eigen::Array<T,Eigen::Dynamic,1>

Definition at line 1178 of file sis.hpp.

References sis::Chebfun< T >::dct_flag, sis::N, SIS_PHYS_SPACE, and sis::Chebfun< T >::v.

◆ Chebfun() [4/4]

template<class T>
sis::Chebfun< T >::Chebfun ( const Chebfun< T > &  in)
inline

Copy conststructor.

Definition at line 1210 of file sis.hpp.

References sis::Chebfun< T >::dct_flag, and sis::Chebfun< T >::v.

Member Function Documentation

◆ c2p()

◆ cumsum()

template<class T>
Chebfun<T> sis::Chebfun< T >::cumsum ( )
inline

Returns a Chebfun that represents the indefinite integral of the Chebfun.

Definition at line 1427 of file sis.hpp.

References sis::Chebfun< T >::c2p(), sis::Chebfun< T >::dct_flag, sis::integ(), sis::Chebfun< T >::p2c(), SIS_CHEB_SPACE, SIS_PHYS_SPACE, and sis::Chebfun< T >::v.

◆ ev()

template<class T>
Eigen::Array<T, Eigen::Dynamic, 1> sis::Chebfun< T >::ev ( )
inline

Returns property v in terms of Eigen::Array.

Definition at line 1297 of file sis.hpp.

References sis::Chebfun< T >::v.

◆ isMachinePrecision()

template<class T>
bool sis::Chebfun< T >::isMachinePrecision ( )
inline

Definition at line 1461 of file sis.hpp.

References sis::N, and sis::Chebfun< T >::v.

◆ isMachinePrecisionHalf()

template<class T>
bool sis::Chebfun< T >::isMachinePrecisionHalf ( )
inline

Definition at line 1468 of file sis.hpp.

References sis::N, and sis::Chebfun< T >::v.

◆ L2norm()

template<class T>
T sis::Chebfun< T >::L2norm ( )
inline

Returns the L2norm of the function.

Definition at line 1444 of file sis.hpp.

References sis::Chebfun< T >::c2p(), sis::Chebfun< T >::dct_flag, sis::integ(), sis::Chebfun< T >::p2c(), SIS_PHYS_SPACE, and sis::Chebfun< T >::v.

Referenced by sis::EigenSorter< T >::compute().

◆ MultMat()

template<class T>
Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> sis::Chebfun< T >::MultMat ( )
inline

This function returns the Toeplitz + almost Hankel matrix needed to express multiplication of two Chebyshev series. This is used in solving for nonconstant coefficients.

To assign a Chebfun to a constant

Definition at line 1309 of file sis.hpp.

References sis::Chebfun< T >::dct_flag, sis::N, sis::Chebfun< T >::p2c(), SIS_PHYS_SPACE, and sis::Chebfun< T >::v.

◆ operator()()

template<class T>
T sis::Chebfun< T >::operator() ( const T &  a)
inline

To assign a Chebfun through a Array.

Evaluate the Chebfun at a point in the domain, i.e., -1 to 1.

Definition at line 1402 of file sis.hpp.

References sis::Chebfun< T >::c2p(), sis::Chebfun< T >::dct_flag, sis::N, sis::Chebfun< T >::p2c(), SIS_PHYS_SPACE, and sis::Chebfun< T >::v.

◆ operator+=() [1/2]

template<class T>
void sis::Chebfun< T >::operator+= ( const T &  right)
inline

Adding constant to itself.

Definition at line 1372 of file sis.hpp.

References SIS_CHEB_SPACE, and sis::Chebfun< T >::v.

◆ operator+=() [2/2]

template<class T>
void sis::Chebfun< T >::operator+= ( Chebfun< T >  right)
inline

Add a Chebfun to itself. If both are in same space, return will be in same space, else the lhs will retain space.

Definition at line 1382 of file sis.hpp.

References sis::Chebfun< T >::c2p(), sis::Chebfun< T >::dct_flag, sis::Chebfun< T >::p2c(), SIS_PHYS_SPACE, and sis::Chebfun< T >::v.

◆ operator=() [1/4]

template<class T>
void sis::Chebfun< T >::operator= ( right)
inline

Equating the Chebfun to a constant.

Definition at line 1345 of file sis.hpp.

References sis::Chebfun< T >::dct_flag, SIS_CHEB_SPACE, and sis::Chebfun< T >::v.

◆ operator=() [2/4]

template<class T>
void sis::Chebfun< T >::operator= ( const Chebfun< T > &  right)
inline

To assign a Chebfun through another Chebfun.

Definition at line 1355 of file sis.hpp.

References sis::Chebfun< T >::dct_flag, and sis::Chebfun< T >::v.

◆ operator=() [3/4]

template<class T>
void sis::Chebfun< T >::operator= ( const Eigen::Matrix< T, Eigen::Dynamic, 1 > &  right)
inline

To assign a Chebfun through a vector.

Definition at line 1361 of file sis.hpp.

References sis::N, and sis::Chebfun< T >::v.

◆ operator=() [4/4]

template<class T>
void sis::Chebfun< T >::operator= ( const std::valarray< T > &  right)
inline

To assign a Chebfun through a valarray.

Definition at line 1368 of file sis.hpp.

References sis::Chebfun< T >::v.

◆ p2c()

◆ trunc()

template<class T>
T sis::Chebfun< T >::trunc ( )
inline

Provides the truncation defined in terms of the abs(last + last_but_one)/2.0.

Definition at line 1478 of file sis.hpp.

References sis::N, and sis::Chebfun< T >::v.

Member Data Documentation

◆ dct_flag

◆ v


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