Tuesday
Classes | Typedefs | Functions
<tue/mat.hpp>

Detailed Description

The mat class template and its associated functions.

Classes

class  tue::mat< T, C, R >
 A column-major matrix. More...
 

Typedefs

template<typename T >
using tue::mat2x2 = mat< T, 2, 2 >
 A 2x2 matrix. More...
 
template<typename T >
using tue::mat2x3 = mat< T, 2, 3 >
 A 2x3 matrix. More...
 
template<typename T >
using tue::mat2x4 = mat< T, 2, 4 >
 A 2x4 matrix. More...
 
template<typename T >
using tue::mat3x2 = mat< T, 3, 2 >
 A 3x2 matrix. More...
 
template<typename T >
using tue::mat3x3 = mat< T, 3, 3 >
 A 3x3 matrix. More...
 
template<typename T >
using tue::mat3x4 = mat< T, 3, 4 >
 A 3x4 matrix. More...
 
template<typename T >
using tue::mat4x2 = mat< T, 4, 2 >
 A 4x2 matrix. More...
 
template<typename T >
using tue::mat4x3 = mat< T, 4, 3 >
 A 4x3 matrix. More...
 
template<typename T >
using tue::mat4x4 = mat< T, 4, 4 >
 A 4x4 matrix. More...
 
using tue::fmat2x2 = mat2x2< float >
 A 2x2 matrix with float components. More...
 
using tue::fmat2x3 = mat2x3< float >
 A 2x3 matrix with float components. More...
 
using tue::fmat2x4 = mat2x4< float >
 A 2x4 matrix with float components. More...
 
using tue::fmat3x2 = mat3x2< float >
 A 3x2 matrix with float components. More...
 
using tue::fmat3x3 = mat3x3< float >
 A 3x3 matrix with float components. More...
 
using tue::fmat3x4 = mat3x4< float >
 A 3x4 matrix with float components. More...
 
using tue::fmat4x2 = mat4x2< float >
 A 4x2 matrix with float components. More...
 
using tue::fmat4x3 = mat4x3< float >
 A 4x3 matrix with float components. More...
 
using tue::fmat4x4 = mat4x4< float >
 A 4x4 matrix with float components. More...
 
using tue::dmat2x2 = mat2x2< double >
 A 2x2 matrix with double components. More...
 
using tue::dmat2x3 = mat2x3< double >
 A 2x3 matrix with double components. More...
 
using tue::dmat2x4 = mat2x4< double >
 A 2x4 matrix with double components. More...
 
using tue::dmat3x2 = mat3x2< double >
 A 3x2 matrix with double components. More...
 
using tue::dmat3x3 = mat3x3< double >
 A 3x3 matrix with double components. More...
 
using tue::dmat3x4 = mat3x4< double >
 A 3x4 matrix with double components. More...
 
using tue::dmat4x2 = mat4x2< double >
 A 4x2 matrix with double components. More...
 
using tue::dmat4x3 = mat4x3< double >
 A 4x3 matrix with double components. More...
 
using tue::dmat4x4 = mat4x4< double >
 A 4x4 matrix with double components. More...
 

Functions

template<typename T , int C, int R>
constexpr mat< decltype(+std::declval< T >)), C, R > tue::operator+ (const mat< T, C, R > &m) noexcept
 Computes the unary plus of each component of m. More...
 
template<typename T , int C, int R>
constexpr mat< decltype(-std::declval< T >)), C, R > tue::operator- (const mat< T, C, R > &m) noexcept
 Computes the unary minus of each component of m. More...
 
template<typename T , int C, int R>
constexpr mat< decltype(~std::declval< T >)), C, R > tue::operator~ (const mat< T, C, R > &m) noexcept
 Computes the bitwise NOT of each component of m. More...
 
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component< T >::value, mat< decltype(std::declval< T >)+std::declval< U >)), C, R > > tue::operator+ (const T &lhs, const mat< U, C, R > &rhs) noexcept
 Computes the sums of lhs and each component of rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component< U >::value, mat< decltype(std::declval< T >)+std::declval< U >)), C, R > > tue::operator+ (const mat< T, C, R > &lhs, const U &rhs) noexcept
 Computes the sums of each component of lhs and rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr mat< decltype(std::declval< T >)+std::declval< U >)), C, R > tue::operator+ (const mat< T, C, R > &lhs, const mat< U, C, R > &rhs) noexcept
 Computes the sums of each component of lhs and each corresponding component of rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component< T >::value, mat< decltype(std::declval< T >)-std::declval< U >)), C, R > > tue::operator- (const T &lhs, const mat< U, C, R > &rhs) noexcept
 Computes the differences between lhs and each component of rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component< U >::value, mat< decltype(std::declval< T >)-std::declval< U >)), C, R > > tue::operator- (const mat< T, C, R > &lhs, const U &rhs) noexcept
 Computes the differences between each component of lhs and rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr mat< decltype(std::declval< T >)-std::declval< U >)), C, R > tue::operator- (const mat< T, C, R > &lhs, const mat< U, C, R > &rhs) noexcept
 Computes the differences between each component of lhs and each corresponding component of rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component< T >::value, mat< decltype(std::declval< T >)*std::declval< U >)), C, R > > tue::operator* (const T &lhs, const mat< U, C, R > &rhs) noexcept
 Computes the products of lhs and each component of rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component< U >::value, mat< decltype(std::declval< T >)*std::declval< U >)), C, R > > tue::operator* (const mat< T, C, R > &lhs, const U &rhs) noexcept
 Computes the products of each component of lhs and rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr vec< decltype(std::declval< T >)*std::declval< U >)), C > tue::operator* (const vec< T, R > &lhs, const mat< U, C, R > &rhs) noexcept
 Computes the matrix product of lhs and rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr vec< decltype(std::declval< T >)*std::declval< U >)), R > tue::operator* (const mat< T, C, R > &lhs, const vec< U, C > &rhs) noexcept
 Computes the matrix product of lhs and rhs. More...
 
template<typename T , typename U , int C, int N, int R>
constexpr mat< decltype(std::declval< T >)*std::declval< U >)), C, R > tue::operator* (const mat< T, N, R > &lhs, const mat< U, C, N > &rhs) noexcept
 Computes the matrix product of lhs and rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component< T >::value, mat< decltype(std::declval< T >)/std::declval< U >)), C, R > > tue::operator/ (const T &lhs, const mat< U, C, R > &rhs) noexcept
 Computes the quotients of lhs over each component of rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component< U >::value, mat< decltype(std::declval< T >)/std::declval< U >)), C, R > > tue::operator/ (const mat< T, C, R > &lhs, const U &rhs) noexcept
 Computes the quotients of each component of lhs over rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr mat< decltype(std::declval< T >)/std::declval< U >)), C, R > tue::operator/ (const mat< T, C, R > &lhs, const mat< U, C, R > &rhs) noexcept
 Computes the quotients of each component of lhs over each corresponding component of rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component< T >::value, mat< decltype(std::declval< T >)%std::declval< U >)), C, R > > tue::operator% (const T &lhs, const mat< U, C, R > &rhs) noexcept
 Computes the modulos of lhs over each component of rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component< U >::value, mat< decltype(std::declval< T >)%std::declval< U >)), C, R > > tue::operator% (const mat< T, C, R > &lhs, const U &rhs) noexcept
 Computes the modulos of each component of lhs over rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr mat< decltype(std::declval< T >)%std::declval< U >)), C, R > tue::operator% (const mat< T, C, R > &lhs, const mat< U, C, R > &rhs) noexcept
 Computes the modulos of each component of lhs over each corresponding component of rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component< T >::value, mat< decltype(std::declval< T >)&std::declval< U >)), C, R > > tue::operator& (const T &lhs, const mat< U, C, R > &rhs) noexcept
 Computes the bitwise AND of lhs and each component of rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component< U >::value, mat< decltype(std::declval< T >)&std::declval< U >)), C, R > > tue::operator& (const mat< T, C, R > &lhs, const U &rhs) noexcept
 Computes the bitwise AND of each component of lhs and rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr mat< decltype(std::declval< T >)&std::declval< U >)), C, R > tue::operator& (const mat< T, C, R > &lhs, const mat< U, C, R > &rhs) noexcept
 Computes the bitwise AND of each component of lhs and each corresponding component of rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component< T >::value, mat< decltype(std::declval< T >)|std::declval< U >)), C, R > > tue::operator| (const T &lhs, const mat< U, C, R > &rhs) noexcept
 Computes the bitwise OR of lhs and each component of rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component< U >::value, mat< decltype(std::declval< T >)|std::declval< U >)), C, R > > tue::operator| (const mat< T, C, R > &lhs, const U &rhs) noexcept
 Computes the bitwise OR of each component of lhs and rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr mat< decltype(std::declval< T >)|std::declval< U >)), C, R > tue::operator| (const mat< T, C, R > &lhs, const mat< U, C, R > &rhs) noexcept
 Computes the bitwise OR of each component of lhs and each corresponding component of rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component< T >::value, mat< decltype(std::declval< T >)^std::declval< U >)), C, R > > tue::operator^ (const T &lhs, const mat< U, C, R > &rhs) noexcept
 Computes the bitwise XOR of lhs and each component of rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component< U >::value, mat< decltype(std::declval< T >)^std::declval< U >)), C, R > > tue::operator^ (const mat< T, C, R > &lhs, const U &rhs) noexcept
 Computes the bitwise XOR of each component of lhs and rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr mat< decltype(std::declval< T >)^std::declval< U >)), C, R > tue::operator^ (const mat< T, C, R > &lhs, const mat< U, C, R > &rhs) noexcept
 Computes the bitwise XOR of each component of lhs and each corresponding component of rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component< T >::value, mat< decltype(std::declval< T >) shift_left std::declval< U >)), C, R > > tue::operator<< (const T &lhs, const mat< U, C, R > &rhs) noexcept
 Computes the bitwise shifts left of lhs by each component of rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component< U >::value, mat< decltype(std::declval< T >) shift_left std::declval< U >)), C, R > > tue::operator<< (const mat< T, C, R > &lhs, const U &rhs) noexcept
 Computes the bitwise shifts left of each component of lhs by rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr mat< decltype(std::declval< T >) shift_left std::declval< U >)), C, R > tue::operator<< (const mat< T, C, R > &lhs, const mat< U, C, R > &rhs) noexcept
 Computes the bitwise shifts left of each component of lhs by each corresponding component of rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component< T >::value, mat< decltype(std::declval< T >) shift_right std::declval< U >)), C, R > > tue::operator>> (const T &lhs, const mat< U, C, R > &rhs) noexcept
 Computes the bitwise shifts right of lhs by each component of rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component< U >::value, mat< decltype(std::declval< T >) shift_right std::declval< U >)), C, R > > tue::operator>> (const mat< T, C, R > &lhs, const U &rhs) noexcept
 Computes the bitwise shifts right of each component of lhs by rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr mat< decltype(std::declval< T >) shift_right std::declval< U >)), C, R > tue::operator>> (const mat< T, C, R > &lhs, const mat< U, C, R > &rhs) noexcept
 Computes the bitwise shifts right of each component of lhs by each corresponding component of rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr bool tue::operator== (const mat< T, C, R > &lhs, const mat< U, C, R > &rhs) noexcept
 Determines whether or not two mat's compare equal. More...
 
