|
Richards
Solving The Richards equation with temporally periodic surface boundary conditions
|
Go to the documentation of this file.
6 #define YRSEC 31557600.0
8 double max (
double *a,
long n) {
12 for (i=0; i<n; i++)
if (a[i] < r) r = a[i];
14 for (i=0; i<n; i++)
if (a[i] > r) r = a[i];
22 for (i=0; i<n; i++)
if (fabs(a[i]) > r) r = fabs(a[i]);
26 double min (
double *a,
long n) {
30 for (i=0; i<n; i++)
if (a[i] > r) r = a[i];
32 for (i=0; i<n; i++)
if (a[i] < r) r = a[i];
36 std::vector<double>
linspace (
double a,
double b,
long n) {
41 printf(
"FAILURE: cannot linspace with a single value if the range limits are not identical");
44 std::vector<double> v(1, a);
48 double h = (b - a)/(n - 1);
50 std::vector<double> v;
51 for (
long i=0; i<n; i++)
52 v.push_back( a + i*h );
57 std::vector<double>
logspace (
double a,
double b,
long n) {
62 printf(
"FAILURE: cannot logspace with a single value if the range limits are not identical");
65 std::vector<double> v(1, pow(10, a));
69 double h = (b - a)/(n - 1);
71 std::vector<double> v;
72 for (
long i=0; i<n; i++)
73 v.push_back( pow(10, a + i*h) );
double min(double *a, long n)
find min of array
double max(double *a, long n)
find max of array
std::vector< double > logspace(double a, double b, long n)
create an logarithmically spaced vector of values over a range
double absmax(double *a, long n)
find max magnitude of array
std::vector< double > linspace(double a, double b, long n)
create an evenly spaced vector of values over a range