OpenCMISS-Iron Internal API Documentation
maths Module Reference

This module contains all mathematics support routines. More...

## Data Types

interface  coth
Returns hyperbolic cotangent of argument. More...

interface  cross_product
Calculates the vector cross product of two vectors. More...

interface  crossproduct
Calculates the vector cross product of two vectors. More...

interface  d_cross_product
Calculates the the vector cross product of A*B in C and the N derivatives, D_C, of the vector cross product given the derivatives D_A and D_B of A and B. More...

interface  dcrossproduct
Calculates the the vector cross product of a x b in c and the n derivatives, dc, of the vector cross product given the derivatives da and db of a and b. More...

interface  determinant
Returns the determinant of a matrix. More...

interface  edp
Calculates the elliptic integral of the second kind - E(m). More...

interface  eigenvalue
Returns the eigenvalues of a matrix. More...

interface  eigenvector
Returns the eigenvectors of a matrix. More...

interface  i0
Calculates the modified Bessel function of the first kind of order 0 using the approximation of Abromowitz and Stegun. More...

interface  i1
Calculates the modified Bessel function of the first kind of order 1 using the approximation of Abromowitz and Stegun. More...

interface  identitymatrix
Returns the identity matrix. More...

interface  invert
Returns the inverse of a matrix. More...

interface  k0
Calculates the modified Bessel function of the second kind of order 0 using the approximation of Abromowitz and Stegun. More...

interface  k1
Calculates the modified Bessel function of the second kind of order 1 using the approximation of Abromowitz and Stegun. More...

interface  kdp
Calculates the elliptic integral of the first kind - K(m). More...

interface  l2norm
Returns the L2 norm of a vector. More...

interface  matrix_product
Calculates and returns the matrix-product A*B in the matrix C. More...

interface  matrix_transpose
Returns the transpose of a matrix A in A^T. More...

interface  matrix_vector_product
Calculates and returns the matrix-vector-product A*b in the vector c. More...

interface  matrixproduct
Calculates and returns the matrix-product A*B in the matrix C. More...

interface  matrixproducttranspose
Calculates and returns the matrix-product-transpose A*B^T in the matrix C. More...

interface  matrixtranspose
Returns the transpose of a matrix A in A^T. More...

interface  matrixtransposeproduct
Calculates and returns the matrix-transpose product A^T*B in the matrix C. More...

interface  matrixtransposevectorproduct
Calculates and returns the matrix-transpose vector-product A^T*b in the vector c. More...

interface  matrixvectorproduct
Calculates and returns the matrix-vector-product A*b in the vector c. More...

interface  norm_cross_product
Calculates the normalised vector cross product of two vectors. More...

interface  normalise
Normalises a vector. More...

interface  normcrossproduct
Calculates the normalised vector cross product of two vectors. More...

interface  solve_small_linear_system
Solves a small linear system Ax=b. More...

interface  solvesmalllinearsystem
Solves a small linear system Ax=b. More...

## Functions/Subroutines

subroutine crossproductintg (a, b, c, err, error,)
Calculates and returns the vector cross-product of the integer vectors a x b in c. More...

subroutine crossproductsp (a, b, c, err, error,)
Calculates and returns the vector cross-product of the single precision vectors a x b in c. More...

subroutine crossproductdp (a, b, c, err, error,)
Calculates and returns the vector cross-product of the double precision vectors a x b in c. More...

subroutine dcrossproductintg (n, a, b, c, da, db, dc, err, error,)
Calculates the the vector cross product of a x b in c and the n derivatives, dc, of the vector cross product given the derivatives da and db of a and b for integer vectors. More...

subroutine dcrossproductsp (n, a, b, c, da, db, dc, err, error,)
Calculates the the vector cross product of a x b in c and the n derivatives, dc, of the vector cross product given the derivatives da and db of a and b for single precision vectors. More...

subroutine dcrossproductdp (n, a, b, c, da, db, dc, err, error,)
Calculates the the vector cross product of a x b in c and the n derivatives, dc, of the vector cross product given the derivatives da and db of a and b for double precision vectors. More...

subroutine matrixvectorproductsp (A, b, c, err, error,)
Calculates and returns the matrix-vector product of the single precision vector A*b in c. More...

subroutine matrixvectorproductdp (A, b, c, err, error,)
Calculates and returns the matrix-vector product of the double precision vectir A*b in c. More...

subroutine matrixtransposevectorproductsp (A, b, c, err, error,)
Calculates and returns the matrix-transpose vector product of the single precision vector A^T*b in c. More...

subroutine matrixtransposevectorproductdp (A, b, c, err, error,)
Calculates and returns the matrix-transpose vector product of the double precision vector A^T*b in c. More...