template<typename T , typename U , int C, int R>
constexpr bool tue::operator!= (const mat< T, C, R > &lhs, const mat< U, C, R > &rhs) noexcept
 Determines whether or not two mat's compare not equal. More...
 
template<typename T , int C, int R>
mat< T, C, R > tue::math::sin (const mat< T, C, R > &m) noexcept
 Computes tue::math::sin() for each component of m. More...
 
template<typename T , int C, int R>
mat< T, C, R > tue::math::cos (const mat< T, C, R > &m) noexcept
 Computes tue::math::cos() for each component of m. More...
 
template<typename T , int C, int R>
void tue::math::sincos (const mat< T, C, R > &m, mat< T, C, R > &sin_out, mat< T, C, R > &cos_out) noexcept
 Computes tue::math::sincos() for each component of m. More...
 
template<typename T , int C, int R>
mat< T, C, R > tue::math::exp (const mat< T, C, R > &m) noexcept
 Computes tue::math::exp() for each component of m. More...
 
template<typename T , int C, int R>
mat< T, C, R > tue::math::log (const mat< T, C, R > &m) noexcept
 Computes tue::math::log() for each component of m. More...
 
template<typename T , int C, int R>
mat< T, C, R > tue::math::abs (const mat< T, C, R > &m) noexcept
 Computes tue::math::abs() for each component of m. More...
 
template<typename T , int C, int R>
mat< T, C, R > tue::math::pow (const mat< T, C, R > &bases, const mat< T, C, R > &exponents) noexcept
 Computes tue::math::pow() for each component of bases and each corresponding component of exponents. More...
 
template<typename T , int C, int R>
mat< T, C, R > tue::math::recip (const mat< T, C, R > &m) noexcept
 Computes tue::math::recip() for each component of m. More...
 
template<typename T , int C, int R>
mat< T, C, R > tue::math::sqrt (const mat< T, C, R > &m) noexcept
 Computes tue::math::sqrt() for each component of m. More...
 
template<typename T , int C, int R>
mat< T, C, R > tue::math::rsqrt (const mat< T, C, R > &m) noexcept
 Computes tue::math::rsqrt() for each component of m. More...
 
template<typename T , int C, int R>
mat< T, C, R > tue::math::min (const mat< T, C, R > &m1, const mat< T, C, R > &m2) noexcept
 Computes tue::math::min() for each corresponding pair of components from m1 and m2. More...
 
template<typename T , int C, int R>
mat< T, C, R > tue::math::max (const mat< T, C, R > &m1, const mat< T, C, R > &m2) noexcept
 Computes tue::math::max() for each corresponding pair of components from m1 and m2. More...
 
template<typename T , typename U , int C, int R>
mat< U, C, R > tue::math::mask (const mat< T, C, R > &conditions, const mat< U, C, R > &values) noexcept
 Computes tue::math::mask() for each corresponding pair of components from conditions and values. More...
 
template<typename T , typename U , int C, int R>
mat< U, C, R > tue::math::select (const mat< T, C, R > &conditions, const mat< U, C, R > &values, const mat< U, C, R > &otherwise) noexcept
 Computes tue::math::select() for each corresponding trio of components from conditions, values, and otherwise. More...
 
template<typename T , int C, int R>
mat< decltype(tue::math::less(std::declval< T >), std::declval< T >))), C, R > tue::math::less (const mat< T, C, R > &lhs, const mat< T, C, R > &rhs) noexcept
 Computes tue::math::less() for each corresponding pair of components from lhs and rhs. More...
 
template<typename T , int C, int R>
mat< decltype(tue::math::less_equal(std::declval< T >), std::declval< T >))), C, R > tue::math::less_equal (const mat< T, C, R > &lhs, const mat< T, C, R > &rhs) noexcept
 Computes tue::math::less_equal() for each corresponding pair of components from lhs and rhs. More...
 
template<typename T , int C, int R>
mat< decltype(tue::math::greater(std::declval< T >), std::declval< T >))), C, R > tue::math::greater (const mat< T, C, R > &lhs, const mat< T, C, R > &rhs) noexcept
 Computes tue::math::greater() for each corresponding pair of components from lhs and rhs. More...
 
template<typename T , int C, int R>
mat< decltype(tue::math::greater_equal(std::declval< T >), std::declval< T >))), C, R > tue::math::greater_equal (const mat< T, C, R > &lhs, const mat< T, C, R > &rhs) noexcept
 Computes tue::math::greater_equal() for each corresponding pair of components from lhs and rhs. More...
 
template<typename T , int C, int R>
mat< decltype(tue::math::equal(std::declval< T >), std::declval< T >))), C, R > tue::math::equal (const mat< T, C, R > &lhs, const mat< T, C, R > &rhs) noexcept
 Computes tue::math::equal() for each corresponding pair of components from lhs and rhs. More...
 
template<typename T , int C, int R>
mat< decltype(tue::math::not_equal(std::declval< T >), std::declval< T >))), C, R > tue::math::not_equal (const mat< T, C, R > &lhs, const mat< T, C, R > &rhs) noexcept
 Computes tue::math::not_equal() for each corresponding pair of components from lhs and rhs. More...
 
template<typename T , typename U , int C, int R>
constexpr mat< decltype(std::declval< T >)*std::declval< U >)), C, R > tue::math::comp_mult (const mat< T, C, R > &lhs, const mat< U, C, R > &rhs) noexcept
 Computes the products of each component of lhs and each corresponding component of rhs. More...
 
template<typename T , int C, int R>
constexpr mat< T, R, C > tue::math::transpose (const mat< T, C, R > &m) noexcept
 Computes the transpose of m. More...
 

Class Documentation

class tue::mat

template<typename T, int C, int R>
class tue::mat< T, C, R >

A column-major matrix.

mat have the same size and alignment requirements as vec<T, R>[C].

Template Parameters
TThe component type. is_vec_component<T>value must be true.
CThe column count. Must be 2, 3, or 4.
RThe row count. Must be 2, 3, or 4.

Public Types

using component_type = T
 This mat type's component type. More...
 

Static Public Attributes

static constexpr int column_count = C
 This mat type's column count. More...
 
static constexpr int row_count = R
 This mat type's row count. More...
 
