 v0.10.0
ApproxFunction Struct Reference

## Static Public Member Functions

static double fun (double x, double y, double z)

static VectorDouble3 diff_fun (double x, double y, double z)

static double fun (double x, double y)

static VectorDouble3 diff_fun (double x, double y)

## Detailed Description

Examples

Definition at line 28 of file prism_polynomial_approximation.cpp.

## ◆ diff_fun() [1/2]

 static VectorDouble3 ApproxFunction::diff_fun ( double x, double y, double z )
static
Examples

Definition at line 44 of file prism_polynomial_approximation.cpp.

44  {
45  VectorDouble3 r(3);
46  r.clear();
47  for (int o = 1; o <= approx_order; ++o) {
48  for (int i = 0; i <= o; ++i) {
49  for (int j = 0; j <= (o - i); ++j) {
50  int k = o - i - j;
51  if (k >= 0) {
52  r += i > 0 ? i * pow(x, i - 1) * pow(y, j) * pow(z, k) : 0;
53  r += j > 0 ? j * pow(x, i) * pow(y, j - 1) * pow(z, k) : 0;
54  r += k > 0 ? k * pow(x, i) * pow(y, j) * pow(z, k - 1) : 0;
55  }
56  }
57  }
58  }
59  return r;
60  }
static constexpr int approx_order
static Index< 'i', 3 > i
static Index< 'j', 3 > j
static Index< 'o', 3 > o
const double r
rate factor
VectorBoundedArray< double, 3 > VectorDouble3
Definition: Types.hpp:92
static Index< 'k', 3 > k

## ◆ diff_fun() [2/2]

 static VectorDouble3 ApproxFunction::diff_fun ( double x, double y )
static

Definition at line 45 of file quad_polynomial_approximation.cpp.

45  {
46  VectorDouble3 r(2);
47  r.clear();
48  for (int o = 1; o <= approx_order; ++o) {
49  for (int i = 0; i <= o; ++i) {
50  int j = o - i;
51  if (j >= 0) {
52  r += i > 0 ? i * pow(x, i - 1) * pow(y, j) : 0;
53  r += j > 0 ? j * pow(x, i) * pow(y, j - 1) : 0;
54  }
55  }
56  }
57  return r;
58  }
static constexpr int approx_order
static Index< 'i', 3 > i
static Index< 'j', 3 > j
static Index< 'o', 3 > o
const double r
rate factor
VectorBoundedArray< double, 3 > VectorDouble3
Definition: Types.hpp:92

## ◆ fun() [1/2]

 static double ApproxFunction::fun ( double x, double y, double z )
static
Examples

Definition at line 29 of file prism_polynomial_approximation.cpp.

29  {
30  double r = 1;
31  for (int o = 1; o <= approx_order; ++o) {
32  for (int i = 0; i <= o; ++i) {
33  for (int j = 0; j <= (o - i); ++j) {
34  int k = o - i - j;
35  if (k >= 0) {
36  r += pow(x, i) * pow(y, j) * pow(z, k);
37  }
38  }
39  }
40  }
41  return r;
42  }
static constexpr int approx_order
static Index< 'i', 3 > i
static Index< 'j', 3 > j
static Index< 'o', 3 > o
const double r
rate factor
static Index< 'k', 3 > k

## ◆ fun() [2/2]

 static double ApproxFunction::fun ( double x, double y )
static

Definition at line 33 of file quad_polynomial_approximation.cpp.

33  {
34  double r = 1;
35  for (int o = 1; o <= approx_order; ++o) {
36  for (int i = 0; i <= o; ++i) {
37  int j = o - i;
38  if (j >= 0)
39  r += pow(x, i) * pow(y, j);
40  }
41  }
42  return r;
43  }
static constexpr int approx_order
static Index< 'i', 3 > i
static Index< 'j', 3 > j
static Index< 'o', 3 > o
const double r
rate factor

The documentation for this struct was generated from the following files: