7 T make_dummy_component() {
11 template<> std::valarray<double> make_dummy_component();
13 template<
typename Vec>
14 Vec make_dummy_vector() {
15 return Vec(make_dummy_component<typename Vec::value_type>());
18 template<
typename Scalar>
19 double observe_dummy_component(
const Scalar& _s) {
24 double observe_dummy_component(
const std::valarray<T>& _s) {
29 double observe_dummy_component(
const std::complex<T>& _s) {
30 return _s.real() + _s.imag();
33 template<
typename Vec>
34 double observe_dummy_vector(
const Vec& _vec) {
36 for (
int dim = 0; dim < _vec.dim(); ++dim) {
37 result += observe_dummy_component(_vec[dim]);