static constexpr int component_count = C * R
 This mat type's component count. More...
 

Constructors, Conversions, and Factory Functions

 mat () noexcept=default
 Default constructs each component. More...
 
constexpr mat (const T &x) noexcept
 Constructs each component along the main diagonal with the same value, and all other components with 0. More...
 
constexpr mat (const vec< T, R > &c) noexcept
 Constructs each column with the same values. More...
 
constexpr mat (const vec< T, R > &c0, const vec< T, R > &c1) noexcept
 Constructs a mat with the given columns. More...
 
constexpr mat (const vec< T, R > &c0, const vec< T, R > &c1, const vec< T, R > &c2) noexcept
 Constructs a mat with the given columns. More...
 
constexpr mat (const vec< T, R > &c0, const vec< T, R > &c1, const vec< T, R > &c2, const vec< T, R > &c3) noexcept
 Constructs a mat with the given columns. More...
 
template<int MC, int MR>
constexpr mat (const mat< T, MC, MR > &m) noexcept
 Explicitly casts another mat to a new size. More...
 
template<typename U >
constexpr mat (const mat< U, C, R > &m) noexcept
 Explicitly casts another mat to a new component type. More...
 
template<typename U >
constexpr operator mat< U, C, R > () const noexcept
 Implicitly casts this mat to a new component type. More...
 
static constexpr mat< T, C, R > fill (const T &x) noexcept
 Returns a mat with each component constructed with the same value. More...
 
static constexpr mat< T, C, R > identity () noexcept
 Returns a mat with the main diagonal set to 1 and all other components set to 0. More...
 
static constexpr mat< T, C, R > zero () noexcept
 Returns a mat with each component set to 0. More...
 

Public Member Functions

template<typename I >
constexpr const vec< T, R > & operator[] (const I &i) const noexcept
 Returns a reference to the column at the given index. More...
 
template<typename I >
vec< T, R > & operator[] (const I &i) noexcept
 Returns a reference to the column at the given index. More...
 
const T * data () const noexcept
 Returns a pointer to this mat's underlying component array. More...
 
T * data () noexcept
 Returns a pointer to this mat's underlying component array. More...
 
const vec< T, R > * columns () const noexcept
 Returns a pointer to this mat's underlying column array. More...
 
vec< T, R > * columns () noexcept
 Returns a pointer to this mat's underlying column array. More...
 
template<typename I >
constexpr vec< T, R > column (const I &i) const noexcept
 Returns a copy of the column at the given index. More...
 
template<typename I >
void set_column (const I &i, const vec< T, R > &v) noexcept
 Sets the values of the column at the given index. More...
 
template<typename J >
constexpr vec< T, C > row (const J &j) const noexcept
 Returns a copy of the row at the given index. More...
 
template<typename J >
void set_row (const J &j, const vec< T, C > &v) noexcept
 Sets the values of the row at the given index. More...
 
mat< T, C, R > & operator++ () noexcept
 Pre-increments each component of this mat. More...
 
mat< T, C, R > operator++ (int) noexcept
 Post-increments each component of this mat. More...
 
mat< T, C, R > & operator-- () noexcept
 Pre-decrements each component of this mat. More...
 
mat< T, C, R > operator-- (int) noexcept
 Post-decrements each component of this mat. More...
 
template<typename U >
std::enable_if_t< is_vec_component< U >::value, mat< T, C, R > & > operator+= (const U &x) noexcept
 Adds x to each component of this mat. More...
 
template<typename U >
mat< T, C, R > & operator+= (const mat< U, C, R > &m) noexcept
 Adds each component of m to the corresponding component of this mat. More...
 
template<typename U >
std::enable_if_t< is_vec_component< U >::value, mat< T, C, R > & > operator-= (const U &x) noexcept
 Subtracts x from each component of this mat. More...
 
template<typename U >
mat< T, C, R > & operator-= (const mat< U, C, R > &m) noexcept
 Subtracts each component of m from the corresponding component of this mat. More...
 
template<typename U >
std::enable_if_t< is_vec_component< U >::value, mat< T, C, R > & > operator*= (const U &x) noexcept
 Multiplies each component of this mat by x. More...
 
template<typename U >
mat< T, C, R > & operator*= (const mat< U, C, C > &m) noexcept
 Matrix multiplies this mat by m. More...
 
template<typename U >
std::enable_if_t< is_vec_component< U >::value, mat< T, C, R > & > operator/= (const U &x) noexcept
 Divides each component of this mat by x. More...
 
template<typename U >
mat< T, C, R > & operator/= (const mat< U, C, R > &m) noexcept
 Divides each component of this mat by the corresponding component from m. More...
 
template<typename U >
std::enable_if_t< is_vec_component< U >::value, mat< T, C, R > & > operator%= (const U &x) noexcept
 Modulos each component of this mat by x. More...
 
template<typename U >
mat< T, C, R > & operator%= (const mat< U, C, R > &m) noexcept
 Modulos each component of this mat by the corresponding component from m. More...
 
template<typename U >
std::enable_if_t< is_vec_component< U >::value, mat< T, C, R > & > operator&= (const U &x) noexcept
 Bitwise ANDs each component of this mat with x. More...
 
template<typename U >
mat< T, C, R > & operator&= (const mat< U, C, R > &m) noexcept
 Bitwise ANDs each component of this mat with the corresponding component from m. More...
 
template<typename U >
std::enable_if_t< is_vec_component< U >::value, mat< T, C, R > & > operator|= (const U &x) noexcept
 Bitwise ORs each component of this mat with x. More...
 
template<typename U >
mat< T, C, R > & operator|= (const mat< U, C, R > &m) noexcept
 Bitwise ORs each component of this mat with the corresponding component from m. More...
 
template<typename U >
std::enable_if_t< is_vec_component< U >::value, mat< T, C, R > & > operator^= (const U &x) noexcept
 Bitwise XORs each component of this mat with x. More...
 
template<typename U >
mat< T, C, R > & operator^= (const mat< U, C, R > &m) noexcept
 Bitwise XORs each component of this mat with the corresponding component from m. More...
 
template<typename U >
std::enable_if_t< is_vec_component< U >::value, mat< T, C, R > & > operator<<= (const U &x) noexcept
 Bitwise shifts left each component of this mat by x. More...
 
template<typename U >
mat< T, C, R > & operator<<= (const mat< U, C, R > &m) noexcept
 Bitwise shifts left each component of this mat by the corresponding component from m. More...
 
template<typename U >
std::enable_if_t< is_vec_component< U >::value, mat< T, C, R > & > operator>>= (const U &x) noexcept
 Bitwise shifts right each component of this mat by x. More...
 
template<typename U >
mat< T, C, R > & operator>>= (const mat< U, C, R > &m) noexcept
 Bitwise shifts right each component of this mat by the corresponding component from m. More...
 

Member Typedef Documentation

template<typename T, int C, int R>
using tue::mat< T, C, R >::component_type = T

This mat type's component type.

Member Data Documentation

template<typename T, int C, int R>
constexpr int tue::mat< T, C, R >::column_count = C
static

This mat type's column count.

template<typename T, int C, int R>
constexpr int tue::mat< T, C, R >::row_count = R
static

This mat type's row count.

template<typename T, int C, int R>
constexpr int tue::mat< T, C, R >::component_count = C * R
static

This mat type's component count.

Constructor & Destructor Documentation

template<typename T, int C, int R>
tue::mat< T, C, R >::mat ( )
defaultnoexcept

Default constructs each component.

template<typename T, int C, int R>
constexpr tue::mat< T, C, R >::mat ( const T &  x)
inlineexplicitnoexcept

Constructs each component along the main diagonal with the same value, and all other components with 0.

Parameters
xThe value to construct the main diagonal with.
template<typename T, int C, int R>
constexpr tue::mat< T, C, R >::mat ( const vec< T, R > &  c)
inlineexplicitnoexcept

Constructs each column with the same values.

Parameters
cThe values to construct each column with.
template<typename T, int C, int R>
constexpr tue::mat< T, C, R >::mat ( const vec< T, R > &  c0,
const vec< T, R > &  c1 
)
inlinenoexcept

Constructs a mat with the given columns.

This overload is only available when C equals 2.

Parameters
c0The first column.
c1The second column.
template<typename T, int C, int R>
constexpr tue::mat< T, C, R >::mat ( const vec< T, R > &  c0,
const vec< T, R > &  c1,
const vec< T, R > &  c2 
)
inlinenoexcept

Constructs a mat with the given columns.

This overload is only available when C equals 3.

Parameters
c0The first column.
c1The second column.
c2The third column.
template<typename T, int C, int R>
constexpr tue::mat< T, C, R >::mat ( const vec< T, R > &  c0,
const vec< T, R > &  c1,
const vec< T, R > &  c2,
const vec< T, R > &  c3 
)
inlinenoexcept

