Richards
Solving The Richards equation with temporally periodic surface boundary conditions
Functions
util.h File Reference
#include <cmath>
#include <vector>
#include <cstdio>
#include <cstdlib>

Go to the source code of this file.

Functions

template<class T >
void swap (T *a, T *b)
 swaps two variables
 
double max (double *a, long n)
 find max of array
 
double absmax (double *a, long n)
 find max magnitude of array
 
double min (double *a, long n)
 find min of array
 
template<class T >
double maxreldif (T a, T b, long n)
 finds the maximum relative difference between two arrays/vectors
 
template<class T >
long argclose (T a, double b, long n)
 find index of value in array closest to a number
 
std::vector< double > linspace (double a, double b, long n)
 create an evenly spaced vector of values over a range
 
std::vector< double > logspace (double a, double b, long n)
 create an logarithmically spaced vector of values over a range
 
template<class T >
std::vector< T > subsample (std::vector< T > v, unsigned long n)
 subsample a vector, keeping first and last elements More...
 

Function Documentation

◆ subsample()

template<class T >
std::vector<T> subsample ( std::vector< T >  v,
unsigned long  n 
)

subsample a vector, keeping first and last elements

Parameters
[in]vvector to subsample
[in]napproximate length target

Definition at line 71 of file util.h.