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]aargument 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]aargument 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]aThe first vector in the cross product
[in]bThe second vector in the cross product
[out]cOn exit, the cross product of the first and second vectors
[out]errThe error code
[out]errorThe 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]aThe first vector in the cross product
[in]bThe second vector in the cross product
[out]cOn exit, the cross product of the first and second vectors
[out]errThe error code
[out]errorThe 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]aThe first vector in the cross product
[in]bThe second vector in the cross product
[out]cOn exit, the cross product of the first and second vectors
[out]errThe error code
[out]errorThe 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]nThe number of derivatives
[in]aThe a vector
[in]bThe b vector
[out]cOn exit, the cross product of a x b
[in]daThe n derivatives of a
[in]dbThe n derivatives of b
[out]dcOn exit, the derivatives of c
[out]errThe error code
[out]errorThe 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]nThe number of derivatives
[in]aThe a vector
[in]bThe b vector
[out]cOn exit, the cross product of a x b
[in]daThe n derivatives of a
[in]dbThe n derivatives of b
[out]dcOn exit, the derivatives of c
[out]errThe error code
[out]errorThe 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]nThe number of derivatives
[in]aThe a vector
[in]bThe b vector
[out]cOn exit, the cross product of a x b
[in]daThe n derivatives of a
[in]dbThe n derivatives of b
[out]dcOn exit, the derivatives of c
[out]errThe error code
[out]errorThe 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]aThe matrix to find the determinant of
[out]errThe error code
[out]errorThe 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]aThe matrix to find the determinant of
[out]errThe error code
[out]errorThe 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]aThe matrix to find the determinant of
[out]errThe error code
[out]errorThe 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]xThe 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]xThe 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]aThe matrix to find the eigenvalues of
[out]evaluesOn exit, the eigenvalues of the matrix
[out]errThe error code
[out]errorThe error string

Definition at line 993 of file maths.f90.

References base_routines::enters(), base_routines::exits(), constants::pi, and constants::zero_tolerance_dp.

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]aThe matrix to find the eignenvalues for
[out]evaluesOn exit, the eignevalues
[out]errThe error code
[out]errorThe error string

Definition at line 905 of file maths.f90.

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

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]aThe matrix to find the eignevectors for
[in]evalueThe eigenvalue to find the eignevector for
[out]evectorOn exit, the eigenvector corresponding the the eigenvalue
[out]errThe error code
[out]errorThe error string

Definition at line 1168 of file maths.f90.

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

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]aThe matrix to find the eignevectors for
[in]evalueThe eigenvalue to find the eignevector for
[out]evectorOn exit, the eigenvector corresponding the the eigenvalue
[out]errThe error code
[out]errorThe error string

Definition at line 1081 of file maths.f90.

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

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]xThe 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]xThe 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]xThe 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]xThe 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]aOn exit, the identity matrix
[out]errThe error code
[out]errorThe 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]aOn exit, the identity matrix
[out]errThe error code
[out]errorThe 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]aThe matrix A to invert
[out]bOn exit, the inverse of A
[out]detOn exit, the determinant of A
[out]errThe error code
[out]errorThe error string

Definition at line 1556 of file maths.f90.

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

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]aThe A matrix to invert
[out]bOn exit, the inverse of A
[out]detOn exit, the determinant of A
[out]errThe error code
[out]errorThe error string

