PlayRho  2.0.0
An interactive physics engine & library.
Matrix.hpp File Reference

Definition of the Matrix alias and closely related code. More...

#include <cstdlib>
#include <type_traits>
#include <playrho/Vector.hpp>
#include <playrho/Vector2.hpp>
#include <playrho/Real.hpp>
#include <playrho/Units.hpp>
Include dependency graph for Matrix.hpp:
This graph shows which files directly or indirectly include this file:

Classes

struct  playrho::detail::IsMatrix< typename >
 Trait class for checking if type is a matrix type. More...
 
struct  playrho::detail::IsMatrix< Vector< Vector< T, N >, M > >
 Trait class specialization for checking if type is a matrix type. More...
 
struct  playrho::detail::IsSquareMatrix< typename >
 Trait class for checking if type is a square matrix type. More...
 
struct  playrho::detail::IsSquareMatrix< Vector< Vector< T, M >, M > >
 Trait class specialization for checking if type is a square matrix type. More...
 

Namespaces

 playrho
 
 playrho::detail
 

Typedefs

using playrho::InvMass22 = Matrix22< InvMass >
 2 by 2 matrix of InvMass elements.
 
using playrho::Mass22 = Matrix22< Mass >
 2 by 2 matrix of Mass elements.
 
using playrho::Mat22 = Matrix22< Real >
 2 by 2 matrix of Real elements.
 
using playrho::Mat33 = Matrix33< Real >
 3 by 3 matrix of Real elements.
 
template<typename T , std::size_t M, std::size_t N>
using playrho::Matrix = Vector< Vector< T, N >, M >
 Generic M by N matrix. More...
 
template<typename T >
using playrho::Matrix22 = Matrix< T, 2, 2 >
 2 by 2 matrix.
 
template<typename T >
using playrho::Matrix33 = Matrix< T, 3, 3 >
 3 by 3 matrix.
 

Functions

template<typename T , std::size_t N>
constexpr std::enable_if_t<!IsVectorV< T >, Vector< Vector< T, 1 >, N > > playrho::GetColumnMatrix (Vector< T, N > arg)
 Gets the specified column of the given matrix as a column matrix.
 
template<typename T >
constexpr std::enable_if_t< IsSquareMatrixV< T >, T > playrho::GetIdentity ()
 Gets the identity matrix of the template type and size as given by the argument. More...
 
template<typename T , std::size_t N>
constexpr std::enable_if_t<!IsVectorV< T >, Matrix< T, N, N > > playrho::GetIdentityMatrix ()
 Gets the identity matrix of the template type and size. More...
 
template<typename T , std::size_t N>
constexpr std::enable_if_t<!IsVectorV< T >, Vector< Vector< T, N >, 1 > > playrho::GetRowMatrix (Vector< T, N > arg)
 Gets the specified row of the given matrix as a row matrix.
 
constexpr auto playrho::IsValid (const Mat22 &value) noexcept -> bool
 Determines if the given value is valid. More...
 
template<typename T , std::size_t M, std::size_t N>
constexpr auto playrho::operator+ (const Matrix< T, M, N > &lhs, const Matrix< T, M, N > &rhs) noexcept
 Matrix addition operator for two same-type, same-sized matrices. More...
 
template<typename T , std::size_t M, std::size_t N>
constexpr auto playrho::operator- (const Matrix< T, M, N > &lhs, const Matrix< T, M, N > &rhs) noexcept
 Matrix subtraction operator for two same-type, same-sized matrices. More...
 

Variables

template<class T >
constexpr bool playrho::IsMatrixV = detail::IsMatrix<T>::value
 Determines whether the given type is a Matrix type.
 
template<class T >
constexpr bool playrho::IsSquareMatrixV = detail::IsSquareMatrix<T>::value
 Determines whether the given type is a square Matrix type.
 

Detailed Description

Definition of the Matrix alias and closely related code.