75 const unsigned int comp)
const
83 for (
unsigned int i = 0; i < dim; ++i)
86 grad[i] = (this->value(p, comp) - this->value(q1, comp)) / h;
93 for (
unsigned int i = 0; i < dim; ++i)
98 (this->value(q1, comp) - this->value(q2, comp)) / (2 * h);
105 for (
unsigned int i = 0; i < dim; ++i)
111 grad[i] = (-this->value(q1, comp) + 8 * this->value(q2, comp) -
112 8 * this->value(q3, comp) + this->value(q4, comp)) /
130 Assert(gradients.size() == this->n_components,
139 const double h_inv = 1. / h;
140 for (
unsigned int i = 0; i < dim; ++i)
143 this->vector_value(p, v);
144 this->vector_value(q1,
v1);
146 for (
unsigned int comp = 0; comp < this->n_components; ++comp)
147 gradients[comp][i] = (v(comp) -
v1(comp)) * h_inv;
156 const double h_inv_2 = 1. / (2 * h);
157 for (
unsigned int i = 0; i < dim; ++i)
161 this->vector_value(q1,
v1);
162 this->vector_value(q2, v2);
164 for (
unsigned int comp = 0; comp < this->n_components; ++comp)
165 gradients[comp][i] = (
v1(comp) - v2(comp)) * h_inv_2;
174 v3(this->n_components), v4(this->n_components);
175 const double h_inv_12 = 1. / (12 * h);
176 for (
unsigned int i = 0; i < dim; ++i)
182 this->vector_value(q1,
v1);
183 this->vector_value(q2, v2);
184 this->vector_value(q3, v3);
185 this->vector_value(q4, v4);
187 for (
unsigned int comp = 0; comp < this->n_components; ++comp)
189 (-
v1(comp) + 8 * v2(comp) - 8 * v3(comp) + v4(comp)) *
206 const unsigned int comp)
const
208 Assert(gradients.size() == points.size(),
216 for (
unsigned int p = 0; p < points.size(); ++p)
217 for (
unsigned int i = 0; i < dim; ++i)
219 q1 = points[p] - ht[i];
221 (this->value(points[p], comp) - this->value(q1, comp)) / h;
229 for (
unsigned int p = 0; p < points.size(); ++p)
230 for (
unsigned int i = 0; i < dim; ++i)
232 q1 = points[p] + ht[i];
233 q2 = points[p] - ht[i];
235 (this->value(q1, comp) - this->value(q2, comp)) / (2 * h);
243 for (
unsigned int p = 0; p < points.size(); ++p)
244 for (
unsigned int i = 0; i < dim; ++i)
246 q2 = points[p] + ht[i];
248 q3 = points[p] - ht[i];
251 (-this->value(q1, comp) + 8 * this->value(q2, comp) -
252 8 * this->value(q3, comp) + this->value(q4, comp)) /
271 Assert(gradients.size() == points.size(),
273 for (
unsigned int p = 0; p < points.size(); ++p)
274 Assert(gradients[p].size() == this->n_components,
282 for (
unsigned int p = 0; p < points.size(); ++p)
283 for (
unsigned int i = 0; i < dim; ++i)
285 q1 = points[p] - ht[i];
286 for (
unsigned int comp = 0; comp < this->n_components; ++comp)
287 gradients[p][comp][i] =
288 (this->value(points[p], comp) - this->value(q1, comp)) / h;
296 for (
unsigned int p = 0; p < points.size(); ++p)
297 for (
unsigned int i = 0; i < dim; ++i)
299 q1 = points[p] + ht[i];
300 q2 = points[p] - ht[i];
301 for (
unsigned int comp = 0; comp < this->n_components; ++comp)
302 gradients[p][comp][i] =
303 (this->value(q1, comp) - this->value(q2, comp)) / (2 * h);
311 for (
unsigned int p = 0; p < points.size(); ++p)
312 for (
unsigned int i = 0; i < dim; ++i)
314 q2 = points[p] + ht[i];
316 q3 = points[p] - ht[i];
318 for (
unsigned int comp = 0; comp < this->n_components; ++comp)
319 gradients[p][comp][i] =
320 (-this->value(q1, comp) + 8 * this->value(q2, comp) -
321 8 * this->value(q3, comp) + this->value(q4, comp)) /