Constructs a mat with the given columns.

This overload is only available when C equals 4.

Parameters
c0The first column.
c1The second column.
c2The third column.
c3The fourth column.
template<typename T, int C, int R>
template<int MC, int MR>
constexpr tue::mat< T, C, R >::mat ( const mat< T, MC, MR > &  m)
inlineexplicitnoexcept

Explicitly casts another mat to a new size.

If the new mat is larger than m in either dimension, the new components without corresponding components in m will be constructed with 1 along the main diagonal and 0 otherwise. If the new mat is smaller in either dimension, the components from m without corresponding components in the new mat will be ignored.

Template Parameters
MCThe column count of m.
MRThe row count of m.
Parameters
mThe mat to cast from.
template<typename T, int C, int R>
template<typename U >
constexpr tue::mat< T, C, R >::mat ( const mat< U, C, R > &  m)
inlineexplicitnoexcept

Explicitly casts another mat to a new component type.

Template Parameters
UThe component type of m.
Parameters
mThe mat to cast from.

Member Function Documentation

template<typename T, int C, int R>
template<typename U >
constexpr tue::mat< T, C, R >::operator mat< U, C, R > ( ) const
inlinenoexcept

Implicitly casts this mat to a new component type.

Template Parameters
UThe new component type.
Returns
A new mat with the new component type.
template<typename T, int C, int R>
static constexpr mat<T, C, R> tue::mat< T, C, R >::fill ( const T &  x)
inlinestaticnoexcept

Returns a mat with each component constructed with the same value.

Parameters
xThe value to construct each component with.
Returns
A mat with each component constructed with the same value.
template<typename T, int C, int R>
static constexpr mat<T, C, R> tue::mat< T, C, R >::identity ( )
inlinestaticnoexcept

Returns a mat with the main diagonal set to 1 and all other components set to 0.

Returns
A mat with the main diagonal set to 1 and all other components set to 0.
template<typename T, int C, int R>
static constexpr mat<T, C, R> tue::mat< T, C, R >::zero ( )
inlinestaticnoexcept

Returns a mat with each component set to 0.

Returns
A mat with each component set to 0.
template<typename T, int C, int R>
template<typename I >
constexpr const vec<T, R>& tue::mat< T, C, R >::operator[] ( const I &  i) const
inlinenoexcept

Returns a reference to the column at the given index.

No bounds checking is performed.

Template Parameters
IThe index type.
Parameters
iThe index.
Returns
A reference to the column at the given index.
template<typename T, int C, int R>
template<typename I >
vec<T, R>& tue::mat< T, C, R >::operator[] ( const I &  i)
inlinenoexcept

Returns a reference to the column at the given index.

No bounds checking is performed.

Template Parameters
IThe index type.
Parameters
iThe index.
Returns
A reference to the column at the given index.
template<typename T, int C, int R>
const T* tue::mat< T, C, R >::data ( ) const
inlinenoexcept

Returns a pointer to this mat's underlying component array.

Returns
A pointer to this mat's underlying component array.
template<typename T, int C, int R>
T* tue::mat< T, C, R >::data ( )
inlinenoexcept

Returns a pointer to this mat's underlying component array.

Returns
A pointer to this mat's underlying component array.
template<typename T, int C, int R>
const vec<T, R>* tue::mat< T, C, R >::columns ( ) const
inlinenoexcept

Returns a pointer to this mat's underlying column array.

Returns
A pointer to this mat's underlying column array.
template<typename T, int C, int R>
vec<T, R>* tue::mat< T, C, R >::columns ( )
inlinenoexcept

Returns a pointer to this mat's underlying column array.

Returns
A pointer to this mat's underlying column array.
template<typename T, int C, int R>
template<typename I >
constexpr vec<T, R> tue::mat< T, C, R >::column ( const I &  i) const
inlinenoexcept

Returns a copy of the column at the given index.

No bounds checking is performed.

Template Parameters
IThe index type.
Parameters
iThe index.
Returns
A copy of the column at the given index.
template<typename T, int C, int R>
template<typename I >
void tue::mat< T, C, R >::set_column ( const I &  i,
const vec< T, R > &  v 
)
inlinenoexcept

Sets the values of the column at the given index.

No bounds checking is performed.

Template Parameters
IThe index type.
Parameters
iThe index.
vThe new values for the column.
template<typename T, int C, int R>
template<typename J >
constexpr vec<T, C> tue::mat< T, C, R >::row ( const J &  j) const
inlinenoexcept

Returns a copy of the row at the given index.

No bounds checking is performed.

Template Parameters
JThe index type.
Parameters
jThe index.
Returns
A copy of the row at the given index.
template<typename T, int C, int R>
template<typename J >
void tue::mat< T, C, R >::set_row ( const J &  j,
const vec< T, C > &  v 
)
inlinenoexcept

Sets the values of the row at the given index.

No bounds checking is performed.

Template Parameters
JThe index type.
Parameters
jThe index.
vThe new values for the row.
template<typename T, int C, int R>
mat<T, C, R>& tue::mat< T, C, R >::operator++ ( )
inlinenoexcept

Pre-increments each component of this mat.

Returns
A reference to this mat.
template<typename T, int C, int R>
mat<T, C, R> tue::mat< T, C, R >::operator++ ( int  )
inlinenoexcept

Post-increments each component of this mat.

Returns
A copy of this mat before being incremented.
template<typename T, int C, int R>
mat<T, C, R>& tue::mat< T, C, R >::operator-- ( )
inlinenoexcept

Pre-decrements each component of this mat.

Returns
A reference to this mat.
template<typename T, int C, int R>
mat<T, C, R> tue::mat< T, C, R >::operator-- ( int  )
inlinenoexcept

Post-decrements each component of this mat.

Returns
A copy of this mat before being decremented.
template<typename T, int C, int R>
template<typename U >
std::enable_if_t<is_vec_component<U>::value, mat<T, C, R>&> tue::mat< T, C, R >::operator+= ( const U &  x)
inlinenoexcept

Adds x to each component of this mat.

Template Parameters
UThe type of parameter x.
Parameters
xThe value to add to each component of this mat.
Returns
A reference to this mat.
template<typename T, int C, int R>
template<typename U >
mat<T, C, R>& tue::mat< T, C, R >::operator+= ( const mat< U, C, R > &  m)
inlinenoexcept

Adds each component of m to the corresponding component of this mat.

Template Parameters
UThe component type of m.
Parameters
mThe values to add to each component of this mat.
Returns
A reference to this mat.
template<typename T, int C, int R>
template<typename U >
std::enable_if_t<is_vec_component<U>::value, mat<T, C, R>&> tue::mat< T, C, R >::operator-= ( const U &  x)
inlinenoexcept

Subtracts x from each component of this mat.

Template Parameters
UThe type of parameter x.
Parameters
xThe value to subtract from each component of this mat.
Returns
A reference to this mat.
template<typename T, int C, int R>
template<typename U >
mat<T, C, R>& tue::mat< T, C, R >::operator-= ( const mat< U, C, R > &  m)
inlinenoexcept

Subtracts each component of m from the corresponding component of this mat.

Template Parameters
UThe component type of m.
Parameters
mThe values to subtract from each component of this mat.
Returns
A reference to this mat.
template<typename T, int C, int R>
template<typename U >
std::enable_if_t<is_vec_component<U>::value, mat<T, C, R>&> tue::mat< T, C, R >::operator*= ( const U &  x)
inlinenoexcept

Multiplies each component of this mat by x.

Template Parameters
UThe type of parameter x.
Parameters
xThe value to multiply each component of this mat by.
Returns
A reference to this mat.
template<typename T, int C, int R>
template<typename U >
mat<T, C, R>& tue::mat< T, C, R >::operator*= ( const mat< U, C, C > &  m)
inlinenoexcept

Matrix multiplies this mat by m.

Template Parameters
UThe component type of m.
Parameters
mA mat.
Returns
A reference to this mat.
template<typename T, int C, int R>
template<typename U >
std::enable_if_t<is_vec_component<U>::value, mat<T, C, R>&> tue::mat< T, C, R >::operator/= ( const U &  x)
inlinenoexcept

Divides each component of this mat by x.

Template Parameters
UThe type of parameter x.
Parameters
xThe value to divide each component of this mat by.
Returns
A reference to this mat.
template<typename T, int C, int R>
template<typename U >
mat<T, C, R>& tue::mat< T, C, R >::operator/= ( const mat< U, C, R > &  m)
inlinenoexcept

Divides each component of this mat by the corresponding component from m.

