primatologist-gpl  5.1.2
aims::math Namespace Reference

Namespaces

 internal
 

Classes

class  MatrixBase
 Matrix class implementing matrix operations. More...
 
class  incompatible_matrix_exception
 This exception is thrown when an attempt is made at multiplying two matrices with incompatible dimensions. More...
 
class  Rastrigin
 Many local minima with a smooth enveloppe. More...
 
class  Ackley
 Many local minima with a stingy enveloppe. More...
 
class  SphereF
 Convex function with a simple minimum. More...
 
class  Rosenbrock
 Convex function with a valley. More...
 
class  Beale
 Convex function with a very flat minimum. More...
 
class  GoldsteinPrice
 Convex function with a very flat minimum and valleys. More...
 
class  Booth
 
class  Bukin6
 Strong valley. D1 but not C1. More...
 
class  Matyas
 Smooth valley. More...
 
class  Levi13
 Many local minima. More...
 
class  ThreeHumpCamel
 Very flat valley. More...
 
class  Easom
 Picky hole. More...
 
class  CrossInTray
 Barriers and local minima Not C1. More...
 
class  Eggholder
 Not C1. More...
 
class  HolderTable
 Not C1. More...
 
class  McCormick
 
class  Schaffer2
 
class  Schaffer4
 
class  StyblinskiTang
 

Typedefs

typedef MatrixBase< float > Matrix
 
typedef MatrixBase< double > MatrixD
 
typedef MatrixBase< float > Vector
 
typedef MatrixBase< double > VectorD
 

Functions

template<typename T >
MatrixBase< T > asMatrix (carto::VolumeRef< T > &volume)
 Interprets the volume as a matrix. More...
 
template<typename T , typename U >
MatrixBase< typename carto::volumeutil::multiplies< T, U >::result_type > operator* (const MatrixBase< T > &a, const MatrixBase< U > &b)
 Matrix product. More...
 
template<typename T >
MatrixBase< T > transpose (const MatrixBase< T > &)
 Matrix transposition. More...
 
template<typename T >
MatrixBase< T > invert (const MatrixBase< T > &)
 Matrix inversion. More...
 
template<typename T , typename U >
bool operator== (const MatrixBase< T > &vol, const MatrixBase< U > &other)
 Returns true if the dimensions are the same and if all elements are equal. More...
 
template<typename T , typename U >
bool operator!= (const MatrixBase< T > &vol, const MatrixBase< U > &other)
 Returns false if dimensions are not the same or if any couple of elements is not equal. More...
 
template<typename T >
MatrixBase< T > operator- (const MatrixBase< T > &vol)
 Returns a Matrix filled with opposite elements. More...
 
template<typename T , typename U >
MatrixBase< typename carto::volumeutil::plus< T, U >::result_type > operator+ (const MatrixBase< T > &vol, const U &value)
 Matrix + Scalar. More...
 
template<typename T , typename U >
MatrixBase< typename carto::volumeutil::minus< T, U >::result_type > operator- (const MatrixBase< T > &vol, const U &value)
 Matrix - Scalar. More...
 
template<typename T , typename U >
MatrixBase< typename carto::volumeutil::multiplies< T, U >::result_type > operator* (const MatrixBase< T > &vol, const U &value)
 Matrix * Scalar. More...
 
template<typename T , typename U >
MatrixBase< typename carto::volumeutil::divides< T, U >::result_type > operator/ (const MatrixBase< T > &vol, const U &value)
 Matrix / Scalar. More...
 
template<typename T , typename U >
MatrixBase< typename carto::volumeutil::plus< U, T >::result_type > operator+ (const U &value, const MatrixBase< T > &vol)
 
template<typename T , typename U >
MatrixBase< typename carto::volumeutil::minus< U, T >::result_type > operator- (const U &value, const MatrixBase< T > &vol)
 
template<typename T , typename U >
MatrixBase< typename carto::volumeutil::multiplies< U, T >::result_type > operator* (const U &value, const MatrixBase< T > &vol)
 
template<typename T , typename U >
MatrixBase< typename carto::volumeutil::divides< U, T >::result_type > operator/ (const U &value, const MatrixBase< T > &vol)
 
template<typename T , typename U >
MatrixBase< typename carto::volumeutil::plus< T, U >::result_type > operator+ (const MatrixBase< T > &vol, const MatrixBase< U > &other)
 
template<typename T , typename U >
MatrixBase< typename carto::volumeutil::minus< T, U >::result_type > operator- (const MatrixBase< T > &vol, const MatrixBase< U > &other)
 
template<typename T >
std::ostream & operator<< (std::ostream &out, const MatrixBase< T > &matrix)
 Print the matrix content on the standard output. More...
 
template<typename T >
void write (const MatrixBase< T > &matrix, const std::string &file)
 Write the matrix content in an image file. More...
 

Variables

const double PI = 3.14159265358979323846
 
const double TWO_PI = 6.28318530717958647693
 
