29 #ifndef CORE_BASIS_CRVSAMPLINGSCHEMES_H
30 #define CORE_BASIS_CRVSAMPLINGSCHEMES_H 1
47 template <
class ARRAY1,
class ARRAY2>
50 typedef typename ARRAY1::value_type coords_type;
51 if (order == 1 || order == 0)
53 const double gaussian_weights[1] = { 1.0};
54 const double gaussian_coords[1][1] = { {.5}};
55 const unsigned int num_coords = 1;
56 const unsigned int num_points = 1;
58 coords.resize(num_points);
59 weights.resize(num_points);
60 for (
unsigned int i=0; i<num_points; i++)
62 coords[i].resize(num_coords);
63 for (
unsigned int j=0; j<num_coords; j++)
64 coords[i][j] = static_cast<typename coords_type::value_type>(gaussian_coords[i][j]);
65 weights[i] =
static_cast<typename ARRAY2::value_type
>(gaussian_weights[i]);
70 const double gaussian_weights[2] = {.5, .5};
71 const double gaussian_coords[2][1] = {{0.211324865405}, {0.788675134595}};
72 const unsigned int num_coords = 1;
73 const unsigned int num_points = 2;
75 coords.resize(num_points);
76 weights.resize(num_points);
77 for (
unsigned int i=0; i<num_points; i++)
79 coords[i].resize(num_coords);
80 for (
unsigned int j=0; j<num_coords; j++)
81 coords[i][j] = static_cast<typename coords_type::value_type>(gaussian_coords[i][j]);
82 weights[i] =
static_cast<typename ARRAY2::value_type
>(gaussian_weights[i]);
87 const double gaussian_weights[3] = {.2777777777, .4444444444, .2777777777};
88 const double gaussian_coords[3][1] = {{0.11270166537950}, {0.5}, {0.88729833462050}};
89 const unsigned int num_coords = 1;
90 const unsigned int num_points = 3;
92 coords.resize(num_points);
93 weights.resize(num_points);
94 for (
unsigned int i=0; i<num_points; i++)
96 coords[i].resize(num_coords);
97 for (
unsigned int j=0; j<num_coords; j++)
98 coords[i][j] = static_cast<typename coords_type::value_type>(gaussian_coords[i][j]);
99 weights[i] =
static_cast<typename ARRAY2::value_type
>(gaussian_weights[i]);
108 template <
class ARRAY1,
class ARRAY2>
111 typedef typename ARRAY1::value_type coords_type;
113 coords.resize(order);
114 weights.resize(order);
115 for (
int i=0; i< order; i++)
118 coords[i][0] =
static_cast<typename coords_type::value_type
>(
static_cast<double>(i+1)/static_cast<double>(order+1));
119 weights[i] =
static_cast<typename ARRAY2::value_type
>(1.0/
static_cast<double>(order));
Definition: CrvSamplingSchemes.h:43
#define SCISHARE
Definition: share.h:39
Utility for specifying data invariants (Assertions)
void get_regular_scheme(ARRAY1 &coords, ARRAY2 &weights, int order)
Definition: CrvSamplingSchemes.h:109
void get_gaussian_scheme(ARRAY1 &coords, ARRAY2 &weights, int order)
Definition: CrvSamplingSchemes.h:48
#define REPORT_NOT_IMPLEMENTED(message)
Definition: Exception.h:106