WaveBlocksND
|
Classes | |
struct | FunctionMatrixEvaluator |
struct | FunctionMatrixEvaluator< 1, 1, M, A, R, F > |
class | MatrixToGrid |
Adaptor which accepts an Eigen::Matrix and emulates some behavior of a std::vector. More... | |
class | MatrixToGridIterator |
Forward iterator for the MatrixToGrid class. More... | |
struct | PacketToCoefficients |
struct | PacketToCoefficients< wavepackets::ScalarHaWp< D, MultiIndex > > |
struct | Squeeze |
struct | Squeeze< 1, CMatrix< 1, Eigen::Dynamic > > |
struct | Squeeze< 1, T > |
struct | Squeeze< D, CMatrix< D, Eigen::Dynamic > > |
class | Timer |
struct | Unsqueeze |
struct | Unsqueeze< 1, T > |
Typedefs | |
template<class Matrix > | |
using | grid_element_type = GVector< typename Matrix::Scalar, Matrix::RowsAtCompileTime > |
Functions | |
template<class Matrix , template< typename... > class Grid = std::vector> | |
Grid< grid_element_type< Matrix > > | matrix_to_grid (const Matrix &m) |
Copies a Eigen::Matrix into a grid. More... | |
template<class Matrix , template< typename... > class Grid = std::vector> | |
Matrix | grid_to_matrix (Grid< grid_element_type< Matrix > > g) |
Copies a grid into a Eigen::Matrix. More... | |
bool | parse_complex (char const *text, std::complex< double > &result) |
template<class A , class R , template< typename... > class G_in = std::vector, template< typename... > class G_out = G_in, template< typename... > class F = std::function> | |
G_out< R > | evaluate_function_in_grid (const F< R(A)> &f, const G_in< A > &g) |
Evaluate a function in multiple points at once. More... | |
template<class T > | |
std::string | to_string (T in) |
using waveblocks::utilities::grid_element_type = typedef GVector<typename Matrix::Scalar, Matrix::RowsAtCompileTime> |
G_out<R> waveblocks::utilities::evaluate_function_in_grid | ( | const F< R(A)> & | f, |
const G_in< A > & | g | ||
) |
Evaluate a function in multiple points at once.
Generic template to evaluate a function object in multiple points
f | Function object taking input of type A and returning type R |
g | grid (template G_in) of A elements |
A | Type of the argument to be passed to f |
R | Return type of f |
G_in | class template for a container which implements size() and allows for:in loops |
G_out | class template for a container which implements a constructor with a single size_t argument and implements begin() to return a forward-iterator |
F | class template for a function object |
Matrix waveblocks::utilities::grid_to_matrix | ( | Grid< grid_element_type< Matrix > > | g | ) |
Copies a grid into a Eigen::Matrix.
Builds a matrix from a grid of row vectors
g | Grid of row vectors |
Matrix | The type of matrix to use for return |
Grid | Class template of the grid to adapt |
Grid<grid_element_type<Matrix> > waveblocks::utilities::matrix_to_grid | ( | const Matrix & | m | ) |
Copies a Eigen::Matrix into a grid.
Builds a grid of row vectors from a matrix
m | The matrix to copy into a grid |
Matrix | The type of matrix to adapt |
Grid | Class template to use for return |
bool waveblocks::utilities::parse_complex | ( | char const * | text, |
std::complex< double > & | result | ||
) |
This function basically invokes std::strtod until end of string and accumulates those comverted numbers.
If one of the characters 'i', 'j','I', 'J' immediately follows after std::strtod, the value is interpreted as a complex number.
Be aware, that this function does not check input properly. Thus for pathological input you get unexpected results, but this function is able to correctly interpret output of python/numpy.
Valid input: "1.0+2.0j" yields (1.0,2.0) "0.7j+1.1+2.2+3.3" yields (6.6,0.7) "1e3-1.7e-3j" yield (1000,-0.0017)
Invalid input: "-+2.0"
text | zero-terminated c-string |
result | Variable holding the result |
std::string waveblocks::utilities::to_string | ( | T | in | ) |