const double PI_D_TWO = 1.57079632679489661923
 
const double ONE_D_PI = 0.318309886183790671538
 
const double TWO_D_PI = 0.636619772367581343076
 
const double ONE_D_TWO_PI = 0.707106781186547524400
 
const double FOUR_M_PI = 0.858407346410206761537
 
const double PI_M_THREE = 0.141592653589793238463
 
const double RT_PI = 1.77245385090551602720
 
const double RT_PI_D_RT_TWO = 1.25331413731550025121
 
const double RT_TWO_PI = 2.50662827463100050242
 
const double TWO_D_RT_PI = 1.12837916709551257390
 
const double ONE_D_RT_TWO_PI = 0.398942280401432677939
 
const double POW23_FOUR_M_PI = 0.795316767371597544348
 
const double ONE_D_RT_PI = TWO_D_RT_PI / 2.0
 
const double RT_TWO = 1.41421356237309504880
 
const double ONE_D_RT_TWO = 0.707106781186547524401
 
const double ONE_D_THREE = 0.333333333333333333333
 
const double TWO_D_THREE = 0.666666666666666666667
 

Typedef Documentation

◆ Matrix

Definition at line 27 of file matrix.h.

◆ MatrixD

Definition at line 28 of file matrix.h.

◆ Vector

Definition at line 29 of file matrix.h.

◆ VectorD

Definition at line 30 of file matrix.h.

Function Documentation

◆ asMatrix()

template<typename T >
MatrixBase< T > aims::math::asMatrix ( carto::VolumeRef< T > &  volume)

Interprets the volume as a matrix.

Warning
Data will be shared between the two objects.

Definition at line 341 of file matrix_d.h.

Referenced by invert(), operator*(), operator+(), operator-(), and operator/().

◆ invert()

template<typename T >
MatrixBase< T > aims::math::invert ( const MatrixBase< T > &  matrix)

Matrix inversion.

Note
The matrix product of the original and the resulting matrices yields the identity matrix.

Definition at line 182 of file matrix_d.h.

References asMatrix().

Referenced by aims::Newton< O, L >::execute(), and aims::math::MatrixBase< T >::invert().

◆ operator!=()

template<typename T , typename U >
bool aims::math::operator!= ( const MatrixBase< T > &  vol,
const MatrixBase< U > &  other 
)

Returns false if dimensions are not the same or if any couple of elements is not equal.

Definition at line 208 of file matrix_d.h.

◆ operator*() [1/3]

template<typename T , typename U >
MatrixBase< typename carto::volumeutil::multiplies< T, U >::result_type > aims::math::operator* ( const MatrixBase< T > &  a,
const MatrixBase< U > &  b 
)

Matrix product.

Note
ths number of columns in the left hand matrix should be the same as the number of rows in the right hand matrix.

Definition at line 137 of file matrix_d.h.

References aims::math::MatrixBase< T >::ncol(), and aims::math::MatrixBase< T >::nrow().

◆ operator*() [2/3]

template<typename T , typename U >
MatrixBase< typename carto::volumeutil::multiplies< T, U >::result_type > aims::math::operator* ( const MatrixBase< T > &  vol,
const U &  value 
)

Matrix * Scalar.

Definition at line 238 of file matrix_d.h.

References asMatrix().

◆ operator*() [3/3]

template<typename T , typename U >
MatrixBase< typename carto::volumeutil::multiplies< U, T >::result_type > aims::math::operator* ( const U &  value,
const MatrixBase< T > &  vol 
)

Definition at line 270 of file matrix_d.h.

References asMatrix().

◆ operator+() [1/3]

template<typename T , typename U >
MatrixBase< typename carto::volumeutil::plus< T, U >::result_type > aims::math::operator+ ( const MatrixBase< T > &  vol,
const MatrixBase< U > &  other 
)

Definition at line 286 of file matrix_d.h.

References asMatrix().

◆ operator+() [2/3]

template<typename T , typename U >
MatrixBase< typename carto::volumeutil::plus< T, U >::result_type > aims::math::operator+ ( const MatrixBase< T > &  vol,
const U &  value 
)

Matrix + Scalar.

Definition at line 222 of file matrix_d.h.

References asMatrix().

◆ operator+() [3/3]

template<typename T , typename U >
MatrixBase< typename carto::volumeutil::plus< U, T >::result_type > aims::math::operator+ ( const U &  value,
const MatrixBase< T > &  vol 
)

Definition at line 254 of file matrix_d.h.

References asMatrix().

◆ operator-() [1/4]

template<typename T >
MatrixBase< T > aims::math::operator- ( const MatrixBase< T > &  vol)

Returns a Matrix filled with opposite elements.

Definition at line 214 of file matrix_d.h.

References asMatrix().

◆ operator-() [2/4]

template<typename T , typename U >
MatrixBase< typename carto::volumeutil::minus< T, U >::result_type > aims::math::operator- ( const MatrixBase< T > &  vol,
const MatrixBase< U > &  other 
)