Template Parameters
UThe component type of m.
Parameters
mThe values to divide each component of this mat by.
Returns
A reference to this mat.
template<typename T, int C, int R>
template<typename U >
std::enable_if_t<is_vec_component<U>::value, mat<T, C, R>&> tue::mat< T, C, R >::operator%= ( const U &  x)
inlinenoexcept

Modulos each component of this mat by x.

Template Parameters
UThe type of parameter x.
Parameters
xThe value to modulo each component of this mat by.
Returns
A reference to this mat.
template<typename T, int C, int R>
template<typename U >
mat<T, C, R>& tue::mat< T, C, R >::operator%= ( const mat< U, C, R > &  m)
inlinenoexcept

Modulos each component of this mat by the corresponding component from m.

Template Parameters
UThe component type of m.
Parameters
mThe values to modulo each component of this mat by.
Returns
A reference to this mat.
template<typename T, int C, int R>
template<typename U >
std::enable_if_t<is_vec_component<U>::value, mat<T, C, R>&> tue::mat< T, C, R >::operator&= ( const U &  x)
inlinenoexcept

Bitwise ANDs each component of this mat with x.

Template Parameters
UThe type of parameter x.
Parameters
xThe value to bitwise AND each component of this mat with.
Returns
A reference to this mat.
template<typename T, int C, int R>
template<typename U >
mat<T, C, R>& tue::mat< T, C, R >::operator&= ( const mat< U, C, R > &  m)
inlinenoexcept

Bitwise ANDs each component of this mat with the corresponding component from m.

Template Parameters
UThe component type of m.
Parameters
mThe values to bitwise AND each component of this mat with.
Returns
A reference to this mat.
template<typename T, int C, int R>
template<typename U >
std::enable_if_t<is_vec_component<U>::value, mat<T, C, R>&> tue::mat< T, C, R >::operator|= ( const U &  x)
inlinenoexcept

Bitwise ORs each component of this mat with x.

Template Parameters
UThe type of parameter x.
Parameters
xThe value to bitwise OR each component of this mat with.
Returns
A reference to this mat.
template<typename T, int C, int R>
template<typename U >
mat<T, C, R>& tue::mat< T, C, R >::operator|= ( const mat< U, C, R > &  m)
inlinenoexcept

Bitwise ORs each component of this mat with the corresponding component from m.

Template Parameters
UThe component type of m.
Parameters
mThe values to bitwise OR each component of this mat with.
Returns
A reference to this mat.
template<typename T, int C, int R>
template<typename U >
std::enable_if_t<is_vec_component<U>::value, mat<T, C, R>&> tue::mat< T, C, R >::operator^= ( const U &  x)
inlinenoexcept

Bitwise XORs each component of this mat with x.

Template Parameters
UThe type of parameter x.
Parameters
xThe value to bitwise XOR each component of this mat with.
Returns
A reference to this mat.
template<typename T, int C, int R>
template<typename U >
mat<T, C, R>& tue::mat< T, C, R >::operator^= ( const mat< U, C, R > &  m)
inlinenoexcept

Bitwise XORs each component of this mat with the corresponding component from m.

Template Parameters
UThe component type of m.
Parameters
mThe values to bitwise XOR each component of this mat with.
Returns
A reference to this mat.
template<typename T, int C, int R>
template<typename U >
std::enable_if_t<is_vec_component<U>::value, mat<T, C, R>&> tue::mat< T, C, R >::operator<<= ( const U &  x)
inlinenoexcept

Bitwise shifts left each component of this mat by x.

Template Parameters
UThe type of parameter x.
Parameters
xThe value to bitwise shift left each component of this mat by.
Returns
A reference to this mat.
template<typename T, int C, int R>
template<typename U >
mat<T, C, R>& tue::mat< T, C, R >::operator<<= ( const mat< U, C, R > &  m)
inlinenoexcept

Bitwise shifts left each component of this mat by the corresponding component from m.

Template Parameters
UThe component type of m.
Parameters
mThe values to bitwise shift left each component of this mat by.
Returns
A reference to this mat.
template<typename T, int C, int R>
template<typename U >
std::enable_if_t<is_vec_component<U>::value, mat<T, C, R>&> tue::mat< T, C, R >::operator>>= ( const U &  x)
inlinenoexcept

Bitwise shifts right each component of this mat by x.

Template Parameters
UThe type of parameter x.
Parameters
xThe value to bitwise shift right each component of this mat by.
Returns
A reference to this mat.
template<typename T, int C, int R>
template<typename U >
mat<T, C, R>& tue::mat< T, C, R >::operator>>= ( const mat< U, C, R > &  m)
inlinenoexcept

Bitwise shifts right each component of this mat by the corresponding component from m.

Template Parameters
UThe component type of m.
Parameters
mThe values to bitwise shift right each component of this mat by.
Returns
A reference to this mat.

Typedef Documentation

template<typename T >
using tue::mat2x2 = typedef mat<T, 2, 2>

A 2x2 matrix.

Template Parameters
TThe component type.
template<typename T >
using tue::mat2x3 = typedef mat<T, 2, 3>

A 2x3 matrix.

Template Parameters
TThe component type.
template<typename T >
using tue::mat2x4 = typedef mat<T, 2, 4>

A 2x4 matrix.

Template Parameters
TThe component type.
template<typename T >
using tue::mat3x2 = typedef mat<T, 3, 2>

A 3x2 matrix.

Template Parameters
TThe component type.
template<typename T >
using tue::mat3x3 = typedef mat<T, 3, 3>

A 3x3 matrix.

Template Parameters
TThe component type.
template<typename T >
using tue::mat3x4 = typedef mat<T, 3, 4>

A 3x4 matrix.

Template Parameters
TThe component type.
template<typename T >
using tue::mat4x2 = typedef mat<T, 4, 2>

A 4x2 matrix.

Template Parameters
TThe component type.
template<typename T >
using tue::mat4x3 = typedef mat<T, 4, 3>

A 4x3 matrix.

Template Parameters
TThe component type.
template<typename T >
using tue::mat4x4 = typedef mat<T, 4, 4>

A 4x4 matrix.

Template Parameters
TThe component type.
using tue::fmat2x2 = typedef mat2x2<float>

A 2x2 matrix with float components.

using tue::fmat2x3 = typedef mat2x3<float>

A 2x3 matrix with float components.

using tue::fmat2x4 = typedef mat2x4<float>

A 2x4 matrix with float components.

using tue::fmat3x2 = typedef mat3x2<float>

A 3x2 matrix with float components.

using tue::fmat3x3 = typedef mat3x3<float>

A 3x3 matrix with float components.

using tue::fmat3x4 = typedef mat3x4<float>

A 3x4 matrix with float components.

using tue::fmat4x2 = typedef mat4x2<float>

A 4x2 matrix with float components.

using tue::fmat4x3 = typedef mat4x3<float>

A 4x3 matrix with float components.

using tue::fmat4x4 = typedef mat4x4<float>

A 4x4 matrix with float components.

using tue::dmat2x2 = typedef mat2x2<double>

A 2x2 matrix with double components.

using tue::dmat2x3 = typedef mat2x3<double>

A 2x3 matrix with double components.

using tue::dmat2x4 = typedef mat2x4<double>

A 2x4 matrix with double components.

using tue::dmat3x2 = typedef mat3x2<double>

A 3x2 matrix with double components.

using tue::dmat3x3 = typedef mat3x3<double>

A 3x3 matrix with double components.

using tue::dmat3x4 = typedef mat3x4<double>

A 3x4 matrix with double components.

using tue::dmat4x2 = typedef mat4x2<double>

A 4x2 matrix with double components.

using tue::dmat4x3 = typedef mat4x3<double>

A 4x3 matrix with double components.

using tue::dmat4x4 = typedef mat4x4<double>

A 4x4 matrix with double components.

Function Documentation

template<typename T , int C, int R>
constexpr mat<decltype(+std::declval<T>)), C, R> tue::operator+ ( const mat< T, C, R > &  m)
inlinenoexcept

Computes the unary plus of each component of m.

Template Parameters
TThe component type of m.
CThe column count of m.
RThe row count of m.
Parameters
mA mat.
Returns
The unary plus of each component of m.
template<typename T , int C, int R>
constexpr mat<decltype(-std::declval<T>)), C, R> tue::operator- ( const mat< T, C, R > &  m)
inlinenoexcept

Computes the unary minus of each component of m.

Template Parameters
TThe component type of m.
CThe column count of m.
RThe row count of m.
Parameters
mA mat.
Returns
The unary minus of each component of m.
template<typename T , int C, int R>
constexpr mat<decltype(~std::declval<T>)), C, R> tue::operator~ ( const mat< T, C, R > &  m)
inlinenoexcept

Computes the bitwise NOT of each component of m.

