13 #ifndef __Basis_basis_h__
14 #define __Basis_basis_h__
35 virtual double operator() (
const std::array<double, 3> &x)
const = 0;
40 using BasisSet = std::vector<std::reference_wrapper<BasisFunction>>;
55 const unsigned size = bset.size();
56 std::vector<std::reference_wrapper<const T>> casts;
58 for(
unsigned j = 0; j < size; ++j) {
59 const T *ptr =
dynamic_cast<const T*
>(&bset[j].get());
61 throw std::runtime_error(
"A basis function is not of the specified type.");
62 casts.emplace_back(std::cref(*ptr));
Abstract base class for generic basis functions.
Definition: basis.h:25
virtual ~BasisFunction()=default
virtual double operator()(const std::array< double, 3 > &x) const =0
Evaluate the basis function at the specified point.
auto T(World &world, response_space &f) -> response_space
Definition: global_functions.cc:34
std::vector< std::reference_wrapper< BasisFunction > > BasisSet
Type for a basis set (collection of basis functions).
Definition: basis.h:40
std::vector< std::reference_wrapper< const T > > cast_basis(const BasisSet &bset)
Convert a generic basis set to basis functions with the specific type.
Definition: basis.h:54