openGPMP
Open Source Mathematics Package
analysis.hpp
Go to the documentation of this file.
1 /*************************************************************************
2  *
3  * Project
4  * _____ _____ __ __ _____
5  * / ____| __ \| \/ | __ \
6  * ___ _ __ ___ _ __ | | __| |__) | \ / | |__) |
7  * / _ \| '_ \ / _ \ '_ \| | |_ | ___/| |\/| | ___/
8  *| (_) | |_) | __/ | | | |__| | | | | | | |
9  * \___/| .__/ \___|_| |_|\_____|_| |_| |_|_|
10  * | |
11  * |_|
12  *
13  * Copyright (C) Akiel Aries, <akiel@akiel.org>, et al.
14  *
15  * This software is licensed as described in the file LICENSE, which
16  * you should have received as part of this distribution. The terms
17  * among other details are referenced in the official documentation
18  * seen here : https://akielaries.github.io/openGPMP/ along with
19  * important files seen in this project.
20  *
21  * You may opt to use, copy, modify, merge, publish, distribute
22  * and/or sell copies of the Software, and permit persons to whom
23  * the Software is furnished to do so, under the terms of the
24  * LICENSE file. As this is an Open Source effort, all implementations
25  * must be of the same methodology.
26  *
27  *
28  *
29  * This software is distributed on an AS IS basis, WITHOUT
30  * WARRANTY OF ANY KIND, either express or implied.
31  *
32  ************************************************************************/
33 
40 #ifndef ANALYSIS_HPP
41 #define ANALYSIS_HPP
42 
43 #include <string>
44 #include <vector>
45 
46 namespace gpmp {
48  public:
49  /* A numerical method for derivatives is used. This may be subject
50  to change, as an analytical method for calculating derivatives
51  will most likely be used in the future.
52  */
53  double numDiff(double (*function)(double), double x);
54  double numDiff_2(double (*function)(double), double x);
55  double numDiff_3(double (*function)(double), double x);
56 
57  double constantApproximation(double (*function)(double), double c);
58 
59  double linearApproximation(double (*function)(double), double c, double x);
60 
61  double
62  quadraticApproximation(double (*function)(double), double c, double x);
63 
64  double cubicApproximation(double (*function)(double), double c, double x);
65 
66  double numDiff(double (*function)(std::vector<double>),
67  std::vector<double> x,
68  int axis);
69 
70  double numDiff_2(double (*function)(std::vector<double>),
71  std::vector<double> x,
72  int axis1,
73  int axis2);
74 
75  double numDiff_3(double (*function)(std::vector<double>),
76  std::vector<double> x,
77  int axis1,
78  int axis2,
79  int axis3);
80 
81  double newtonRaphsonMethod(double (*function)(double),
82  double x_0,
83  double epoch_num);
84 
85  double
86  halleyMethod(double (*function)(double), double x_0, double epoch_num);
87 
88  double invQuadraticInterpolation(double (*function)(double),
89  std::vector<double> x_0,
90  double epoch_num);
91 
92  double eulerianMethod(double (*derivative)(double),
93  std::vector<double> q_0,
94  double p,
95  double h); // Euler's method for solving
96  // diffrential equations.
97 
98  double eulerianMethod(double (*derivative)(std::vector<double>),
99  std::vector<double> q_0,
100  double p,
101  double h); // Euler's method for solving
102  // diffrential equations.
103 
104  double growthMethod(double C,
105  double k,
106  double t); // General growth-based diffrential equations
107  // can be solved by seperation of variables.
108 
109  std::vector<double>
110  jacobian(double (*function)(std::vector<double>),
111  std::vector<double> x); // Indeed, for functions with scalar
112  // outputs the Jacobians will be vectors.
113 
114  std::vector<std::vector<double>>
115  hessian(double (*function)(std::vector<double>), std::vector<double> x);
116 
117  std::vector<std::vector<std::vector<double>>>
118  thirdOrderTensor(double (*function)(std::vector<double>),
119  std::vector<double> x);
120 
121  double constantApproximation(double (*function)(std::vector<double>),
122  std::vector<double> c);
123 
124  double linearApproximation(double (*function)(std::vector<double>),
125  std::vector<double> c,
126  std::vector<double> x);
127 
128  double quadraticApproximation(double (*function)(std::vector<double>),
129  std::vector<double> c,
130  std::vector<double> x);
131 
132  double cubicApproximation(double (*function)(std::vector<double>),
133  std::vector<double> c,
134  std::vector<double> x);
135 
136  double laplacian(double (*function)(std::vector<double>),
137  std::vector<double> x); // laplacian
138 
139  std::string
140  secondPartialDerivativeTest(double (*function)(std::vector<double>),
141  std::vector<double> x);
142 };
143 } // namespace gpmp
144 
145 #endif
double laplacian(double(*function)(std::vector< double >), std::vector< double > x)
double numDiff(double(*function)(double), double x)
double linearApproximation(double(*function)(std::vector< double >), std::vector< double > c, std::vector< double > x)
double numDiff_3(double(*function)(double), double x)
double quadraticApproximation(double(*function)(double), double c, double x)
std::vector< double > jacobian(double(*function)(std::vector< double >), std::vector< double > x)
double quadraticApproximation(double(*function)(std::vector< double >), std::vector< double > c, std::vector< double > x)
std::vector< std::vector< std::vector< double > > > thirdOrderTensor(double(*function)(std::vector< double >), std::vector< double > x)
double constantApproximation(double(*function)(std::vector< double >), std::vector< double > c)
double constantApproximation(double(*function)(double), double c)
double numDiff_2(double(*function)(std::vector< double >), std::vector< double > x, int axis1, int axis2)
std::vector< std::vector< double > > hessian(double(*function)(std::vector< double >), std::vector< double > x)
double eulerianMethod(double(*derivative)(double), std::vector< double > q_0, double p, double h)
double halleyMethod(double(*function)(double), double x_0, double epoch_num)
double numDiff(double(*function)(std::vector< double >), std::vector< double > x, int axis)
double growthMethod(double C, double k, double t)
double linearApproximation(double(*function)(double), double c, double x)
double cubicApproximation(double(*function)(std::vector< double >), std::vector< double > c, std::vector< double > x)
double numDiff_2(double(*function)(double), double x)
std::string secondPartialDerivativeTest(double(*function)(std::vector< double >), std::vector< double > x)
double eulerianMethod(double(*derivative)(std::vector< double >), std::vector< double > q_0, double p, double h)
double cubicApproximation(double(*function)(double), double c, double x)
double invQuadraticInterpolation(double(*function)(double), std::vector< double > x_0, double epoch_num)
double newtonRaphsonMethod(double(*function)(double), double x_0, double epoch_num)
double numDiff_3(double(*function)(std::vector< double >), std::vector< double > x, int axis1, int axis2, int axis3)
The source C++ openGPMP namespace.
list C
Definition: linalg.py:24