Template Parameters
TThe component type of m.
CThe column count of m.
RThe row count of m.
Parameters
mA mat.
Returns
The bitwise NOT of each component of m.
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component<T>::value, mat<decltype(std::declval<T>) + std::declval<U>)), C, R> > tue::operator+ ( const T &  lhs,
const mat< U, C, R > &  rhs 
)
inlinenoexcept

Computes the sums of lhs and each component of rhs.

Template Parameters
TThe type of parameter lhs.
UThe component type of rhs.
CThe column count of rhs.
RThe row count of rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The sums of lhs and each component of rhs.
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component<U>::value, mat<decltype(std::declval<T>) + std::declval<U>)), C, R> > tue::operator+ ( const mat< T, C, R > &  lhs,
const U &  rhs 
)
inlinenoexcept

Computes the sums of each component of lhs and rhs.

Template Parameters
TThe component type of lhs.
UThe type of parameter rhs.
CThe column count of lhs.
RThe row count of lhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The sums of each component of lhs and rhs.
template<typename T , typename U , int C, int R>
constexpr mat<decltype(std::declval<T>) + std::declval<U>)), C, R> tue::operator+ ( const mat< T, C, R > &  lhs,
const mat< U, C, R > &  rhs 
)
inlinenoexcept

Computes the sums of each component of lhs and each corresponding component of rhs.

Template Parameters
TThe component type of lhs.
UThe component type of rhs.
CThe column count of both lhs and rhs.
RThe row count of both lhs and rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The sums of each component of lhs and each corresponding component of rhs.
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component<T>::value, mat<decltype(std::declval<T>) - std::declval<U>)), C, R> > tue::operator- ( const T &  lhs,
const mat< U, C, R > &  rhs 
)
inlinenoexcept

Computes the differences between lhs and each component of rhs.

Template Parameters
TThe type of parameter lhs.
UThe component type of rhs.
CThe column count of rhs.
RThe row count of rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The differences between lhs and each component of rhs.
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component<U>::value, mat<decltype(std::declval<T>) - std::declval<U>)), C, R> > tue::operator- ( const mat< T, C, R > &  lhs,
const U &  rhs 
)
inlinenoexcept

Computes the differences between each component of lhs and rhs.

Template Parameters
TThe component type of lhs.
UThe type of parameter rhs.
CThe column count of lhs.
RThe row count of lhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The differences between each component of lhs and rhs.
template<typename T , typename U , int C, int R>
constexpr mat<decltype(std::declval<T>) - std::declval<U>)), C, R> tue::operator- ( const mat< T, C, R > &  lhs,
const mat< U, C, R > &  rhs 
)
inlinenoexcept

Computes the differences between each component of lhs and each corresponding component of rhs.

Template Parameters
TThe component type of lhs.
UThe component type of rhs.
CThe column count of both lhs and rhs.
RThe row count of both lhs and rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The differences between each component of lhs and each corresponding component of rhs.
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component<T>::value, mat<decltype(std::declval<T>) * std::declval<U>)), C, R> > tue::operator* ( const T &  lhs,
const mat< U, C, R > &  rhs 
)
inlinenoexcept

Computes the products of lhs and each component of rhs.

Template Parameters
TThe type of parameter lhs.
UThe component type of rhs.
CThe column count of rhs.
RThe row count of rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The products of lhs and each component of rhs.
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component<U>::value, mat<decltype(std::declval<T>) * std::declval<U>)), C, R> > tue::operator* ( const mat< T, C, R > &  lhs,
const U &  rhs 
)
inlinenoexcept

Computes the products of each component of lhs and rhs.

Template Parameters
TThe component type of lhs.
UThe type of parameter rhs.
CThe column count of lhs.
RThe row count of lhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The products of each component of lhs and rhs.
template<typename T , typename U , int C, int R>
constexpr vec<decltype(std::declval<T>) * std::declval<U>)), C> tue::operator* ( const vec< T, R > &  lhs,
const mat< U, C, R > &  rhs 
)
inlinenoexcept

Computes the matrix product of lhs and rhs.

lhs is treated like a matrix with a single row.

Template Parameters
TThe component type of lhs.
UThe component type of rhs.
CThe column count of rhs.
RThe component count of lhs and row count of rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The matrix product of lhs and rhs.
template<typename T , typename U , int C, int R>
constexpr vec<decltype(std::declval<T>) * std::declval<U>)), R> tue::operator* ( const mat< T, C, R > &  lhs,
const vec< U, C > &  rhs 
)
inlinenoexcept

Computes the matrix product of lhs and rhs.

rhs is treated like a matrix with a single column.

Template Parameters
TThe component type of lhs.
UThe component type of rhs.
CThe column count of lhs and component count of rhs.
RThe row count of lhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The matrix product of lhs and rhs.
template<typename T , typename U , int C, int N, int R>
constexpr mat<decltype(std::declval<T>) * std::declval<U>)), C, R> tue::operator* ( const mat< T, N, R > &  lhs,
const mat< U, C, N > &  rhs 
)
inlinenoexcept

Computes the matrix product of lhs and rhs.

To compute the component-wise product, use tue::math::comp_mult() instead.

Template Parameters
TThe component type of lhs.
UThe component type of rhs.
CThe column count of both lhs and rhs.
RThe row count of both lhs and rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The matrix product of lhs and rhs.
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component<T>::value, mat<decltype(std::declval<T>) / std::declval<U>)), C, R> > tue::operator/ ( const T &  lhs,
const mat< U, C, R > &  rhs 
)
inlinenoexcept

Computes the quotients of lhs over each component of rhs.

Template Parameters
TThe type of parameter lhs.
UThe component type of rhs.
CThe column count of rhs.
RThe row count of rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The quotients of lhs over each component of rhs.
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component<U>::value, mat<decltype(std::declval<T>) / std::declval<U>)), C, R> > tue::operator/ ( const mat< T, C, R > &  lhs,
const U &  rhs 
)
inlinenoexcept

Computes the quotients of each component of lhs over rhs.

Template Parameters
TThe component type of lhs.
UThe type of parameter rhs.
CThe column count of lhs.
RThe row count of lhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The quotients of each component of lhs over rhs.
template<typename T , typename U , int C, int R>
constexpr mat<decltype(std::declval<T>) / std::declval<U>)), C, R> tue::operator/ ( const mat< T, C, R > &  lhs,
const mat< U, C, R > &  rhs 
)
inlinenoexcept

Computes the quotients of each component of lhs over each corresponding component of rhs.

Template Parameters
TThe component type of lhs.
UThe component type of rhs.
CThe column count of both lhs and rhs.
RThe row count of both lhs and rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The quotients of each component of lhs over each corresponding component of rhs.
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component<T>::value, mat<decltype(std::declval<T>) % std::declval<U>)), C, R> > tue::operator% ( const T &  lhs,
const mat< U, C, R > &  rhs 
)
inlinenoexcept

Computes the modulos of lhs over each component of rhs.

Template Parameters
TThe component type of lhs.
UThe type of parameter rhs.
CThe column count of rhs.
RThe row count of rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The modulos of lhs over each component of rhs.
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component<U>::value, mat<decltype(std::declval<T>) % std::declval<U>)), C, R> > tue::operator% ( const mat< T, C, R > &  lhs,
const U &  rhs 
)
inlinenoexcept

Computes the modulos of each component of lhs over rhs.

Template Parameters
TThe component type of lhs.
UThe type of parameter rhs.
CThe column count of lhs.
RThe row count of lhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The modulos of each component of lhs over rhs.
template<typename T , typename U , int C, int R>
constexpr mat<decltype(std::declval<T>) % std::declval<U>)), C, R> tue::operator% ( const mat< T, C, R > &  lhs,
const mat< U, C, R > &  rhs 
)
inlinenoexcept

Computes the modulos of each component of lhs over each corresponding component of rhs.

Template Parameters
TThe component type of lhs.
UThe component type of rhs.
CThe column count of both lhs and rhs.
RThe row count of both lhs and rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The modulos of each component of lhs over each corresponding component of rhs.
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component<T>::value, mat<decltype(std::declval<T>) & std::declval<U>)), C, R> > tue::operator& ( const T &  lhs,
const mat< U, C, R > &  rhs 
)
inlinenoexcept

Computes the bitwise AND of lhs and each component of rhs.

Template Parameters
TThe type of parameter lhs.
UThe component type of rhs.
CThe column count of rhs.
RThe row count of rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The bitwise AND of lhs and each component of rhs.
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component<U>::value, mat<decltype(std::declval<T>) & std::declval<U>)), C, R> > tue::operator& ( const mat< T, C, R > &  lhs,
const U &  rhs 
)
inlinenoexcept

Computes the bitwise AND of each component of lhs and rhs.