Definition at line 1483 of file maths.f90.

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

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]xThe 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]xThe 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]xThe 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]xThe 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]xThe 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]xThe 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]aThe 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]aThe 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]aThe A matrix
[in]bThe B matrix
[out]cOn exit, the product matrix C=A*B
[out]errThe error code
[out]errorThe 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]aThe first matrix A
[in]bThe second matrix B
[out]cOn exit, the product matrix C=A*B
[out]errThe error code
[out]errorThe 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]aThe A matrix
[in]bThe B matrix
[out]cOn exit, the product matrix C=A*B^T
[out]errThe error code
[out]errorThe 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]aThe first matrix A
[in]bThe second matrix B
[out]cOn exit, the product matrix C=A*B^T
[out]errThe error code
[out]errorThe 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]aThe matrix to take the transpose of
[out]atOn exit, the transpose of the matrix
[out]errThe error code
[out]errorThe 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]aThe first matrix A
[in]bThe second matrix B
[out]cOn exit, the product matrix C=A^T*B
[out]errThe error code
[out]errorThe 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]aThe first matrix A
[in]bThe second matrix B
[out]cOn exit, the product matrix C=A^T*B
[out]errThe error code
[out]errorThe 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]aThe matrix to take the transpose of
[out]atOn exit, the transpose of the matrix
[out]errThe error code
[out]errorThe 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]aThe A matrix
[in]bThe b vector
[out]cOn exit, the product vector c=A^T*b
errThe error code
[out]errorThe 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]aThe A matrix
[in]bThe b vector
[out]cOn exit, the product vector c=A^T*b
errThe error code
[out]errorThe 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]aThe A matrix
[in]bThe b vector
[out]cOn exit, the product vector c=A*b
errThe error code
[out]errorThe 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]aThe A matrix
[in]bThe b vector
[out]cOn exit, the product vector c=A*b
errThe error code
[out]errorThe 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]aThe vector to normalise
[out]errThe error code
[out]errorThe error string

Definition at line 2359 of file maths.f90.

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

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]aThe vector to normalise
[out]errThe error code
[out]errorThe error string

Definition at line 2326 of file maths.f90.

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

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]aThe first vector in the cross product
[in]bThe second vector in the cross product
[out]cOn exit, the normalised cross product of the first and second vectors
[out]errThe error code
[out]errorThe 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]aThe first vector in the cross product
[in]bThe second vector in the cross product
[out]cOn exit, the normalised cross product of the first and second vectors
[out]errThe error code
[out]errorThe 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]a1IN: nonzero diagonal of linear system OUT: factorization info
[in,out]a2IN: nonzero diagonal of linear system OUT: factorization info
[in,out]a3IN: nonzero diagonal of linear system OUT: factorization info
[in]nsize of x,y arrays to interpolate values from
[in,out]bIN: RHS of linear system OUT: factorization info
[out]xsolution of linear system
[out]errThe error code
[out]errorThe error string

Definition at line 2678 of file maths.f90.

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

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]aThe A matrix
[out]xOn exit, the solution vector x
[in]bThe RHS vector b
[out]errThe error code
[out]errorThe 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]aThe A matrix
[out]xOn exit, the solution vector x
[in]bThe RHS vector b
[out]errThe error code
[out]errorThe 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]nsize of x,y arrays to interpolate values from
[in]tt array: known values
[in]yy array: values to interpolate
[in]ibcbegleft boundary condition flag
[in]ybcbeg1st derivative interpolating function at point 1 (left boundary)
[in]ibcendright boundary condition flag
[in]ybcend1st derivative interpolating function at point n (right boundary)
[out]ypp2nd derivatives of interpolating function at x values
[out]errThe error code
[out]errorThe error string

Definition at line 2575 of file maths.f90.

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

Referenced by navier_stokes_equations_routines::NavierStokes_PreSolveUpdateBoundaryConditions::navierstokes_presolveupdateboundaryconditions().

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]nsize of t,y arrays to interpolate values from
[in]tt array: known knot values
[in]yy array: data values to interpolate at the knots
[in]ypp2nd derivatives of interpolating function at t values
[in]tvalpoint in t at which spline is to be evaluated
[out]yvalspline interpolated y value at tval
[out]ypvalfirst derivative of spline interpolated y value at tval
[out]yppvalsecond derivative of spline interpolated y value at tval
[out]errThe error code
[out]errorThe error string

Definition at line 2730 of file maths.f90.

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

Referenced by navier_stokes_equations_routines::NavierStokes_PreSolveUpdateBoundaryConditions::navierstokes_presolveupdateboundaryconditions().