Definition at line 294 of file matrix_d.h.

References asMatrix().

◆ operator-() [3/4]

template<typename T , typename U >
MatrixBase< typename carto::volumeutil::minus< T, U >::result_type > aims::math::operator- ( const MatrixBase< T > &  vol,
const U &  value 
)

Matrix - Scalar.

Definition at line 230 of file matrix_d.h.

References asMatrix().

◆ operator-() [4/4]

template<typename T , typename U >
MatrixBase< typename carto::volumeutil::minus< U, T >::result_type > aims::math::operator- ( const U &  value,
const MatrixBase< T > &  vol 
)

Definition at line 262 of file matrix_d.h.

References asMatrix().

◆ operator/() [1/2]

template<typename T , typename U >
MatrixBase< typename carto::volumeutil::divides< T, U >::result_type > aims::math::operator/ ( const MatrixBase< T > &  vol,
const U &  value 
)

Matrix / Scalar.

Definition at line 246 of file matrix_d.h.

References asMatrix().

◆ operator/() [2/2]

template<typename T , typename U >
MatrixBase< typename carto::volumeutil::divides< U, T >::result_type > aims::math::operator/ ( const U &  value,
const MatrixBase< T > &  vol 
)

Definition at line 278 of file matrix_d.h.

References asMatrix().

◆ operator<<()

template<typename T >
std::ostream & aims::math::operator<< ( std::ostream &  out,
const MatrixBase< T > &  matrix 
)

Print the matrix content on the standard output.

Definition at line 327 of file matrix_d.h.

◆ operator==()

template<typename T , typename U >
bool aims::math::operator== ( const MatrixBase< T > &  vol,
const MatrixBase< U > &  other 
)

Returns true if the dimensions are the same and if all elements are equal.

Definition at line 196 of file matrix_d.h.

References aims::math::MatrixBase< T >::ncol(), and aims::math::MatrixBase< T >::nrow().

◆ transpose()

template<typename T >
MatrixBase< T > aims::math::transpose ( const MatrixBase< T > &  m)

◆ write()

template<typename T >
void aims::math::write ( const MatrixBase< T > &  matrix,
const std::string &  file 
)

Write the matrix content in an image file.

Variable Documentation

◆ FOUR_M_PI

const double aims::math::FOUR_M_PI = 0.858407346410206761537

Definition at line 24 of file constants.h.

◆ ONE_D_PI

const double aims::math::ONE_D_PI = 0.318309886183790671538

Definition at line 21 of file constants.h.

◆ ONE_D_RT_PI

const double aims::math::ONE_D_RT_PI = TWO_D_RT_PI / 2.0

Definition at line 33 of file constants.h.

◆ ONE_D_RT_TWO

const double aims::math::ONE_D_RT_TWO = 0.707106781186547524401

Definition at line 36 of file constants.h.

◆ ONE_D_RT_TWO_PI

const double aims::math::ONE_D_RT_TWO_PI = 0.398942280401432677939

Definition at line 31 of file constants.h.

◆ ONE_D_THREE

const double aims::math::ONE_D_THREE = 0.333333333333333333333

Definition at line 38 of file constants.h.

◆ ONE_D_TWO_PI

const double aims::math::ONE_D_TWO_PI = 0.707106781186547524400

Definition at line 23 of file constants.h.

◆ PI

const double aims::math::PI = 3.14159265358979323846

Definition at line 18 of file constants.h.

◆ PI_D_TWO

const double aims::math::PI_D_TWO = 1.57079632679489661923

Definition at line 20 of file constants.h.

◆ PI_M_THREE

const double aims::math::PI_M_THREE = 0.141592653589793238463

Definition at line 25 of file constants.h.

◆ POW23_FOUR_M_PI

const double aims::math::POW23_FOUR_M_PI = 0.795316767371597544348

Definition at line 32 of file constants.h.

◆ RT_PI

const double aims::math::RT_PI = 1.77245385090551602720

Definition at line 27 of file constants.h.

◆ RT_PI_D_RT_TWO

const double aims::math::RT_PI_D_RT_TWO = 1.25331413731550025121

Definition at line 28 of file constants.h.

◆ RT_TWO

const double aims::math::RT_TWO = 1.41421356237309504880

Definition at line 35 of file constants.h.

◆ RT_TWO_PI

const double aims::math::RT_TWO_PI = 2.50662827463100050242

Definition at line 29 of file constants.h.

◆ TWO_D_PI

const double aims::math::TWO_D_PI = 0.636619772367581343076

Definition at line 22 of file constants.h.

◆ TWO_D_RT_PI

const double aims::math::TWO_D_RT_PI = 1.12837916709551257390

Definition at line 30 of file constants.h.

◆ TWO_D_THREE

const double aims::math::TWO_D_THREE = 0.666666666666666666667

Definition at line 39 of file constants.h.

◆ TWO_PI

const double aims::math::TWO_PI = 6.28318530717958647693

Definition at line 19 of file constants.h.