Template Parameters
TThe component type of lhs.
UThe type of parameter rhs.
CThe column count of lhs.
RThe row count of lhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The bitwise AND of each component of lhs and rhs.
template<typename T , typename U , int C, int R>
constexpr mat<decltype(std::declval<T>) & std::declval<U>)), C, R> tue::operator& ( const mat< T, C, R > &  lhs,
const mat< U, C, R > &  rhs 
)
inlinenoexcept

Computes the bitwise AND of each component of lhs and each corresponding component of rhs.

Template Parameters
TThe component type of lhs.
UThe component type of rhs.
CThe column count of both lhs and rhs.
RThe row count of both lhs and rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The bitwise AND of each component of lhs and each corresponding component of rhs.
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component<T>::value, mat<decltype(std::declval<T>) | std::declval<U>)), C, R> > tue::operator| ( const T &  lhs,
const mat< U, C, R > &  rhs 
)
inlinenoexcept

Computes the bitwise OR of lhs and each component of rhs.

Template Parameters
TThe type of parameter lhs.
UThe component type of rhs.
CThe column count of rhs.
RThe row count of rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The bitwise OR of lhs and each component of rhs.
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component<U>::value, mat<decltype(std::declval<T>) | std::declval<U>)), C, R> > tue::operator| ( const mat< T, C, R > &  lhs,
const U &  rhs 
)
inlinenoexcept

Computes the bitwise OR of each component of lhs and rhs.

Template Parameters
TThe component type of lhs.
UThe type of parameter rhs.
CThe column count of lhs.
RThe row count of lhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The bitwise OR of each component of lhs and rhs.
template<typename T , typename U , int C, int R>
constexpr mat<decltype(std::declval<T>) | std::declval<U>)), C, R> tue::operator| ( const mat< T, C, R > &  lhs,
const mat< U, C, R > &  rhs 
)
inlinenoexcept

Computes the bitwise OR of each component of lhs and each corresponding component of rhs.

Template Parameters
TThe component type of lhs.
UThe component type of rhs.
CThe column count of both lhs and rhs.
RThe row count of both lhs and rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The bitwise OR of each component of lhs and each corresponding component of rhs.
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component<T>::value, mat<decltype(std::declval<T>) ^ std::declval<U>)), C, R> > tue::operator^ ( const T &  lhs,
const mat< U, C, R > &  rhs 
)
inlinenoexcept

Computes the bitwise XOR of lhs and each component of rhs.

Template Parameters
TThe type of parameter lhs.
UThe component type of rhs.
CThe column count of rhs.
RThe row count of rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The bitwise XOR of lhs and each component of rhs.
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component<U>::value, mat<decltype(std::declval<T>) ^ std::declval<U>)), C, R> > tue::operator^ ( const mat< T, C, R > &  lhs,
const U &  rhs 
)
inlinenoexcept

Computes the bitwise XOR of each component of lhs and rhs.

Template Parameters
TThe component type of lhs.
UThe type of parameter rhs.
CThe column count of lhs.
RThe row count of lhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The bitwise XOR of each component of lhs and rhs.
template<typename T , typename U , int C, int R>
constexpr mat<decltype(std::declval<T>) ^ std::declval<U>)), C, R> tue::operator^ ( const mat< T, C, R > &  lhs,
const mat< U, C, R > &  rhs 
)
inlinenoexcept

Computes the bitwise XOR of each component of lhs and each corresponding component of rhs.

Template Parameters
TThe component type of lhs.
UThe component type of rhs.
CThe column count of both lhs and rhs.
RThe row count of both lhs and rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The bitwise XOR of each component of lhs and each corresponding component of rhs.
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component<T>::value, mat<decltype(std::declval<T>) shift_left std::declval<U>)), C, R> > tue::operator<< ( const T &  lhs,
const mat< U, C, R > &  rhs 
)
inlinenoexcept

Computes the bitwise shifts left of lhs by each component of rhs.

Template Parameters
TThe type of parameter lhs.
UThe component type of rhs.
CThe column count of rhs.
RThe row count of rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The bitwise shifts left of lhs by each component of rhs.
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component<U>::value, mat<decltype(std::declval<T>) shift_left std::declval<U>)), C, R> > tue::operator<< ( const mat< T, C, R > &  lhs,
const U &  rhs 
)
inlinenoexcept

Computes the bitwise shifts left of each component of lhs by rhs.

Template Parameters
TThe component type of lhs.
UThe type of parameter rhs.
CThe column count of lhs.
RThe row count of lhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The bitwise shifts left of each component of lhs by rhs.
template<typename T , typename U , int C, int R>
constexpr mat<decltype(std::declval<T>) shift_left std::declval<U>)), C, R> tue::operator<< ( const mat< T, C, R > &  lhs,
const mat< U, C, R > &  rhs 
)
inlinenoexcept

Computes the bitwise shifts left of each component of lhs by each corresponding component of rhs.

Template Parameters
TThe component type of lhs.
UThe component type of rhs.
CThe column count of both lhs and rhs.
RThe row count of both lhs and rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The bitwise shifts left of each component of lhs by each corresponding component of rhs.
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component<T>::value, mat<decltype(std::declval<T>) shift_right std::declval<U>)), C, R> > tue::operator>> ( const T &  lhs,
const mat< U, C, R > &  rhs 
)
inlinenoexcept

Computes the bitwise shifts right of lhs by each component of rhs.

Template Parameters
TThe type of parameter lhs.
UThe component type of rhs.
CThe column count of rhs.
RThe row count of rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The bitwise shifts right of lhs by each component of rhs.
template<typename T , typename U , int C, int R>
constexpr std::enable_if_t< is_vec_component<U>::value, mat<decltype(std::declval<T>) shift_right std::declval<U>)), C, R> > tue::operator>> ( const mat< T, C, R > &  lhs,
const U &  rhs 
)
inlinenoexcept

Computes the bitwise shifts right of each component of lhs by rhs.

Template Parameters
TThe component type of lhs.
UThe type of parameter rhs.
CThe column count of lhs.
RThe row count of lhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The bitwise shifts right of each component of lhs by rhs.
template<typename T , typename U , int C, int R>
constexpr mat<decltype(std::declval<T>) shift_right std::declval<U>)), C, R> tue::operator>> ( const mat< T, C, R > &  lhs,
const mat< U, C, R > &  rhs 
)
inlinenoexcept

Computes the bitwise shifts right of each component of lhs by each corresponding component of rhs.

Template Parameters
TThe component type of lhs.
UThe component type of rhs.
CThe column count of both lhs and rhs.
RThe row count of both lhs and rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The bitwise shifts right of each component of lhs by each corresponding component of rhs.
template<typename T , typename U , int C, int R>
constexpr bool tue::operator== ( const mat< T, C, R > &  lhs,
const mat< U, C, R > &  rhs 
)
inlinenoexcept

Determines whether or not two mat's compare equal.

Template Parameters
TThe component type of lhs.
UThe component type of rhs.
CThe column count of both lhs and rhs.
RThe row count of both lhs and rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
true if all the corresponding pairs of components compare equal and false otherwise.
template<typename T , typename U , int C, int R>
constexpr bool tue::operator!= ( const mat< T, C, R > &  lhs,
const mat< U, C, R > &  rhs 
)
inlinenoexcept

Determines whether or not two mat's compare not equal.

Template Parameters
TThe component type of lhs.
UThe component type of rhs.
CThe column count of both lhs and rhs.
RThe row count of both lhs and rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
true if at least one of the corresponding pairs of components compares not equal and false otherwise.
template<typename T , int C, int R>
mat<T, C, R> tue::math::sin ( const mat< T, C, R > &  m)
inlinenoexcept

Computes tue::math::sin() for each component of m.

Template Parameters
TThe component type of m.
CThe column count of m.
RThe row count of m.
Parameters
mA mat.
Returns
tue::math::sin() for each component of m.
template<typename T , int C, int R>
mat<T, C, R> tue::math::cos ( const mat< T, C, R > &  m)
inlinenoexcept

Computes tue::math::cos() for each component of m.

Template Parameters
TThe component type of m.
CThe column count of m.
RThe row count of m.
Parameters
mA mat.
Returns
tue::math::cos() for each component of m.
template<typename T , int C, int R>
void tue::math::sincos ( const mat< T, C, R > &  m,
mat< T, C, R > &  sin_out,
mat< T, C, R > &  cos_out 
)
inlinenoexcept

Computes tue::math::sincos() for each component of m.

Template Parameters
TThe component type of m.
CThe column count of m.
RThe row count of m.
Parameters
mA mat.
sin_outA reference to the mat to store the sin() results in.
cos_outA reference to the mat to store the cos() results in.
template<typename T , int C, int R>
mat<T, C, R> tue::math::exp ( const mat< T, C, R > &  m)
inlinenoexcept

Computes tue::math::exp() for each component of m.

