MVE - Multi-View Environment mve-devel
|
Vector, Matrix, basic operations, etc. More...
Namespaces | |
namespace | algo |
Algorithms, functors, value interpolation, etc. | |
namespace | geom |
Computation of geometric quantities and predicates. | |
namespace | internal |
Math internals. | |
Classes | |
class | Accum |
Accumulator class that operates on arbitrary types. More... | |
class | Accum< unsigned char > |
class | BezierCurve |
A class for defining and evaluating Bezier curves in all dimensions. More... | |
class | BSpline |
Implementation of non-uniform B-Spline curves according to. More... | |
class | Line3 |
Class that represents a line using a point and a vector. More... | |
class | Matrix |
Matrix class for arbitrary dimensions and types. More... | |
class | Plane3 |
Class that represents a plane in hesse form. More... | |
class | Quaternion |
Quaternion class for arbitrary types (WORK IN PROGRESS). More... | |
class | Vector |
Vector class for arbitrary dimensions and types. More... | |
Typedefs | |
typedef Line3< double > | Line3d |
typedef Line3< float > | Line3f |
typedef Matrix< double, 2, 2 > | Matrix2d |
typedef Matrix< float, 2, 2 > | Matrix2f |
typedef Matrix< int, 2, 2 > | Matrix2i |
typedef Matrix< unsigned int, 2, 2 > | Matrix2ui |
typedef Matrix< double, 3, 3 > | Matrix3d |
typedef Matrix< float, 3, 3 > | Matrix3f |
typedef Matrix< int, 3, 3 > | Matrix3i |
typedef Matrix< unsigned int, 3, 3 > | Matrix3ui |
typedef Matrix< double, 4, 4 > | Matrix4d |
typedef Matrix< float, 4, 4 > | Matrix4f |
typedef Matrix< int, 4, 4 > | Matrix4i |
typedef Matrix< unsigned int, 4, 4 > | Matrix4ui |
typedef Plane3< double > | Plane3d |
typedef Plane3< float > | Plane3f |
typedef Quaternion< char > | Quat4c |
typedef Quaternion< double > | Quat4d |
typedef Quaternion< float > | Quat4f |
typedef Quaternion< int > | Quat4i |
typedef Quaternion< unsigned char > | Quat4uc |
typedef Quaternion< unsigned int > | Quat4ui |
typedef Vector< float, 128 > | Vec128f |
typedef Vector< unsigned short, 128 > | Vec128us |
typedef Vector< char, 1 > | Vec1c |
typedef Vector< double, 1 > | Vec1d |
typedef Vector< float, 1 > | Vec1f |
typedef Vector< int, 1 > | Vec1i |
typedef Vector< std::size_t, 1 > | Vec1st |
typedef Vector< unsigned char, 1 > | Vec1uc |
typedef Vector< unsigned int, 1 > | Vec1ui |
typedef Vector< unsigned short, 1 > | Vec1us |
typedef Vector< char, 2 > | Vec2c |
typedef Vector< double, 2 > | Vec2d |
typedef Vector< float, 2 > | Vec2f |
typedef Vector< int, 2 > | Vec2i |
typedef Vector< std::size_t, 2 > | Vec2st |
typedef Vector< unsigned char, 2 > | Vec2uc |
typedef Vector< unsigned int, 2 > | Vec2ui |
typedef Vector< unsigned short, 2 > | Vec2us |
typedef Vector< char, 3 > | Vec3c |
typedef Vector< double, 3 > | Vec3d |
typedef Vector< float, 3 > | Vec3f |
typedef Vector< int, 3 > | Vec3i |
typedef Vector< std::size_t, 3 > | Vec3st |
typedef Vector< unsigned char, 3 > | Vec3uc |
typedef Vector< unsigned int, 3 > | Vec3ui |
typedef Vector< unsigned short, 3 > | Vec3us |
typedef Vector< char, 4 > | Vec4c |
typedef Vector< double, 4 > | Vec4d |
typedef Vector< float, 4 > | Vec4f |
typedef Vector< int, 4 > | Vec4i |
typedef Vector< std::size_t, 4 > | Vec4st |
typedef Vector< unsigned char, 4 > | Vec4uc |
typedef Vector< unsigned int, 4 > | Vec4ui |
typedef Vector< unsigned short, 4 > | Vec4us |
typedef Vector< char, 5 > | Vec5c |
typedef Vector< double, 5 > | Vec5d |
typedef Vector< float, 5 > | Vec5f |
typedef Vector< int, 5 > | Vec5i |
typedef Vector< std::size_t, 5 > | Vec5st |
typedef Vector< unsigned char, 5 > | Vec5uc |
typedef Vector< unsigned int, 5 > | Vec5ui |
typedef Vector< unsigned short, 5 > | Vec5us |
typedef Vector< float, 64 > | Vec64f |
typedef Vector< short, 64 > | Vec64s |
typedef Vector< char, 6 > | Vec6c |
typedef Vector< double, 6 > | Vec6d |
typedef Vector< float, 6 > | Vec6f |
typedef Vector< int, 6 > | Vec6i |
typedef Vector< std::size_t, 6 > | Vec6st |
typedef Vector< unsigned char, 6 > | Vec6uc |
typedef Vector< unsigned int, 6 > | Vec6ui |
typedef Vector< unsigned short, 6 > | Vec6us |
Functions | |
template<typename T > | |
T | bound_mirror (T const &v, T const &min, T const &max) |
template<typename T > | |
T const & | clamp (T const &v, T const &min=T(0), T const &max=T(1)) |
Returns value 'v' clamped to the interval specified by 'min' and 'max'. | |
template<typename T > | |
Vector< T, 3 > | cross_product (Vector< T, 3 > const &v1, Vector< T, 3 > const &v2) |
Cross product function for 3-vectors of any type. | |
template<typename T , int N> | |
Vector< T, N > | cross_product (Vector< T, N > const &, Vector< T, N > const &) |
Cross product template for partial specialization. | |
template<typename T , int N> | |
bool | determine_transform (std::vector< math::Vector< T, N > > const &p0, std::vector< math::Vector< T, N > > const &p1, math::Matrix< T, N, N > *rot, T *scale, math::Vector< T, N > *trans) |
template<typename T > | |
T | fastpow (T const &base, unsigned int exp) |
Takes base to the integer power of 'exp'. | |
int | from_gray_code (int gc) |
template<typename T > | |
T | gaussian (T const &x, T const &sigma) |
Gaussian function g(x) = exp( -1/2 * (x/sigma)^2 ). | |
template<typename T > | |
T | gaussian_2d (T const &x, T const &y, T const &sigma_x, T const &sigma_y) |
Gaussian function in 2D. | |
template<typename T > | |
T | gaussian_xx (T const &xx, T const &sigma) |
Gaussian function that expects x to be squared. | |
template<typename T > | |
T | interpolate (T const &v1, float w1) |
Generic interpolation (weighting) of a single value. | |
template<typename T > | |
T | interpolate (T const &v1, T const &v2, float w1, float w2) |
Generic interpolation between two values. | |
template<typename T > | |
T | interpolate (T const &v1, T const &v2, T const &v3, float w1, float w2, float w3) |
Generic interpolation between three values. | |
template<typename T > | |
T | interpolate (T const &v1, T const &v2, T const &v3, T const &v4, float w1, float w2, float w3, float w4) |
Generic interpolation between four values. | |
template<> | |
unsigned char | interpolate (unsigned char const &v1, float w1) |
Specific interpolation (weighting) of a value for unsigned char. | |
template<> | |
unsigned char | interpolate (unsigned char const &v1, unsigned char const &v2, float w1, float w2) |
Specific interpolation between two unsigned char values. | |
template<> | |
unsigned char | interpolate (unsigned char const &v1, unsigned char const &v2, unsigned char const &v3, float w1, float w2, float w3) |
Specific interpolation between three unsigned char values. | |
template<> | |
unsigned char | interpolate (unsigned char const &v1, unsigned char const &v2, unsigned char const &v3, unsigned char const &v4, float w1, float w2, float w3, float w4) |
Specific interpolation between four unsigned char values. | |
template<typename T , int N> | |
bool | isnan (Vector< T, N > const &v) |
Tests if any of the vector values is NaN. | |
template<typename T > | |
T | matrix_determinant (Matrix< T, 1, 1 > const &mat) |
template<typename T > | |
T | matrix_determinant (Matrix< T, 2, 2 > const &mat) |
template<typename T > | |
T | matrix_determinant (Matrix< T, 3, 3 > const &m) |
template<typename T > | |
T | matrix_determinant (Matrix< T, 4, 4 > const &m) |
template<typename T , int N> | |
T | matrix_determinant (Matrix< T, N, N > const &mat) |
Calculates the determinant of the given matrix. | |
template<typename T , int N> | |
Matrix< T, N, N > | matrix_from_diagonal (math::Vector< T, N > const &v) |
Returns a diagonal matrix from the given vector. | |
template<typename T , int N> | |
Vector< T, N > | matrix_get_diagonal (Matrix< T, N, N > const &mat) |
Returns the diagonal elements of the matrix as a vector. | |
template<typename T > | |
Matrix< T, 4, 4 > | matrix_gl_projection (T const &znear, T const &zfar, T const &top, T const &right) |
Creates a symmetric projection matrix as used in OpenGL. | |
template<typename T , int N> | |
Matrix< T, N, N > & | matrix_inplace_transpose (Matrix< T, N, N > &matrix) |
template<typename T > | |
Matrix< T, 1, 1 > | matrix_inverse (Matrix< T, 1, 1 > const &, T const &det) |
template<typename T > | |
Matrix< T, 1, 1 > | matrix_inverse (Matrix< T, 1, 1 > const &mat) |
template<typename T > | |
Matrix< T, 2, 2 > | matrix_inverse (Matrix< T, 2, 2 > const &mat) |
template<typename T > | |
Matrix< T, 2, 2 > | matrix_inverse (Matrix< T, 2, 2 > const &mat, T const &det) |
template<typename T > | |
Matrix< T, 3, 3 > | matrix_inverse (Matrix< T, 3, 3 > const &m) |
template<typename T > | |
Matrix< T, 3, 3 > | matrix_inverse (Matrix< T, 3, 3 > const &m, T const &det) |
template<typename T > | |
Matrix< T, 4, 4 > | matrix_inverse (Matrix< T, 4, 4 > const &m) |
template<typename T , int N> | |
Matrix< T, N, N > | matrix_inverse (Matrix< T, N, N > const &mat) |
Calculates the inverse of the given matrix. | |
template<typename T , int N> | |
Matrix< T, N, N > | matrix_inverse (Matrix< T, N, N > const &mat, T const &det) |
Calculates the inverse of the given matrix given its determinant. | |
template<typename T > | |
Matrix< T, 4, 4 > | matrix_inverse_gl_projection (T const &znear, T const &zfar, T const &top, T const &right) |
Creates a symmetric inverse projection matrix as used in OpenGL. | |
template<typename T > | |
Matrix< T, 4, 4 > | matrix_inverse_viewtrans (Vector< T, 3 > const &campos, Vector< T, 3 > const &viewdir, Vector< T, 3 > const &upvec) |
Creates an inverse view transformation matrix. | |
template<typename T > | |
Matrix< T, 4, 4 > | matrix_invert_trans (Matrix< T, 4, 4 > const &mat) |
Inverts a transformation matrix. | |
template<typename T > | |
bool | matrix_is_diagonal (T *const mat, int rows, int cols, T const &epsilon=T(0)) |
Checks whether the input matrix is a diagonal matrix. | |
template<typename T , int N> | |
bool | matrix_is_identity (Matrix< T, N, N > const &mat, T const &epsilon=T(0)) |
Returns true if and only if the given matrix is the identity matrix. | |
template<typename T , int N, int M> | |
bool | matrix_is_square (Matrix< T, N, M > const &) |
template<typename T , int N> | |
bool | matrix_is_square (Matrix< T, N, N > const &) |
template<typename T > | |
void | matrix_multiply (T const *mat_a, int rows_a, int cols_a, T const *mat_b, int cols_b, T *mat_res) |
Matrix multiplication of dynamically sized dense matrices. | |
template<typename T , int M, int N> | |
void | matrix_pseudo_inverse (Matrix< T, M, N > const &A, Matrix< T, N, M > *result, T const &epsilon=T(1e-12)) |
Computes the Moore–Penrose pseudoinverse of matrix A using the SVD. | |
template<typename T , int M, int N> | |
void | matrix_qr (Matrix< T, M, N > const &mat_a, Matrix< T, M, M > *mat_q, Matrix< T, M, N > *mat_r, T const &epsilon=T(1e-12)) |
Matrix QR decomposition for compile-time fixed-size matrices. | |
template<typename T > | |
void | matrix_qr (T const *mat_a, int rows, int cols, T *mat_q, T *mat_r, T const &epsilon=T(1e-12)) |
Calculates a QR decomposition for a given matrix A. | |
template<typename T , int N> | |
Matrix< T, N, N > | matrix_rotate_180 (Matrix< T, N, N > const &mat_a) |
Rotates the entries of the given matrix by 180 degrees. | |
template<typename T , int N> | |
void | matrix_rotate_180_inplace (Matrix< T, N, N > *mat_a) |
Rotates the entries of the given matrix by 180 degrees in-place. | |
template<typename T > | |
Matrix< T, 3, 3 > | matrix_rotation_from_axis_angle (Vector< T, 3 > const &axis, T const &angle) |
Computes the 3x3 rotation matrix from axis and angle notation. | |
template<typename T , int N> | |
Matrix< T, N, N > & | matrix_set_diagonal (Matrix< T, N, N > &mat, T const *diag) |
Sets the diagonal elements of the given matrix. | |
template<typename T , int N> | |
Matrix< T, N, N > & | matrix_set_identity (Matrix< T, N, N > *mat) |
Sets the given square matrix to the identity matrix. | |
template<typename T > | |
T * | matrix_set_identity (T *mat, int n) |
Sets the given square matrix of dimension 'n' to the identity matrix. | |
template<typename T , int M, int N> | |
void | matrix_svd (Matrix< T, M, N > const &mat_a, Matrix< T, M, N > *mat_u, Matrix< T, N, N > *mat_s, Matrix< T, N, N > *mat_v, T const &epsilon=T(1e-12)) |
SVD for compile-time fixed-size matrices. | |
template<typename T > | |
void | matrix_svd (T const *mat_a, int rows, int cols, T *mat_u, T *vec_s, T *mat_v, T const &epsilon=T(1e-12)) |
SVD for dynamic-size matrices A of size MxN (M rows, N columns). | |
template<typename T > | |
void | matrix_swap_columns (T *const mat, int rows, int cols, int c1, int c2) |
Swaps the columns c1 and c2 of matrix mat with dimension rows, cols. | |
template<typename T > | |
void | matrix_swap_rows (T *mat, int rows, int cols, int r1, int r2) |
Swaps the rows r1 and r2 of matrix mat with dimension rows, cols. | |
template<typename T , int N> | |
T | matrix_trace (math::Matrix< T, N, N > const &mat) |
Calculates the trace of the given matrix. | |
template<typename T > | |
void | matrix_transpose (T *mat, int rows, int cols) |
template<typename T > | |
void | matrix_transpose (T const *mat, int rows, int cols) |
In-place transpose of a dynamically sized dense matrix. | |
template<typename T > | |
void | matrix_transpose_multiply (T const *mat_a, int rows, int cols, T *mat_res) |
Matrix multiplication of the transposed with itself. | |
template<typename T > | |
Matrix< T, 4, 4 > | matrix_viewtrans (Vector< T, 3 > const &campos, Vector< T, 3 > const &viewdir, Vector< T, 3 > const &upvec) |
Creates a view transformation matrix for camera parameters given as camera position, normalized viewing direction, and normalized up-vector. | |
template<typename T > | |
T const & | max (T const &a, T const &b, T const &c) |
Returns the maximum value of three arguments. | |
template<typename T > | |
T const & | min (T const &a, T const &b, T const &c) |
Returns the minimum value of three arguments. | |
template<typename T , int N> | |
Vector< T, N > | operator* (T const &s, Vector< T, N > const &v) |
Scalar-vector multiplication. | |
template<typename T , int N> | |
Vector< T, N > | operator+ (T const &s, Vector< T, N > const &v) |
Scalar-vector addition. | |
template<typename T , int N> | |
Vector< T, N > | operator- (T const &s, Vector< T, N > const &v) |
Scalar-vector substraction. | |
template<typename T , int N, int M> | |
std::ostream & | operator<< (std::ostream &os, Matrix< T, N, M > const &m) |
Serializing a vector to an output stream. | |
template<typename T , int N> | |
std::ostream & | operator<< (std::ostream &os, Quaternion< T > const &v) |
Serializing a vector to an output stream. | |
template<typename T , int N> | |
std::ostream & | operator<< (std::ostream &os, Vector< T, N > const &v) |
Serializing a vector to an output stream. | |
template<typename T > | |
std::size_t constexpr | popcount (T const x) |
Returns the number of one bits of an integer. | |
template<typename T > | |
T | round (T const &x) |
Removes the fractional part of the value to the closest integer. | |
template<typename T > | |
T | sinc (T const &x) |
Sinc function. | |
int | to_gray_code (int bin) |
typedef Line3<double> math::Line3d |
typedef Line3<float> math::Line3f |
typedef Matrix<double, 2, 2> math::Matrix2d |
typedef Matrix<float, 2, 2> math::Matrix2f |
typedef Matrix<int, 2, 2> math::Matrix2i |
typedef Matrix<unsigned int, 2, 2> math::Matrix2ui |
typedef Matrix<double, 3, 3> math::Matrix3d |
typedef Matrix<float, 3, 3> math::Matrix3f |
typedef Matrix<int, 3, 3> math::Matrix3i |
typedef Matrix<unsigned int, 3, 3> math::Matrix3ui |
typedef Matrix<double, 4, 4> math::Matrix4d |
typedef Matrix<float, 4, 4> math::Matrix4f |
typedef Matrix<int, 4, 4> math::Matrix4i |
typedef Matrix<unsigned int, 4, 4> math::Matrix4ui |
typedef Plane3<double> math::Plane3d |
typedef Plane3<float> math::Plane3f |
typedef Quaternion<char> math::Quat4c |
Definition at line 23 of file quaternion.h.
typedef Quaternion<double> math::Quat4d |
Definition at line 20 of file quaternion.h.
typedef Quaternion<float> math::Quat4f |
Definition at line 19 of file quaternion.h.
typedef Quaternion<int> math::Quat4i |
Definition at line 21 of file quaternion.h.
typedef Quaternion<unsigned char> math::Quat4uc |
Definition at line 24 of file quaternion.h.
typedef Quaternion<unsigned int> math::Quat4ui |
Definition at line 22 of file quaternion.h.
typedef Vector<float,128> math::Vec128f |
typedef Vector<unsigned short,128> math::Vec128us |
typedef Vector<char,1> math::Vec1c |
typedef Vector<double,1> math::Vec1d |
typedef Vector<float,1> math::Vec1f |
typedef Vector<int,1> math::Vec1i |
typedef Vector<std::size_t,1> math::Vec1st |
typedef Vector<unsigned char,1> math::Vec1uc |
typedef Vector<unsigned int,1> math::Vec1ui |
typedef Vector<unsigned short,1> math::Vec1us |
typedef Vector<char,2> math::Vec2c |
typedef Vector<double,2> math::Vec2d |
typedef Vector<float,2> math::Vec2f |
typedef Vector<int,2> math::Vec2i |
typedef Vector<std::size_t,2> math::Vec2st |
typedef Vector<unsigned char,2> math::Vec2uc |
typedef Vector<unsigned int,2> math::Vec2ui |
typedef Vector<unsigned short,2> math::Vec2us |
typedef Vector<char,3> math::Vec3c |
typedef Vector<double,3> math::Vec3d |
typedef Vector<float,3> math::Vec3f |
typedef Vector<int,3> math::Vec3i |
typedef Vector<std::size_t,3> math::Vec3st |
typedef Vector<unsigned char,3> math::Vec3uc |
typedef Vector<unsigned int,3> math::Vec3ui |
typedef Vector<unsigned short,3> math::Vec3us |
typedef Vector<char,4> math::Vec4c |
typedef Vector<double,4> math::Vec4d |
typedef Vector<float,4> math::Vec4f |
typedef Vector<int,4> math::Vec4i |
typedef Vector<std::size_t,4> math::Vec4st |
typedef Vector<unsigned char,4> math::Vec4uc |
typedef Vector<unsigned int,4> math::Vec4ui |
typedef Vector<unsigned short,4> math::Vec4us |
typedef Vector<char,5> math::Vec5c |
typedef Vector<double,5> math::Vec5d |
typedef Vector<float,5> math::Vec5f |
typedef Vector<int,5> math::Vec5i |
typedef Vector<std::size_t,5> math::Vec5st |
typedef Vector<unsigned char,5> math::Vec5uc |
typedef Vector<unsigned int,5> math::Vec5ui |
typedef Vector<unsigned short,5> math::Vec5us |
typedef Vector<float,64> math::Vec64f |
typedef Vector<short,64> math::Vec64s |
typedef Vector<char,6> math::Vec6c |
typedef Vector<double,6> math::Vec6d |
typedef Vector<float,6> math::Vec6f |
typedef Vector<int,6> math::Vec6i |
typedef Vector<std::size_t,6> math::Vec6st |
typedef Vector<unsigned char,6> math::Vec6uc |
typedef Vector<unsigned int,6> math::Vec6ui |
typedef Vector<unsigned short,6> math::Vec6us |
T math::bound_mirror | ( | T const & | v, |
T const & | min, | ||
T const & | max | ||
) |
Definition at line 211 of file functions.h.
T const & math::clamp | ( | T const & | v, |
T const & | min = T(0) , |
||
T const & | max = T(1) |
||
) |
Returns value 'v' clamped to the interval specified by 'min' and 'max'.
Definition at line 204 of file functions.h.
bool math::determine_transform | ( | std::vector< math::Vector< T, N > > const & | p0, |
std::vector< math::Vector< T, N > > const & | p1, | ||
math::Matrix< T, N, N > * | rot, | ||
T * | scale, | ||
math::Vector< T, N > * | trans | ||
) |
Definition at line 36 of file transform.h.
T math::fastpow | ( | T const & | base, |
unsigned int | exp | ||
) |
Takes base to the integer power of 'exp'.
Definition at line 235 of file functions.h.
|
inline |
Definition at line 254 of file functions.h.
|
inline |
Gaussian function g(x) = exp( -1/2 * (x/sigma)^2 ).
Gaussian with bell height y=1, bell center x=0 and bell "width" sigma. Useful for at least float and double types.
Definition at line 36 of file functions.h.
|
inline |
Gaussian function in 2D.
Definition at line 59 of file functions.h.
|
inline |
Gaussian function that expects x to be squared.
g(x) = exp( -1/2 * xx / sigma^2 ). Gaussian with bell height y=1, bell center x=0 and bell "width" sigma. Useful for at least float and double types.
Definition at line 49 of file functions.h.
|
inline |
Generic interpolation (weighting) of a single value.
Definition at line 80 of file functions.h.
|
inline |
Generic interpolation between two values.
Definition at line 96 of file functions.h.
|
inline |
Generic interpolation between three values.
Definition at line 113 of file functions.h.
|
inline |
Generic interpolation between four values.
Definition at line 132 of file functions.h.
|
inline |
Specific interpolation (weighting) of a value for unsigned char.
Definition at line 88 of file functions.h.
|
inline |
Specific interpolation between two unsigned char values.
Definition at line 104 of file functions.h.
|
inline |
Specific interpolation between three unsigned char values.
Definition at line 122 of file functions.h.
|
inline |
Specific interpolation between four unsigned char values.
Definition at line 141 of file functions.h.
|
inlineprotected |
|
inline |
Definition at line 380 of file matrix_tools.h.
|
inline |
Definition at line 387 of file matrix_tools.h.
|
inline |
Definition at line 394 of file matrix_tools.h.
T math::matrix_determinant | ( | Matrix< T, 4, 4 > const & | m | ) |
Definition at line 402 of file matrix_tools.h.
T math::matrix_determinant | ( | Matrix< T, N, N > const & | mat | ) |
Calculates the determinant of the given matrix.
This is specialized for 1x1, 2x2, 3x3 and 4x4 matrices only.
Matrix< T, N, N > math::matrix_from_diagonal | ( | math::Vector< T, N > const & | v | ) |
Returns a diagonal matrix from the given vector.
Definition at line 340 of file matrix_tools.h.
Vector< T, N > math::matrix_get_diagonal | ( | Matrix< T, N, N > const & | mat | ) |
Returns the diagonal elements of the matrix as a vector.
Definition at line 360 of file matrix_tools.h.
Matrix< T, 4, 4 > math::matrix_gl_projection | ( | T const & | znear, |
T const & | zfar, | ||
T const & | top, | ||
T const & | right | ||
) |
Creates a symmetric projection matrix as used in OpenGL.
Values in the frustum are mapped to the unit cube. The frustum near plane is defined by z-near, right and top values, the far-plane is located at z-far.
Definition at line 217 of file matrix_tools.h.
Matrix< T, 1, 1 > math::matrix_inverse | ( | Matrix< T, 1, 1 > const & | , |
T const & | det | ||
) |
Definition at line 444 of file matrix_tools.h.
|
inline |
Definition at line 423 of file matrix_tools.h.
|
inline |
Definition at line 430 of file matrix_tools.h.
Matrix< T, 2, 2 > math::matrix_inverse | ( | Matrix< T, 2, 2 > const & | mat, |
T const & | det | ||
) |
Definition at line 452 of file matrix_tools.h.
Definition at line 437 of file matrix_tools.h.
Matrix< T, 3, 3 > math::matrix_inverse | ( | Matrix< T, 3, 3 > const & | m, |
T const & | det | ||
) |
Definition at line 462 of file matrix_tools.h.
Definition at line 479 of file matrix_tools.h.
Matrix< T, N, N > math::matrix_inverse | ( | Matrix< T, N, N > const & | mat | ) |
Calculates the inverse of the given matrix.
This is specialized for 1x1, 2x2, 3x3 and 4x4 matrices only.
Matrix< T, N, N > math::matrix_inverse | ( | Matrix< T, N, N > const & | mat, |
T const & | det | ||
) |
Calculates the inverse of the given matrix given its determinant.
This is specialized for 1x1, 2x2 and 3x3 matrices only.
Matrix< T, 4, 4 > math::matrix_inverse_gl_projection | ( | T const & | znear, |
T const & | zfar, | ||
T const & | top, | ||
T const & | right | ||
) |
Creates a symmetric inverse projection matrix as used in OpenGL.
Definition at line 232 of file matrix_tools.h.
Matrix< T, 4, 4 > math::matrix_inverse_viewtrans | ( | Vector< T, 3 > const & | campos, |
Vector< T, 3 > const & | viewdir, | ||
Vector< T, 3 > const & | upvec | ||
) |
Creates an inverse view transformation matrix.
Definition at line 271 of file matrix_tools.h.
Inverts a transformation matrix.
Definition at line 289 of file matrix_tools.h.
bool math::matrix_is_diagonal | ( | T *const | mat, |
int | rows, | ||
int | cols, | ||
T const & | epsilon = T(0) |
||
) |
Checks whether the input matrix is a diagonal matrix.
This is done by testing if all non-diagonal entries are zero (up to some epsilon).
Definition at line 604 of file matrix_tools.h.
bool math::matrix_is_identity | ( | Matrix< T, N, N > const & | mat, |
T const & | epsilon = T(0) |
||
) |
Returns true if and only if the given matrix is the identity matrix.
Definition at line 328 of file matrix_tools.h.
|
inlineprotected |
|
inlineprotected |
void math::matrix_multiply | ( | T const * | mat_a, |
int | rows_a, | ||
int | cols_a, | ||
T const * | mat_b, | ||
int | cols_b, | ||
T * | mat_res | ||
) |
Matrix multiplication of dynamically sized dense matrices.
R = A * B where A is MxN, B is NxL and R is MxL. Compexity: O(n*n*n).
Definition at line 569 of file matrix_tools.h.
void math::matrix_pseudo_inverse | ( | Matrix< T, M, N > const & | A, |
Matrix< T, N, M > * | result, | ||
T const & | epsilon = T( 1e-12 ) |
||
) |
Computes the Moore–Penrose pseudoinverse of matrix A using the SVD.
Let the SVD of A be A = USV*, then the pseudoinverse is A' = VS'U*. The inverse S' of S is obtained by taking the reciprocal of non-zero diagonal elements, leaving zeros (up to the epsilon) in place.
Definition at line 902 of file matrix_svd.h.
void math::matrix_qr | ( | Matrix< T, M, N > const & | mat_a, |
Matrix< T, M, M > * | mat_q, | ||
Matrix< T, M, N > * | mat_r, | ||
T const & | epsilon = T(1e-12) |
||
) |
Matrix QR decomposition for compile-time fixed-size matrices.
The implementation uses the dynamic-size matrices interface in the background.
Definition at line 172 of file matrix_qr.h.
void math::matrix_qr | ( | T const * | mat_a, |
int | rows, | ||
int | cols, | ||
T * | mat_q, | ||
T * | mat_r, | ||
T const & | epsilon = T(1e-12) |
||
) |
Calculates a QR decomposition for a given matrix A.
A is MxN, Q is MxM and R is MxN. Uses Givens algorithm for computation.
Reference:
Definition at line 125 of file matrix_qr.h.
Matrix< T, N, N > math::matrix_rotate_180 | ( | Matrix< T, N, N > const & | mat_a | ) |
Rotates the entries of the given matrix by 180 degrees.
Definition at line 646 of file matrix_tools.h.
void math::matrix_rotate_180_inplace | ( | Matrix< T, N, N > * | mat_a | ) |
Rotates the entries of the given matrix by 180 degrees in-place.
Definition at line 638 of file matrix_tools.h.
Matrix< T, 3, 3 > math::matrix_rotation_from_axis_angle | ( | Vector< T, 3 > const & | axis, |
T const & | angle | ||
) |
Computes the 3x3 rotation matrix from axis and angle notation.
Definition at line 525 of file matrix_tools.h.
Matrix< T, N, N > & math::matrix_set_diagonal | ( | Matrix< T, N, N > & | mat, |
T const * | diag | ||
) |
Sets the diagonal elements of the given matrix.
Definition at line 351 of file matrix_tools.h.
Matrix< T, N, N > & math::matrix_set_identity | ( | Matrix< T, N, N > * | mat | ) |
Sets the given square matrix to the identity matrix.
The function returns a reference to the given matrix.
Definition at line 307 of file matrix_tools.h.
T * math::matrix_set_identity | ( | T * | mat, |
int | n | ||
) |
Sets the given square matrix of dimension 'n' to the identity matrix.
The function returns the argument pointer.
Definition at line 317 of file matrix_tools.h.
void math::matrix_svd | ( | Matrix< T, M, N > const & | mat_a, |
Matrix< T, M, N > * | mat_u, | ||
Matrix< T, N, N > * | mat_s, | ||
Matrix< T, N, N > * | mat_v, | ||
T const & | epsilon = T( 1e-12 ) |
||
) |
SVD for compile-time fixed-size matrices.
The implementation of this function uses the dynamic-size matrices interface in the background. Any of the results can be null, however, this does not save operations.
Definition at line 881 of file matrix_svd.h.
void math::matrix_svd | ( | T const * | mat_a, |
int | rows, | ||
int | cols, | ||
T * | mat_u, | ||
T * | vec_s, | ||
T * | mat_v, | ||
T const & | epsilon = T( 1e-12 ) |
||
) |
SVD for dynamic-size matrices A of size MxN (M rows, N columns).
The function decomposes input matrix A such that A = USV^T where A is MxN, U is MxN, S is a N-vector and V is NxN. Any of U, S or V can be null, however, this does not save operations.
Usually, M >= N, i.e. the input matrix has more rows than columns. If M > 5/3 N, QR decomposition is used to do an economy SVD after Chan that saves some operations. This SVD also handles the case where M < N. In this case, zero rows are internally added to A until A is a square matrix.
References:
Definition at line 699 of file matrix_svd.h.
void math::matrix_swap_columns | ( | T *const | mat, |
int | rows, | ||
int | cols, | ||
int | c1, | ||
int | c2 | ||
) |
Swaps the columns c1 and c2 of matrix mat with dimension rows, cols.
Definition at line 620 of file matrix_tools.h.
void math::matrix_swap_rows | ( | T * | mat, |
int | rows, | ||
int | cols, | ||
int | r1, | ||
int | r2 | ||
) |
Swaps the rows r1 and r2 of matrix mat with dimension rows, cols.
Definition at line 628 of file matrix_tools.h.
|
inline |
Calculates the trace of the given matrix.
Definition at line 370 of file matrix_tools.h.
void math::matrix_transpose | ( | T * | mat, |
int | rows, | ||
int | cols | ||
) |
Definition at line 553 of file matrix_tools.h.
void math::matrix_transpose | ( | T const * | mat, |
int | rows, | ||
int | cols | ||
) |
In-place transpose of a dynamically sized dense matrix.
The resulting matrix has number of rows and columns exchanged.
void math::matrix_transpose_multiply | ( | T const * | mat_a, |
int | rows, | ||
int | cols, | ||
T * | mat_res | ||
) |
Matrix multiplication of the transposed with itself.
This computes for a given matrix A the product R = A^T * A. The resulting matrix is of size cols times cols.
Definition at line 587 of file matrix_tools.h.
Matrix< T, 4, 4 > math::matrix_viewtrans | ( | Vector< T, 3 > const & | campos, |
Vector< T, 3 > const & | viewdir, | ||
Vector< T, 3 > const & | upvec | ||
) |
Creates a view transformation matrix for camera parameters given as camera position, normalized viewing direction, and normalized up-vector.
Definition at line 247 of file matrix_tools.h.
T const & math::max | ( | T const & | a, |
T const & | b, | ||
T const & | c | ||
) |
Returns the maximum value of three arguments.
Definition at line 227 of file functions.h.
T const & math::min | ( | T const & | a, |
T const & | b, | ||
T const & | c | ||
) |
Returns the minimum value of three arguments.
Definition at line 219 of file functions.h.
|
inlineprotected |
|
inline |
Serializing a vector to an output stream.
Definition at line 292 of file quaternion.h.
|
inlineprotected |
|
constexpr |
Returns the number of one bits of an integer.
Definition at line 166 of file functions.h.
|
inline |
Removes the fractional part of the value to the closest integer.
Definition at line 70 of file functions.h.
|
inline |
Sinc function.
Definition at line 156 of file functions.h.
|
inline |
Definition at line 248 of file functions.h.