integer(intg) function determinantfullintg (A, err, error)
Returns the determinant of a full integer matrix A. More...

real(sp) function determinantfullsp (A, err, error)
Returns the determinant of a full single precision matrix A. More...

real(dp) function determinantfulldp (A, err, error)
Returns the determinant of a full double precision matrix A. More...

pure real(dp) function edpdp (x)
Calculates the elliptic integral of the second kind - E(m), for a double precision argument. More...

pure real(sp) function edpsp (x)
Calculates the elliptic integral of the second kind - E(m), for a single precision argument. More...

subroutine eigenvaluefullsp (A, eValues, err, error,)
Returns the eigenvalues of a full single precision matrix A. More...

subroutine eigenvaluefulldp (A, eValues, err, error,)
Returns the eigenvalues of a full double precision matrix A. More...

subroutine eigenvectorfullsp (A, eValue, eVector, err, error,)
Returns the normalised eigenvector of a full single precision symmetric matrix A that corresponds to the eigenvalue eValue. More...

subroutine eigenvectorfulldp (A, eValue, eVector, err, error,)
Returns the normalised eigenvector of a full double precision symmetric matrix A that corresponds to the eigenvalue eValue. More...

pure real(dp) function i0dp (x)
Calculates the modified Bessel function of the first kind of order 0 using the approximation of Abromowitz and Stegun, for a double precision argument. More...

pure real(sp) function i0sp (x)
Calculates the modified Bessel function of the first kind of order 0 using the approximation of Abromowitz and Stegun, for a single precision argument. More...

pure real(dp) function i1dp (x)
Calculates the modified Bessel function of the first kind of order 1 using the approximation of Abromowitz and Stegun, for a double precision argument. More...

pure real(sp) function i1sp (x)
Calculates the modified Bessel function of the first kind of order 1 using the approximation of Abromowitz and Stegun, for a single precision argument. More...

subroutine identitymatrixsp (A, err, error,)
Returns an identity matrix. More...

subroutine identitymatrixdp (A, err, error,)
Returns an identity matrix. More...

subroutine invertfullsp (A, B, det, err, error,)
Inverts a full single precision matrix A to give matrix B and returns the determinant of A in det. More...

subroutine invertfulldp (A, B, det, err, error,)
Inverts a full double precision matrix A to give matrix B and returns the determinant of A in det. More...

pure real(dp) function k0dp (x)
Calculates the modified Bessel function of the second kind of order 1 using the approximation of Abromowitz and Stegun, for a double precision argument. More...

pure real(sp) function k0sp (x)
Calculates the modified Bessel function of the second kind of order 0 using the approximation of Abromowitz and Stegun, for a single precision argument. More...

pure real(dp) function k1dp (x)
Calculates the modified Bessel function of the second kind of order 1 using the approximation of Abromowitz and Stegun, for a double precision argument. More...

pure real(sp) function k1sp (x)
Calculates the modified Bessel function of the second kind of order 1 using the approximation of Abromowitz and Stegun, for a single precision argument. More...

pure real(dp) function kdpdp (x)
Calculates the elliptic integral of the first kind - K(m), for a double precision argument. More...

pure real(sp) function kdpsp (x)
Calculates the elliptic integral of the first kind - K(m), for a single precision argument. More...

pure real(sp) function l2normsp (a)
Returns the L2-norm of the single precision vector a. More...

real(dp) function l2normdp (A)
Returns the L2-norm of the double precision vector a. More...

subroutine matrixproductsp (A, B, C, err, error,)
Calculates and returns the matrix-product of the single precision matrix A*B in C for single precision arguments. More...

subroutine matrixproductdp (A, B, C, err, error,)
Calculates and returns the matrix-product of the double precision matrix A*B in C. More...

subroutine matrixtransposeproductsp (A, B, C, err, error,)
Calculates and returns the matrix-transpose product of the single precision matrix A^T*B in C for single precision arguments. More...

subroutine matrixtransposeproductdp (A, B, C, err, error,)
Calculates and returns the matrix-transpose product of the double precision matrix A^T*B in C for double precision arguments. More...

subroutine matrixproducttransposesp (A, B, C, err, error,)
Calculates and returns the matrix-product-transpose of the single precision matrix A*B^T in C for single precision arguments. More...

subroutine matrixproducttransposedp (A, B, C, err, error,)
Calculates and returns the matrix-product-transpose of the double precision matrix A*B^T in C. More...

subroutine matrixtransposesp (A, AT, err, error,)
Returns the transpose of a single precision matrix A in AT. More...

subroutine matrixtransposedp (A, AT, err, error,)
Returns the transpose of a double precision matrix A in AT. More...

