|
Richards
Solving The Richards equation with temporally periodic surface boundary conditions
|
Go to the documentation of this file.
21 double max (
double *a,
long n);
24 double absmax (
double *a,
long n);
27 double min (
double *a,
long n);
33 for (
long i=0; i<n; i++) {
34 rd = fabs(a[i] - b[i])/fabs(b[i]);
50 if (fabs(a[i] - b) < m) {
60 std::vector<double>
linspace (
double a,
double b,
long n);
63 std::vector<double>
logspace (
double a,
double b,
long n);
71 std::vector<T>
subsample (std::vector<T> v,
unsigned long n) {
74 unsigned long size = v.size();
75 unsigned long step = size/n;
77 if ( (step == 0) || (step == 1) ) {
79 std::vector<T> r(v.begin(), v.end());
87 for (i=step; i<size; i+=step) r.push_back(v[i]);
88 if (i < size - 1) r.push_back( v.back() );
std::vector< double > logspace(double a, double b, long n)
create an logarithmically spaced vector of values over a range
std::vector< double > linspace(double a, double b, long n)
create an evenly spaced vector of values over a range
double max(double *a, long n)
find max of array
double min(double *a, long n)
find min of array
double absmax(double *a, long n)
find max magnitude of array
void swap(T *a, T *b)
swaps two variables
std::vector< T > subsample(std::vector< T > v, unsigned long n)
subsample a vector, keeping first and last elements
double maxreldif(T a, T b, long n)
finds the maximum relative difference between two arrays/vectors
long argclose(T a, double b, long n)
find index of value in array closest to a number