Template Parameters
TThe component type of m.
CThe column count of m.
RThe row count of m.
Parameters
mA mat.
Returns
tue::math::exp() for each component of m.
template<typename T , int C, int R>
mat<T, C, R> tue::math::log ( const mat< T, C, R > &  m)
inlinenoexcept

Computes tue::math::log() for each component of m.

Template Parameters
TThe component type of m.
CThe column count of m.
RThe row count of m.
Parameters
mA mat.
Returns
tue::math::log() for each component of m.
template<typename T , int C, int R>
mat<T, C, R> tue::math::abs ( const mat< T, C, R > &  m)
inlinenoexcept

Computes tue::math::abs() for each component of m.

Template Parameters
TThe component type of m.
CThe column count of m.
RThe row count of m.
Parameters
mA mat.
Returns
tue::math::abs() for each component of m.
template<typename T , int C, int R>
mat<T, C, R> tue::math::pow ( const mat< T, C, R > &  bases,
const mat< T, C, R > &  exponents 
)
inlinenoexcept

Computes tue::math::pow() for each component of bases and each corresponding component of exponents.

Template Parameters
TThe component type of both bases and exponents.
CThe column count of both bases and exponents.
RThe row count of both bases and exponents.
Parameters
basesThe bases.
exponentsThe exponents.
Returns
tue::math::pow() for each component of bases and each corresponding component of exponents.
template<typename T , int C, int R>
mat<T, C, R> tue::math::recip ( const mat< T, C, R > &  m)
inlinenoexcept

Computes tue::math::recip() for each component of m.

Template Parameters
TThe component type of m.
CThe column count of m.
RThe row count of m.
Parameters
mA mat.
Returns
tue::math::recip() for each component of m.
template<typename T , int C, int R>
mat<T, C, R> tue::math::sqrt ( const mat< T, C, R > &  m)
inlinenoexcept

Computes tue::math::sqrt() for each component of m.

Template Parameters
TThe component type of m.
CThe column count of m.
RThe row count of m.
Parameters
mA mat.
Returns
tue::math::sqrt() for each component of m.
template<typename T , int C, int R>
mat<T, C, R> tue::math::rsqrt ( const mat< T, C, R > &  m)
inlinenoexcept

Computes tue::math::rsqrt() for each component of m.

Template Parameters
TThe component type of m.
CThe column count of m.
RThe row count of m.
Parameters
mA mat.
Returns
tue::math::rsqrt() for each component of m.
template<typename T , int C, int R>
mat<T, C, R> tue::math::min ( const mat< T, C, R > &  m1,
const mat< T, C, R > &  m2 
)
inlinenoexcept

Computes tue::math::min() for each corresponding pair of components from m1 and m2.

Template Parameters
TThe component type of both m1 and m2.
CThe column count of both m1 and m2.
RThe row count of both m1 and m2.
Parameters
m1A mat.
m2Another mat.
Returns
tue::math::min() for each corresponding pair of components from m1 and m2.
template<typename T , int C, int R>
mat<T, C, R> tue::math::max ( const mat< T, C, R > &  m1,
const mat< T, C, R > &  m2 
)
inlinenoexcept

Computes tue::math::max() for each corresponding pair of components from m1 and m2.

Template Parameters
TThe component type of both m1 and m2.
CThe column count of both m1 and m2.
RThe row count of both m1 and m2.
Parameters
m1A mat.
m2Another mat.
Returns
tue::math::max() for each corresponding pair of components from m1 and m2.
template<typename T , typename U , int C, int R>
mat<U, C, R> tue::math::mask ( const mat< T, C, R > &  conditions,
const mat< U, C, R > &  values 
)
inlinenoexcept

Computes tue::math::mask() for each corresponding pair of components from conditions and values.

Template Parameters
TThe component type of conditions.
UThe component type of values.
CThe column count of both conditions and values.
RThe row count of both conditions and values.
Parameters
conditionsA mat.
valuesAnother mat.
Returns
tue::math::mask() for each corresponding pair of components from conditions and values.
template<typename T , typename U , int C, int R>
mat<U, C, R> tue::math::select ( const mat< T, C, R > &  conditions,
const mat< U, C, R > &  values,
const mat< U, C, R > &  otherwise 
)
inlinenoexcept

Computes tue::math::select() for each corresponding trio of components from conditions, values, and otherwise.

Template Parameters
TThe component type of conditions.
UThe component type of both values and otherwise.
CThe column count of all three parameters.
RThe row count of all three parameters.
Parameters
conditionsA mat.
valuesAnother mat.
otherwiseAnother mat.
Returns
tue::math::select() for each corresponding trio of components from conditions, values, and otherwise.
template<typename T , int C, int R>
mat< decltype(tue::math::less( std::declval<T>), std::declval<T>))), C, R> tue::math::less ( const mat< T, C, R > &  lhs,
const mat< T, C, R > &  rhs 
)
inlinenoexcept

Computes tue::math::less() for each corresponding pair of components from lhs and rhs.

Template Parameters
TThe component type of both lhs and rhs.
CThe column count of both lhs and rhs.
RThe row count of both lhs and rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
tue::math::less() for each corresponding pair of components from lhs and rhs.
template<typename T , int C, int R>
mat< decltype(tue::math::less_equal( std::declval<T>), std::declval<T>))), C, R> tue::math::less_equal ( const mat< T, C, R > &  lhs,
const mat< T, C, R > &  rhs 
)
inlinenoexcept

Computes tue::math::less_equal() for each corresponding pair of components from lhs and rhs.

Template Parameters
TThe component type of both lhs and rhs.
CThe column count of both lhs and rhs.
RThe row count of both lhs and rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
tue::math::less_equal() for each corresponding pair of components from lhs and rhs.
template<typename T , int C, int R>
mat< decltype(tue::math::greater( std::declval<T>), std::declval<T>))), C, R> tue::math::greater ( const mat< T, C, R > &  lhs,
const mat< T, C, R > &  rhs 
)
inlinenoexcept

Computes tue::math::greater() for each corresponding pair of components from lhs and rhs.

Template Parameters
TThe component type of both lhs and rhs.
CThe column count of both lhs and rhs.
RThe row count of both lhs and rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
tue::math::greater() for each corresponding pair of components from lhs and rhs.
template<typename T , int C, int R>
mat< decltype(tue::math::greater_equal( std::declval<T>), std::declval<T>))), C, R> tue::math::greater_equal ( const mat< T, C, R > &  lhs,
const mat< T, C, R > &  rhs 
)
inlinenoexcept

Computes tue::math::greater_equal() for each corresponding pair of components from lhs and rhs.

Template Parameters
TThe component type of both lhs and rhs.
CThe column count of both lhs and rhs.
RThe row count of both lhs and rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
tue::math::greater_equal() for each corresponding pair of components from lhs and rhs.
template<typename T , int C, int R>
mat< decltype(tue::math::equal( std::declval<T>), std::declval<T>))), C, R> tue::math::equal ( const mat< T, C, R > &  lhs,
const mat< T, C, R > &  rhs 
)
inlinenoexcept

Computes tue::math::equal() for each corresponding pair of components from lhs and rhs.

Template Parameters
TThe component type of both lhs and rhs.
CThe column count of both lhs and rhs.
RThe row count of both lhs and rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
tue::math::equal() for each corresponding pair of components from lhs and rhs.
template<typename T , int C, int R>
mat< decltype(tue::math::not_equal( std::declval<T>), std::declval<T>))), C, R> tue::math::not_equal ( const mat< T, C, R > &  lhs,
const mat< T, C, R > &  rhs 
)
inlinenoexcept

Computes tue::math::not_equal() for each corresponding pair of components from lhs and rhs.

Template Parameters
TThe component type of both lhs and rhs.
CThe column count of both lhs and rhs.
RThe row count of both lhs and rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
tue::math::not_equal() for each corresponding pair of components from lhs and rhs.
template<typename T , typename U , int C, int R>
constexpr mat<decltype(std::declval<T>) * std::declval<U>)), C, R> tue::math::comp_mult ( const mat< T, C, R > &  lhs,
const mat< U, C, R > &  rhs 
)
inlinenoexcept

Computes the products of each component of lhs and each corresponding component of rhs.

Template Parameters
TThe component type of lhs.
UThe component type of rhs.
CThe column count of both lhs and rhs.
RThe row count of both lhs and rhs.
Parameters
lhsThe left-hand side operand.
rhsThe right-hand side operand.
Returns
The products of each component of lhs and each corresponding component of rhs.
template<typename T , int C, int R>
constexpr mat<T, R, C> tue::math::transpose ( const mat< T, C, R > &  m)
inlinenoexcept

Computes the transpose of m.

Template Parameters
TThe component type of m.
CThe column count of m.
RThe row count of m.
Parameters
mA mat.
Returns
The transpose of m.