real(sp) function, dimension(size(a, 1)) normalisesp (a, err, error)
Normalises a real single precision vector a. More...

real(dp) function, dimension(size(a, 1)) normalisedp (a, err, error)
Normalises a real double precision vector a. More...

subroutine normcrossproductsp (a, b, c, err, error,)
Calculates and returns the normalised vector cross-prouct of the single precision vectors a x b in c. More...

subroutine normcrossproductdp (a, b, c, err, error,)
Calculates and returns the normalised vector cross-prouct of the double precision vectors a x b in c. More...

subroutine solvesmalllinearsystemsp (A, x, b, err, error,)
Finds the solution to a small single precision linear system Ax=b. More...

subroutine solvesmalllinearsystemdp (A, x, b, err, error,)
Finds the solution to a small double precision linear system Ax=b. More...

real(sp) function cothsp (a)
Calculates single precision hyperbolic cotangent function. More...

real(dp) function cothdp (a)
Calculates double precision hyperbolic cotangent function. More...

subroutine, public spline_cubic_set (n, t, y, ibcbeg, ybcbeg, ibcend, ybcend, ypp, err, error,)
Calculates second derivatives of a cubic spline function for a tabulated function y(x). Call spline_cubic_val to evaluate at t values. algorithm adapted from John Burkhardt's spline_cubic_set routine from the SPLINE package (http://people.sc.fsu.edu/~jburkardt/f_src/spline/spline.html) More...

subroutine, public s3_fs (a1, a2, a3, n, b, x, err, error,)
S3_FS factors and solves a tridiagonal linear system. algorithm adapted from John Burkhardt's s3_fs routine from the SPLINE package (http://people.sc.fsu.edu/~jburkardt/f_src/spline/spline.html) More...

subroutine, public spline_cubic_val (n, t, y, ypp, tval, yval, ypval, yppval, err, error,)
Evaluates a cubic spline at a specified point. First call spline_cubic_set to calculate derivatives algorithm adapted from John Burkhardt's spline_cubic_val routine from the SPLINE package (http://people.sc.fsu.edu/~jburkardt/f_src/spline/spline.html) More...

## Detailed Description

This module contains all mathematics support routines.

## Function/Subroutine Documentation

 real(dp) function maths::cothdp ( real(dp), intent(in) a )
private

Calculates double precision hyperbolic cotangent function.

Parameters
 [in] a argument to perform coth() on

Definition at line 2556 of file maths.f90.

 real(sp) function maths::cothsp ( real(sp), intent(in) a )
private

Calculates single precision hyperbolic cotangent function.

Parameters
 [in] a argument to perform coth() on

