Various functions | |
template<class T> | |
T | prod (const Array< T > &t) |
Return the product of the Array elements. | |
template<class T, class F> | |
Array< T > & | applyFunction (F *op, const Array< T > &t) |
template<class T, class F> | |
Array< T > & | applyFunction (F *op, const Array< T > &t, const Array< T > &t2) |
Applies the function op to all the elements of the array t. Returns an array of type T. | |
template<class T, class F> | |
Array< T > & | applyFunction (F *op, const Array< T > &t, const Array< T > &t2, const Array< T > &t3) |
Applies the function op to all the elements of the array t. Returns an array of type T. | |
template<class T> | |
T | sum (const Array< T > &t) |
Return the sum of the Array elements. | |
template<class T> | |
largest< float, T >::type | mean (const Array< T > &t) |
Return the mean of the Array elements. | |
template<class T> | |
largest< float, T >::type | sqmean (const Array< T > &t) |
Return the quadratic mean of the Array elements. | |
template<class T> | |
long | whereMin (const Array< T > &t) |
template<class T> | |
T | min (const Array< T > &t) |
Return the min of the Array elements. | |
template<class T> | |
long | whereMax (const Array< T > &t) |
template<class T> | |
T | max (const Array< T > &t) |
Return the max of the Array elements. | |
template<class T1, class T2> | |
largest< T1, T2 >::type | dot (const Array< T1 > &t1, const Array< T2 > &t2) |
Return the scalar product of two vectors. | |
template<class T> | |
largest< float, T >::type | norm (const Array< T > &t) |
Return the euclidian norm. | |
template<class T> | |
Array< T > & | abs (const Array< T > &t) |
Return an Array containing the absolute value of each elements. | |
template<class T> | |
Array< T > & | floor (const Array< T > &t) |
Return an Array containing the floor value of each elements. | |
template<class T> | |
Array< T > & | ceil (const Array< T > &t) |
Return an Array containing the ceil value of each elements. | |
Trigonometric functions | |
template<class T> | |
Array< typename idil::largest < float, T >::type > & | sin (const Array< T > &t) |
template<class T> | |
Array< typename idil::largest < float, T >::type > & | cos (const Array< T > &t) |
template<class T> | |
Array< typename idil::largest < float, T >::type > & | tan (const Array< T > &t) |
template<class T> | |
Array< typename idil::largest < float, T >::type > & | asin (const Array< T > &t) |
template<class T> | |
Array< typename idil::largest < float, T >::type > & | acos (const Array< T > &t) |
template<class T> | |
Array< typename idil::largest < float, T >::type > & | atan (const Array< T > &t) |
template<class T> | |
Array< typename idil::largest < float, T >::type > & | sinc (const Array< T > &t) |
Hyperbolic functions | |
template<class T> | |
Array< typename idil::largest < float, T >::type > & | sinh (const Array< T > &t) |
template<class T> | |
Array< typename idil::largest < float, T >::type > & | cosh (const Array< T > &t) |
template<class T> | |
Array< typename idil::largest < float, T >::type > & | tanh (const Array< T > &t) |
template<class T> | |
Array< typename idil::largest < float, T >::type > & | asinh (const Array< T > &t) |
template<class T> | |
Array< typename idil::largest < float, T >::type > & | acosh (const Array< T > &t) |
template<class T> | |
Array< typename idil::largest < float, T >::type > & | atanh (const Array< T > &t) |
Exp-Log functions | |
template<class T> | |
Array< typename idil::largest < float, T >::type > & | exp (const Array< T > &t) |
template<class T> | |
Array< typename idil::largest < float, T >::type > & | log (const Array< T > &t) |
template<class T> | |
Array< typename idil::largest < float, T >::type > & | log10 (const Array< T > &t) |
template<class T> | |
Array< typename idil::largest < float, T >::type > & | sqrt (const Array< T > &t) |
Curves & trajectories | |
template<class T> | |
Array< T > & | curvAbscissa (Array< T > &x, Array< T > &y) |
Return the curvilinear abscissa along a trajectory defined by the points . | |
template<class T> | |
Array< T > & | angle (Array< T > &x, Array< T > &y) |
Return the angle along the curve with respect to the x axis. | |
template<class T> | |
Array< T > & | derivative (Array< T > &x, Array< T > &y) |
Return the derivative along the curve . | |
Histograms | |
template<class T> | |
Array< long > & | histogram (const Array< T > &t, long nbin=-1, float mn=0, float mx=0) |
Returns the histogram of an Array. | |
template<class T> | |
Array< float > & | histobins (const Array< T > &t, long nbin=-1, float mn=0, float mx=0) |
Returns the bins positions. | |
Functions specific to complex numbers | |
template<class T> | |
Array< complex< T > > & | cplx (const Array< T > &t1, const Array< T > &t2) |
Return an complex Array where the real part is t1 and the imaginary is t2. | |
template<class T> | |
Array< complex< T > > & | cplx (const Array< T > &t) |
Return an complex Array where the real part is t and the imaginary is null. | |
template<class T> | |
Array< T > & | real (const Array< complex< T > > &t) |
Return an Array containing the real part of each elements. | |
template<class T> | |
Array< T > & | imag (const Array< complex< T > > &t) |
Return an Array containing the imaginary part of each elements. | |
template<class T> | |
Array< typename largest< float, T >::type > & | mod (const Array< complex< T > > &t) |
Return an Array containing the complex modulus of each elements. | |
template<class T> | |
Array< typename largest< float, T >::type > & | arg (const Array< complex< T > > &t) |
Return an Array containing the argument of each elements. | |
template<class T> | |
Array< complex< T > > & | conjugate (const Array< complex< T > > &t) |
Return an Array containing the complexe conjugate of each elements. | |
template<class T> | |
Array< complex< typename largest< float, T >::type > > & | exp_i (const Array< T > &t) |
Return an Array containing the exp_i of each elements. | |
Linear Algebra | |
template<class T> | |
T | trace (Array< T > &A) |
Returns the trace of a square matrix. | |
template<class T> | |
double | determinant (Array< T > &A) |
Returns the determinant of a square matrix The function uses the GSL LU decomposition. | |
template<class T, class T2> | |
Array< double > & | matmul (Array< T > &A, Array< T2 > &B) |
Matrix multiplication. | |
template<class T> | |
Array< double > & | invert (Array< T > &A) |
Returns the invert of a square matrix The function uses the GSL LU decomposition. | |
template<class T, class T2, class T3> | |
void | diagonalize (Array< T > &matrix, Array< T2 > &eigenvectors, Array< T3 > &eigenvalues) |
Matrix Diagonalization. | |
template<class T, class T2> | |
Array< double > & | solve (Array< T > &A, Array< T2 > &Y) |
Solve a linear system A X = Y, return X. | |
Random numbers using GSL | |
template<class T> | |
Array< T > & | randomFlat (long n) |
Return an Array of n random values in ]0;1[. You must precise the output type. Ex: random<float>(1000). | |
template<class T> | |
Array< T > & | randomExp (long n, double mu) |
Return an Array of n random on a Rayleigh distribution. You must precise the output type. | |
template<class T> | |
Array< T > & | randomGaussian (long n, double mu, double sigma) |
Return an Array of n random on a Gauusian distribution. You must precise the output type. | |
template<class T> | |
Array< T > & | randomRayleigh (long n, double sigma) |
Return an Array of n random on a Rayleigh distribution. You must precise the output type. | |
Mathematical array functions using GSL | |
template<class T> | |
Array< typename idil::largest < float, T >::type > & | bessel (const Array< T > &t, int n) |
Apply the cylindrical Bessel function on each element and return the result. | |
template<class T> | |
Array< typename idil::largest < float, T >::type > & | airy (Array< T > &t) |
Apply the Airy function on each element and return the result. | |
template<class T> | |
Array< typename idil::largest < float, T >::type > & | erf (Array< T > &t) |
Apply the error function erf on each element and return the result. | |
template<class T> | |
Array< typename idil::largest < float, T >::type > & | gamma (Array< T > &t) |
Apply the the gamma function on each element and return the result. |
A few mathematical functions have been directly implemented for the class Array. More mathematical functions are available with the GSL Library, via IDIL_GSL.h.
Example:
Array<float> af1, af2; af1 = findgen(1000)/100.; af2 = sin(af1);
!
Array<typename idil::largest<float,T>::type>& acos | ( | const Array< T > & | t | ) | [inline] |
Returns an Array containing the arc cosinus of each elements.
Array<typename idil::largest<float,T>::type>& acosh | ( | const Array< T > & | t | ) | [inline] |
Returns an Array containing the acosh of each elements.
Applies the function op to all the elements of the array t. Returns an array of type T.
Array<typename idil::largest<float,T>::type>& asin | ( | const Array< T > & | t | ) | [inline] |
Returns an Array containing the arc sinus of each elements.
Array<typename idil::largest<float,T>::type>& asinh | ( | const Array< T > & | t | ) | [inline] |
Returns an Array containing the asinh of each elements.
Array<typename idil::largest<float,T>::type>& atan | ( | const Array< T > & | t | ) | [inline] |
Returns an Array containing the arc tan of each elements.
Array<typename idil::largest<float,T>::type>& atanh | ( | const Array< T > & | t | ) | [inline] |
Returns an Array containing the atanh of each elements.
Array<typename idil::largest<float,T>::type>& cos | ( | const Array< T > & | t | ) | [inline] |
Returns an Array containing the cos of each elements.
Array<typename idil::largest<float,T>::type>& cosh | ( | const Array< T > & | t | ) | [inline] |
Returns an Array containing the cosh of each elements.
void diagonalize | ( | Array< T > & | matrix, | |
Array< T2 > & | eigenvectors, | |||
Array< T3 > & | eigenvalues | |||
) | [inline] |
Matrix Diagonalization.
matrix | : matrix to diaganalize, | |
eigenvectors | : matrix which will contain the eigenvectors. | |
eigenvalues | : vector which will contain the eigenvalues. We use C-style conventions for matrix index: A(column, line). AxB -> C(b1,a2). |
Array<typename idil::largest<float,T>::type>& exp | ( | const Array< T > & | t | ) | [inline] |
Returns an Array containing the exp of each elements.
Array<float>& histobins | ( | const Array< T > & | t, | |
long | nbin = -1 , |
|||
float | mn = 0 , |
|||
float | mx = 0 | |||
) | [inline] |
Returns the bins positions.
t | : Array, any type and dimension, | |
nbin | : number of bins in the histogram. | |
mn | : low bound of the histogram, | |
mx | : high bound of the histogram. If nbin is negative, it is set to the default value (30). If mx<=mn, the limits are calculated from the min and max values of the array t. |
Array<long>& histogram | ( | const Array< T > & | t, | |
long | nbin = -1 , |
|||
float | mn = 0 , |
|||
float | mx = 0 | |||
) | [inline] |
Returns the histogram of an Array.
t | : Array, any type and dimension, | |
nbin | : number of bins in the histogram. | |
mn | : low bound of the histogram, | |
mx | : high bound of the histogram. If nbin is negative, it is set to the default value (30). If mx<=mn, the limits are calculated from the min and max values of the array t. |
Array<typename idil::largest<float,T>::type>& log | ( | const Array< T > & | t | ) | [inline] |
Returns an Array containing the log of each elements.
Array<typename idil::largest<float,T>::type>& log10 | ( | const Array< T > & | t | ) | [inline] |
Returns an Array containing the log10 of each elements.
Matrix multiplication.
A | : matrix (a1,a2), | |
B | : matrix (b1,b2). We use C-style conventions for matrix index: A(column, line). AxB -> C(b1,a2). Example: // [ 0.11 0.12 0.13 ] [ 1011 1012 ] [ 367.76 368.12 ] // [ 0.21 0.22 0.23 ] [ 1021 1022 ] = [ 674.06 674.72 ] // [ 1031 1032 ] Array<float> A,B,C; A = vector(0.11, 0.12, 0.13, 0.21, 0.22, 0.23); A.setdim(3,2); B = vector(1011, 1012, 1021, 1022, 1031, 1032); B.setdim(2,3); C = matmul(A,B); |
Array<typename idil::largest<float,T>::type>& sin | ( | const Array< T > & | t | ) | [inline] |
Returns an Array containing the sin of each elements.
Array<typename idil::largest<float,T>::type>& sinc | ( | const Array< T > & | t | ) | [inline] |
Returns an Array containing the sin cardinal of each elements.
Array<typename idil::largest<float,T>::type>& sinh | ( | const Array< T > & | t | ) | [inline] |
Returns an Array containing the sinh of each elements.
Solve a linear system A X = Y, return X.
A | : square matrix, | |
Y | : vector. Solve uses the GSL LU decomposition. |
Array<typename idil::largest<float,T>::type>& sqrt | ( | const Array< T > & | t | ) | [inline] |
Returns an Array containing the square root of each elements.
Array<typename idil::largest<float,T>::type>& tan | ( | const Array< T > & | t | ) | [inline] |
Returns an Array containing the tan of each elements.
Array<typename idil::largest<float,T>::type>& tanh | ( | const Array< T > & | t | ) | [inline] |
Returns an Array containing the tanh of each elements.