Hermes
matrix.h File Reference

Math matrix classes. More...

Go to the source code of this file.

Classes

class  hermes::Matrix4x4< T >
 4x4 Matrix representation More...
 
class  hermes::Matrix3x3< T >
 3x3 Matrix representation More...
 
class  hermes::Matrix2x2< T >
 2x2 Matrix representation More...
 

Macros

#define ARITHMETIC_OP(OP)
 

Typedefs

typedef Matrix4x4< real_thermes::mat4
 
typedef Matrix3x3< real_thermes::mat3
 
typedef Matrix2x2< real_thermes::mat2
 

Functions

template<typename T >
HERMES_DEVICE_CALLABLE bool hermes::gluInvertMatrix (const T m[16], T invOut[16])
 Inverts a 4x4 matrix. More...
 
template<typename T >
HERMES_DEVICE_CALLABLE Matrix4x4< T > hermes::rowReduce (const Matrix4x4< T > &p, const Matrix4x4< T > &q)
 
template<typename T >
HERMES_DEVICE_CALLABLE Matrix4x4< T > hermes::transpose (const Matrix4x4< T > &m)
 
template<typename T >
HERMES_DEVICE_CALLABLE Matrix4x4< T > hermes::inverse (const Matrix4x4< T > &m)
 
template<typename T >
HERMES_DEVICE_CALLABLE void hermes::decompose (const Matrix4x4< T > &m, Matrix4x4< T > &r, Matrix4x4< T > &s)
 
template<typename T >
HERMES_DEVICE_CALLABLE Matrix2x2< T > hermes::operator* (T f, const Matrix2x2< T > &m)
 
template<typename T >
HERMES_DEVICE_CALLABLE Matrix2x2< T > hermes::inverse (const Matrix2x2< T > &m)
 
template<typename T >
HERMES_DEVICE_CALLABLE Matrix2x2< T > hermes::transpose (const Matrix2x2< T > &m)
 
template<typename T >
HERMES_DEVICE_CALLABLE Matrix3x3< T > hermes::inverse (const Matrix3x3< T > &m)
 
template<typename T >
HERMES_DEVICE_CALLABLE Matrix3x3< T > hermes::transpose (const Matrix3x3< T > &m)
 
template<typename T >
HERMES_DEVICE_CALLABLE Matrix3x3< T > hermes::star (const Vector3< T > a)
 
template<typename T >
HERMES_DEVICE_CALLABLE Matrix3x3< T > hermes::operator* (T f, const Matrix3x3< T > &m)
 
template<typename T >
HERMES_DEVICE_CALLABLE Matrix4x4< T > hermes::operator* (T f, const Matrix4x4< T > &m)
 
template<typename T >
std::ostream & hermes::operator<< (std::ostream &os, const Matrix4x4< T > &m)
 
template<typename T >
std::ostream & hermes::operator<< (std::ostream &os, const Matrix3x3< T > &m)
 
template<typename T >
std::ostream & hermes::operator<< (std::ostream &os, const Matrix2x2< T > &m)
 

Detailed Description

Math matrix classes.

Copyright (c) 2017, FilipeCN.

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Author
FilipeCN (filip.nosp@m.edec.nosp@m.n@gma.nosp@m.il.c.nosp@m.om)
Date
2017-08-18

Macro Definition Documentation

◆ ARITHMETIC_OP

#define ARITHMETIC_OP (   OP)
Value:
HERMES_DEVICE_CALLABLE Matrix3x3<T> operator OP##=(const Matrix3x3<T> &B) const { \
for (int i = 0; i < 3; ++i) \
for (int j = 0; j < 3; ++j) \
m_[i][j] OP##= B[i][j]; \
} \
HERMES_DEVICE_CALLABLE Matrix3x3<T> operator OP(const Matrix3x3<T> &B) const { \
Matrix3x3<T> r; \
for (int i = 0; i < 3; ++i) \
for (int j = 0; j < 3; ++j) \
r[i][j] = m_[i][j] OP B[i][j]; \
return r; }
#define HERMES_DEVICE_CALLABLE
Specifies that the function can be called from both host and device sides.
Definition: defs.h:45

Function Documentation

◆ gluInvertMatrix()

template<typename T >
HERMES_DEVICE_CALLABLE bool hermes::gluInvertMatrix ( const T  m[16],
invOut[16] 
)

Inverts a 4x4 matrix.

Note
function extracted from MESA implementation of the GLU library
Template Parameters
T
Parameters
m
invOut
Returns