Definition at line 2538 of file maths.f90.

 subroutine maths::crossproductdp ( real(dp), dimension(:), intent(in) a, real(dp), dimension(:), intent(in) b, real(dp), dimension(:), intent(out) c, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Calculates and returns the vector cross-product of the double precision vectors a x b in c.

Parameters
 [in] a The first vector in the cross product [in] b The second vector in the cross product [out] c On exit, the cross product of the first and second vectors [out] err The error code [out] error The error string

Definition at line 352 of file maths.f90.

References base_routines::enters(), and base_routines::exits().

 subroutine maths::crossproductintg ( integer(intg), dimension(:), intent(in) a, integer(intg), dimension(:), intent(in) b, integer(intg), dimension(:), intent(out) c, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Calculates and returns the vector cross-product of the integer vectors a x b in c.

Parameters
 [in] a The first vector in the cross product [in] b The second vector in the cross product [out] c On exit, the cross product of the first and second vectors [out] err The error code [out] error The error string

Definition at line 270 of file maths.f90.

References base_routines::enters(), and base_routines::exits().

 subroutine maths::crossproductsp ( real(sp), dimension(:), intent(in) a, real(sp), dimension(:), intent(in) b, real(sp), dimension(:), intent(out) c, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Calculates and returns the vector cross-product of the single precision vectors a x b in c.

Parameters
 [in] a The first vector in the cross product [in] b The second vector in the cross product [out] c On exit, the cross product of the first and second vectors [out] err The error code [out] error The error string

Definition at line 311 of file maths.f90.

References base_routines::enters(), and base_routines::exits().

 subroutine maths::dcrossproductdp ( integer(intg), intent(in) n, real(dp), dimension(:), intent(in) a, real(dp), dimension(:), intent(in) b, real(dp), dimension(:), intent(out) c, real(dp), dimension(:,:), intent(in) da, real(dp), dimension(:,:), intent(in) db, real(dp), dimension(:,:), intent(out) dc, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Calculates the the vector cross product of a x b in c and the n derivatives, dc, of the vector cross product given the derivatives da and db of a and b for double precision vectors.

Parameters
 [in] n The number of derivatives [in] a The a vector [in] b The b vector [out] c On exit, the cross product of a x b [in] da The n derivatives of a [in] db The n derivatives of b [out] dc On exit, the derivatives of c [out] err The error code [out] error The error string

Definition at line 502 of file maths.f90.

References base_routines::enters(), and base_routines::exits().

 subroutine maths::dcrossproductintg ( integer(intg), intent(in) n, integer(intg), dimension(:), intent(in) a, integer(intg), dimension(:), intent(in) b, integer(intg), dimension(:), intent(out) c, integer(intg), dimension(:,:), intent(in) da, integer(intg), dimension(:,:), intent(in) db, integer(intg), dimension(:,:), intent(out) dc, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Calculates the the vector cross product of a x b in c and the n derivatives, dc, of the vector cross product given the derivatives da and db of a and b for integer vectors.

Parameters
 [in] n The number of derivatives [in] a The a vector [in] b The b vector [out] c On exit, the cross product of a x b [in] da The n derivatives of a [in] db The n derivatives of b [out] dc On exit, the derivatives of c [out] err The error code [out] error The error string

Definition at line 394 of file maths.f90.

References base_routines::enters(), and base_routines::exits().

 subroutine maths::dcrossproductsp ( integer(intg), intent(in) n, real(sp), dimension(:), intent(in) a, real(sp), dimension(:), intent(in) b, real(sp), dimension(:), intent(out) c, real(sp), dimension(:,:), intent(in) da, real(sp), dimension(:,:), intent(in) db, real(sp), dimension(:,:), intent(out) dc, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Calculates the the vector cross product of a x b in c and the n derivatives, dc, of the vector cross product given the derivatives da and db of a and b for single precision vectors.

Parameters
 [in] n The number of derivatives [in] a The a vector [in] b The b vector [out] c On exit, the cross product of a x b [in] da The n derivatives of a [in] db The n derivatives of b [out] dc On exit, the derivatives of c [out] err The error code [out] error The error string

Definition at line 448 of file maths.f90.

References base_routines::enters(), and base_routines::exits().

 real(dp) function maths::determinantfulldp ( real(dp), dimension(:,:), intent(in) A, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Returns the determinant of a full double precision matrix A.

Parameters
 [in] a The matrix to find the determinant of [out] err The error code [out] error The error string

Definition at line 801 of file maths.f90.

References base_routines::enters(), and base_routines::exits().

 integer(intg) function maths::determinantfullintg ( integer(intg), dimension(:,:), intent(in) A, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Returns the determinant of a full integer matrix A.

Parameters
 [in] a The matrix to find the determinant of [out] err The error code [out] error The error string

Definition at line 719 of file maths.f90.

References base_routines::enters(), and base_routines::exits().

 real(sp) function maths::determinantfullsp ( real(sp), dimension(:,:), intent(in) A, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Returns the determinant of a full single precision matrix A.

Parameters
 [in] a The matrix to find the determinant of [out] err The error code [out] error The error string

Definition at line 760 of file maths.f90.

References base_routines::enters(), and base_routines::exits().

 pure real(dp) function maths::edpdp ( real(dp), intent(in) x )
private

Calculates the elliptic integral of the second kind - E(m), for a double precision argument.

Parameters
 [in] x The value to evaluate the function at

Definition at line 842 of file maths.f90.

 pure real(sp) function maths::edpsp ( real(sp), intent(in) x )
private

Calculates the elliptic integral of the second kind - E(m), for a single precision argument.

Parameters
 [in] x The value to evaluate the function at

Definition at line 873 of file maths.f90.

 subroutine maths::eigenvaluefulldp ( real(dp), dimension(:,:), intent(in) A, real(dp), dimension(:), intent(out) eValues, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Returns the eigenvalues of a full double precision matrix A.

Parameters
 [in] a The matrix to find the eigenvalues of [out] evalues On exit, the eigenvalues of the matrix [out] err The error code [out] error The error string

Definition at line 993 of file maths.f90.

 subroutine maths::eigenvaluefullsp ( real(sp), dimension(:,:), intent(in) A, real(sp), dimension(:), intent(out) eValues, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Returns the eigenvalues of a full single precision matrix A.

Parameters
 [in] a The matrix to find the eignenvalues for [out] evalues On exit, the eignevalues [out] err The error code [out] error The error string

Definition at line 905 of file maths.f90.

 subroutine maths::eigenvectorfulldp ( real(dp), dimension(:,:), intent(in) A, real(dp), intent(in) eValue, real(dp), dimension(:), intent(out) eVector, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Returns the normalised eigenvector of a full double precision symmetric matrix A that corresponds to the eigenvalue eValue.

Parameters
 [in] a The matrix to find the eignevectors for [in] evalue The eigenvalue to find the eignevector for [out] evector On exit, the eigenvector corresponding the the eigenvalue [out] err The error code [out] error The error string

Definition at line 1168 of file maths.f90.

 subroutine maths::eigenvectorfullsp ( real(sp), dimension(:,:), intent(in) A, real(sp), intent(in) eValue, real(sp), dimension(:), intent(out) eVector, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Returns the normalised eigenvector of a full single precision symmetric matrix A that corresponds to the eigenvalue eValue.

Parameters
 [in] a The matrix to find the eignevectors for [in] evalue The eigenvalue to find the eignevector for [out] evector On exit, the eigenvector corresponding the the eigenvalue [out] err The error code [out] error The error string

Definition at line 1081 of file maths.f90.

 pure real(dp) function maths::i0dp ( real(dp), intent(in) x )
private

Calculates the modified Bessel function of the first kind of order 0 using the approximation of Abromowitz and Stegun, for a double precision argument.

Parameters
 [in] x The value to evaluate the function at

Definition at line 1256 of file maths.f90.

 pure real(sp) function maths::i0sp ( real(sp), intent(in) x )
private

Calculates the modified Bessel function of the first kind of order 0 using the approximation of Abromowitz and Stegun, for a single precision argument.

Parameters
 [in] x The value to evaluate the function at

Definition at line 1287 of file maths.f90.

 pure real(dp) function maths::i1dp ( real(dp), intent(in) x )
private

Calculates the modified Bessel function of the first kind of order 1 using the approximation of Abromowitz and Stegun, for a double precision argument.

Parameters
 [in] x The value to evaluate the function at

Definition at line 1318 of file maths.f90.

 pure real(sp) function maths::i1sp ( real(sp), intent(in) x )
private

Calculates the modified Bessel function of the first kind of order 1 using the approximation of Abromowitz and Stegun, for a single precision argument.

Parameters
 [in] x The value to evaluate the function at

Definition at line 1349 of file maths.f90.

 subroutine maths::identitymatrixdp ( real(dp), dimension(:,:), intent(out) A, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Returns an identity matrix.

Parameters
 [out] a On exit, the identity matrix [out] err The error code [out] error The error string

Definition at line 1431 of file maths.f90.

References base_routines::enters(), and base_routines::exits().

 subroutine maths::identitymatrixsp ( real(sp), dimension(:,:), intent(out) A, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Returns an identity matrix.

Parameters
 [out] a On exit, the identity matrix [out] err The error code [out] error The error string

Definition at line 1379 of file maths.f90.

References base_routines::enters(), and base_routines::exits().

 subroutine maths::invertfulldp ( real(dp), dimension(:,:), intent(in) A, real(dp), dimension(:,:), intent(out) B, real(dp), intent(out) det, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Inverts a full double precision matrix A to give matrix B and returns the determinant of A in det.

Parameters
 [in] a The matrix A to invert [out] b On exit, the inverse of A [out] det On exit, the determinant of A [out] err The error code [out] error The error string

Definition at line 1556 of file maths.f90.

 subroutine maths::invertfullsp ( real(sp), dimension(:,:), intent(in) A, real(sp), dimension(:,:), intent(out) B, real(sp), intent(out) det, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Inverts a full single precision matrix A to give matrix B and returns the determinant of A in det.

Parameters
 [in] a The A matrix to invert [out] b On exit, the inverse of A [out] det On exit, the determinant of A [out] err The error code [out] error The error string

Definition at line 1483 of file maths.f90.

 pure real(dp) function maths::k0dp ( real(dp), intent(in) x )
private

Calculates the modified Bessel function of the second kind of order 1 using the approximation of Abromowitz and Stegun, for a double precision argument.

Parameters
 [in] x The value to evaluate the function at

Definition at line 1630 of file maths.f90.

 pure real(sp) function maths::k0sp ( real(sp), intent(in) x )
private

Calculates the modified Bessel function of the second kind of order 0 using the approximation of Abromowitz and Stegun, for a single precision argument.

Parameters
 [in] x The value to evaluate the function at

Definition at line 1677 of file maths.f90.

 pure real(dp) function maths::k1dp ( real(dp), intent(in) x )
private

Calculates the modified Bessel function of the second kind of order 1 using the approximation of Abromowitz and Stegun, for a double precision argument.

Parameters
 [in] x The value to evaluate the function at

Definition at line 1724 of file maths.f90.

 pure real(sp) function maths::k1sp ( real(sp), intent(in) x )
private

Calculates the modified Bessel function of the second kind of order 1 using the approximation of Abromowitz and Stegun, for a single precision argument.

Parameters
 [in] x The value to evaluate the function at

Definition at line 1772 of file maths.f90.

 pure real(dp) function maths::kdpdp ( real(dp), intent(in) x )
private

Calculates the elliptic integral of the first kind - K(m), for a double precision argument.

Parameters
 [in] x The value to evaluate the function at

Definition at line 1819 of file maths.f90.

 pure real(sp) function maths::kdpsp ( real(sp), intent(in) x )
private

Calculates the elliptic integral of the first kind - K(m), for a single precision argument.

Parameters
 [in] x The value to evaluate the function at

Definition at line 1853 of file maths.f90.

 real(dp) function maths::l2normdp ( real(dp), dimension(:), intent(in) A )
private

Returns the L2-norm of the double precision vector a.

Parameters
 [in] a The vector to calculate the L2 norm of

Definition at line 1908 of file maths.f90.

 pure real(sp) function maths::l2normsp ( real(sp), dimension(:), intent(in) a )
private

Returns the L2-norm of the single precision vector a.

Parameters
 [in] a The vector to calculate the L2 norm of

Definition at line 1887 of file maths.f90.

 subroutine maths::matrixproductdp ( real(dp), dimension(:,:), intent(in) A, real(dp), dimension(:,:), intent(in) B, real(dp), dimension(:,:), intent(out) C, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Calculates and returns the matrix-product of the double precision matrix A*B in C.

Parameters
 [in] a The A matrix [in] b The B matrix [out] c On exit, the product matrix C=A*B [out] err The error code [out] error The error string

Definition at line 1979 of file maths.f90.

References base_routines::enters(), and base_routines::exits().

 subroutine maths::matrixproductsp ( real(sp), dimension(:,:), intent(in) A, real(sp), dimension(:,:), intent(in) B, real(sp), dimension(:,:), intent(out) C, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Calculates and returns the matrix-product of the single precision matrix A*B in C for single precision arguments.

Parameters
 [in] a The first matrix A [in] b The second matrix B [out] c On exit, the product matrix C=A*B [out] err The error code [out] error The error string

Definition at line 1929 of file maths.f90.

References base_routines::enters(), and base_routines::exits().

 subroutine maths::matrixproducttransposedp ( real(dp), dimension(:,:), intent(in) A, real(dp), dimension(:,:), intent(in) B, real(dp), dimension(:,:), intent(out) C, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Calculates and returns the matrix-product-transpose of the double precision matrix A*B^T in C.

Parameters
 [in] a The A matrix [in] b The B matrix [out] c On exit, the product matrix C=A*B^T [out] err The error code [out] error The error string

Definition at line 2178 of file maths.f90.

References base_routines::enters(), and base_routines::exits().

 subroutine maths::matrixproducttransposesp ( real(sp), dimension(:,:), intent(in) A, real(sp), dimension(:,:), intent(in) B, real(sp), dimension(:,:), intent(out) C, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Calculates and returns the matrix-product-transpose of the single precision matrix A*B^T in C for single precision arguments.

Parameters
 [in] a The first matrix A [in] b The second matrix B [out] c On exit, the product matrix C=A*B^T [out] err The error code [out] error The error string

Definition at line 2128 of file maths.f90.

References base_routines::enters(), and base_routines::exits().

 subroutine maths::matrixtransposedp ( real(dp), dimension(:,:), intent(in) A, real(dp), dimension(:,:), intent(out) AT, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Returns the transpose of a double precision matrix A in AT.

Parameters
 [in] a The matrix to take the transpose of [out] at On exit, the transpose of the matrix [out] err The error code [out] error The error string

Definition at line 2277 of file maths.f90.

References base_routines::enters(), and base_routines::exits().

 subroutine maths::matrixtransposeproductdp ( real(dp), dimension(:,:), intent(in) A, real(dp), dimension(:,:), intent(in) B, real(dp), dimension(:,:), intent(out) C, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Calculates and returns the matrix-transpose product of the double precision matrix A^T*B in C for double precision arguments.

Parameters
 [in] a The first matrix A [in] b The second matrix B [out] c On exit, the product matrix C=A^T*B [out] err The error code [out] error The error string

Definition at line 2079 of file maths.f90.

References base_routines::enters(), and base_routines::exits().

 subroutine maths::matrixtransposeproductsp ( real(sp), dimension(:,:), intent(in) A, real(sp), dimension(:,:), intent(in) B, real(sp), dimension(:,:), intent(out) C, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Calculates and returns the matrix-transpose product of the single precision matrix A^T*B in C for single precision arguments.

Parameters
 [in] a The first matrix A [in] b The second matrix B [out] c On exit, the product matrix C=A^T*B [out] err The error code [out] error The error string

Definition at line 2029 of file maths.f90.

References base_routines::enters(), and base_routines::exits().

 subroutine maths::matrixtransposesp ( real(sp), dimension(:,:), intent(in) A, real(sp), dimension(:,:), intent(out) AT, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Returns the transpose of a single precision matrix A in AT.

Parameters
 [in] a The matrix to take the transpose of [out] at On exit, the transpose of the matrix [out] err The error code [out] error The error string

Definition at line 2228 of file maths.f90.

References base_routines::enters(), and base_routines::exits().

 subroutine maths::matrixtransposevectorproductdp ( real(dp), dimension(:,:), intent(in) A, real(dp), dimension(:), intent(in) b, real(dp), dimension(:), intent(out) c, integer(intg) err, type(varying_string), intent(out) error )
private

Calculates and returns the matrix-transpose vector product of the double precision vector A^T*b in c.

Parameters
 [in] a The A matrix [in] b The b vector [out] c On exit, the product vector c=A^T*b err The error code [out] error The error string

Definition at line 678 of file maths.f90.

References base_routines::enters(), and base_routines::exits().

 subroutine maths::matrixtransposevectorproductsp ( real(sp), dimension(:,:), intent(in) A, real(sp), dimension(:), intent(in) b, real(sp), dimension(:), intent(out) c, integer(intg) err, type(varying_string), intent(out) error )
private

Calculates and returns the matrix-transpose vector product of the single precision vector A^T*b in c.

Parameters
 [in] a The A matrix [in] b The b vector [out] c On exit, the product vector c=A^T*b err The error code [out] error The error string

Definition at line 637 of file maths.f90.

References base_routines::enters(), and base_routines::exits().

 subroutine maths::matrixvectorproductdp ( real(dp), dimension(:,:), intent(in) A, real(dp), dimension(:), intent(in) b, real(dp), dimension(:), intent(out) c, integer(intg) err, type(varying_string), intent(out) error )
private

Calculates and returns the matrix-vector product of the double precision vectir A*b in c.

Parameters
 [in] a The A matrix [in] b The b vector [out] c On exit, the product vector c=A*b err The error code [out] error The error string

Definition at line 596 of file maths.f90.

References base_routines::enters(), and base_routines::exits().

 subroutine maths::matrixvectorproductsp ( real(sp), dimension(:,:), intent(in) A, real(sp), dimension(:), intent(in) b, real(sp), dimension(:), intent(out) c, integer(intg) err, type(varying_string), intent(out) error )
private

Calculates and returns the matrix-vector product of the single precision vector A*b in c.

Parameters
 [in] a The A matrix [in] b The b vector [out] c On exit, the product vector c=A*b err The error code [out] error The error string

Definition at line 555 of file maths.f90.

References base_routines::enters(), and base_routines::exits().

 real(dp) function, dimension(size(a,1)) maths::normalisedp ( real(dp), dimension(:), intent(in) a, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Normalises a real double precision vector a.

Parameters
 [in] a The vector to normalise [out] err The error code [out] error The error string

Definition at line 2359 of file maths.f90.

 real(sp) function, dimension(size(a,1)) maths::normalisesp ( real(sp), dimension(:), intent(in) a, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Normalises a real single precision vector a.

Parameters
 [in] a The vector to normalise [out] err The error code [out] error The error string

Definition at line 2326 of file maths.f90.

 subroutine maths::normcrossproductdp ( real(dp), dimension(:), intent(in) a, real(dp), dimension(:), intent(in) b, real(dp), dimension(:), intent(out) c, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Calculates and returns the normalised vector cross-prouct of the double precision vectors a x b in c.

Parameters
 [in] a The first vector in the cross product [in] b The second vector in the cross product [out] c On exit, the normalised cross product of the first and second vectors [out] err The error code [out] error The error string

Definition at line 2420 of file maths.f90.

References base_routines::enters(), and base_routines::exits().

 subroutine maths::normcrossproductsp ( real(sp), dimension(:), intent(in) a, real(sp), dimension(:), intent(in) b, real(sp), dimension(:), intent(out) c, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Calculates and returns the normalised vector cross-prouct of the single precision vectors a x b in c.

Parameters
 [in] a The first vector in the cross product [in] b The second vector in the cross product [out] c On exit, the normalised cross product of the first and second vectors [out] err The error code [out] error The error string

Definition at line 2392 of file maths.f90.

References base_routines::enters(), and base_routines::exits().

 subroutine, public maths::s3_fs ( real(dp), dimension(2:n), intent(inout) a1, real(dp), dimension(1:n), intent(inout) a2, real(dp), dimension(1:n-1), intent(inout) a3, integer(intg), intent(in) n, real(dp), dimension(n), intent(inout) b, real(dp), dimension(n), intent(out) x, integer(intg), intent(out) err, type(varying_string), intent(out) error )

S3_FS factors and solves a tridiagonal linear system. algorithm adapted from John Burkhardt's s3_fs routine from the SPLINE package (http://people.sc.fsu.edu/~jburkardt/f_src/spline/spline.html)

Parameters
 [in,out] a1 IN: nonzero diagonal of linear system OUT: factorization info [in,out] a2 IN: nonzero diagonal of linear system OUT: factorization info [in,out] a3 IN: nonzero diagonal of linear system OUT: factorization info [in] n size of x,y arrays to interpolate values from [in,out] b IN: RHS of linear system OUT: factorization info [out] x solution of linear system [out] err The error code [out] error The error string

Definition at line 2678 of file maths.f90.

Referenced by spline_cubic_set().

 subroutine maths::solvesmalllinearsystemdp ( real(dp), dimension(:,:), intent(in) A, real(dp), dimension(:), intent(out) x, real(dp), dimension(:), intent(in) b, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Finds the solution to a small double precision linear system Ax=b.

Parameters
 [in] a The A matrix [out] x On exit, the solution vector x [in] b The RHS vector b [out] err The error code [out] error The error string

Definition at line 2493 of file maths.f90.

References base_routines::enters(), and base_routines::exits().

 subroutine maths::solvesmalllinearsystemsp ( real(sp), dimension(:,:), intent(in) A, real(sp), dimension(:), intent(out) x, real(sp), dimension(:), intent(in) b, integer(intg), intent(out) err, type(varying_string), intent(out) error )
private

Finds the solution to a small single precision linear system Ax=b.

Parameters
 [in] a The A matrix [out] x On exit, the solution vector x [in] b The RHS vector b [out] err The error code [out] error The error string

Definition at line 2448 of file maths.f90.

References base_routines::enters(), and base_routines::exits().

 subroutine, public maths::spline_cubic_set ( integer(intg), intent(in) n, real(dp), dimension(n), intent(in) t, real(dp), dimension(n), intent(in) y, integer(intg), intent(in) ibcbeg, real(dp), intent(in) ybcbeg, integer(intg), intent(in) ibcend, real(dp), intent(in) ybcend, real(dp), dimension(n), intent(out) ypp, integer(intg), intent(out) err, type(varying_string), intent(out) error )

Calculates second derivatives of a cubic spline function for a tabulated function y(x). Call spline_cubic_val to evaluate at t values. algorithm adapted from John Burkhardt's spline_cubic_set routine from the SPLINE package (http://people.sc.fsu.edu/~jburkardt/f_src/spline/spline.html)

Parameters
 [in] n size of x,y arrays to interpolate values from [in] t t array: known values [in] y y array: values to interpolate [in] ibcbeg left boundary condition flag [in] ybcbeg 1st derivative interpolating function at point 1 (left boundary) [in] ibcend right boundary condition flag [in] ybcend 1st derivative interpolating function at point n (right boundary) [out] ypp 2nd derivatives of interpolating function at x values [out] err The error code [out] error The error string

Definition at line 2575 of file maths.f90.

References base_routines::enters(), base_routines::exits(), and s3_fs().

 subroutine, public maths::spline_cubic_val ( integer(intg), intent(in) n, real(dp), dimension(n), intent(in) t, real(dp), dimension(n), intent(in) y, real(dp), dimension(n), intent(in) ypp, real(dp), intent(in) tval, real(dp), intent(out) yval, real(dp), intent(out) ypval, real(dp), intent(out) yppval, integer(intg), intent(out) err, type(varying_string), intent(out) error )

Evaluates a cubic spline at a specified point. First call spline_cubic_set to calculate derivatives algorithm adapted from John Burkhardt's spline_cubic_val routine from the SPLINE package (http://people.sc.fsu.edu/~jburkardt/f_src/spline/spline.html)

Parameters
 [in] n size of t,y arrays to interpolate values from [in] t t array: known knot values [in] y y array: data values to interpolate at the knots [in] ypp 2nd derivatives of interpolating function at t values [in] tval point in t at which spline is to be evaluated [out] yval spline interpolated y value at tval [out] ypval first derivative of spline interpolated y value at tval [out] yppval second derivative of spline interpolated y value at tval [out] err The error code [out] error The error string

Definition at line 2730 of file maths.f90.

References base_routines::enters(), and base_routines::exits().