mirror of https://github.com/mosra/magnum.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
741 lines
32 KiB
741 lines
32 KiB
|
14 years ago
|
#ifndef Magnum_Math_RectangularMatrix_h
|
||
|
|
#define Magnum_Math_RectangularMatrix_h
|
||
|
|
/*
|
||
|
|
This file is part of Magnum.
|
||
|
|
|
||
|
13 years ago
|
Copyright © 2010, 2011, 2012, 2013 Vladimír Vondruš <mosra@centrum.cz>
|
||
|
|
|
||
|
|
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.
|
||
|
14 years ago
|
*/
|
||
|
|
|
||
|
|
/** @file
|
||
|
|
* @brief Class Magnum::Math::RectangularMatrix
|
||
|
|
*/
|
||
|
|
|
||
|
13 years ago
|
#include "Math/Vector.h"
|
||
|
14 years ago
|
|
||
|
14 years ago
|
namespace Magnum { namespace Math {
|
||
|
|
|
||
|
13 years ago
|
namespace Implementation {
|
||
|
|
template<std::size_t, std::size_t, class, class> struct RectangularMatrixConverter;
|
||
|
|
}
|
||
|
|
|
||
|
14 years ago
|
/**
|
||
|
|
@brief Rectangular matrix
|
||
|
14 years ago
|
@tparam cols Column count
|
||
|
|
@tparam rows Row count
|
||
|
13 years ago
|
@tparam T Underlying data type
|
||
|
14 years ago
|
|
||
|
14 years ago
|
See @ref matrix-vector for brief introduction. See also Matrix (square) and
|
||
|
|
Vector.
|
||
|
14 years ago
|
|
||
|
|
The data are stored in column-major order, to reflect that, all indices in
|
||
|
|
math formulas are in reverse order (i.e. @f$ \boldsymbol A_{ji} @f$ instead
|
||
|
|
of @f$ \boldsymbol A_{ij} @f$).
|
||
|
13 years ago
|
@see @ref Matrix2x3, @ref Matrix3x2, @ref Matrix2x4, @ref Matrix4x2,
|
||
|
|
@ref Matrix3x4, @ref Matrix4x3
|
||
|
14 years ago
|
*/
|
||
|
14 years ago
|
template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
|
||
|
13 years ago
|
static_assert(cols != 0 && rows != 0, "RectangularMatrix cannot have zero elements");
|
||
|
14 years ago
|
|
||
|
13 years ago
|
template<std::size_t, std::size_t, class> friend class RectangularMatrix;
|
||
|
|
|
||
|
14 years ago
|
public:
|
||
|
13 years ago
|
typedef T Type; /**< @brief Underlying data type */
|
||
|
14 years ago
|
const static std::size_t Cols = cols; /**< @brief %Matrix column count */
|
||
|
|
const static std::size_t Rows = rows; /**< @brief %Matrix row count */
|
||
|
14 years ago
|
|
||
|
13 years ago
|
/**
|
||
|
|
* @brief Size of matrix diagonal
|
||
|
|
*
|
||
|
|
* @see fromDiagonal(), diagonal()
|
||
|
|
*/
|
||
|
|
const static std::size_t DiagonalSize = (cols < rows ? cols : rows);
|
||
|
|
|
||
|
14 years ago
|
/**
|
||
|
|
* @brief %Matrix from array
|
||
|
|
* @return Reference to the data as if it was Matrix, thus doesn't
|
||
|
|
* perform any copying.
|
||
|
|
*
|
||
|
|
* @attention Use with caution, the function doesn't check whether the
|
||
|
|
* array is long enough.
|
||
|
|
*/
|
||
|
13 years ago
|
static RectangularMatrix<cols, rows, T>& from(T* data) {
|
||
|
14 years ago
|
return *reinterpret_cast<RectangularMatrix<cols, rows, T>*>(data);
|
||
|
|
}
|
||
|
|
/** @overload */
|
||
|
13 years ago
|
static const RectangularMatrix<cols, rows, T>& from(const T* data) {
|
||
|
14 years ago
|
return *reinterpret_cast<const RectangularMatrix<cols, rows, T>*>(data);
|
||
|
|
}
|
||
|
|
|
||
|
13 years ago
|
/**
|
||
|
|
* @brief Construct matrix from vector
|
||
|
|
*
|
||
|
|
* Rolls the vector into matrix, i.e. first `rows` elements of the
|
||
|
|
* vector will make first column of resulting matrix.
|
||
|
|
* @see toVector()
|
||
|
|
*/
|
||
|
13 years ago
|
static RectangularMatrix<cols, rows, T> fromVector(const Vector<cols*rows, T>& vector) {
|
||
|
13 years ago
|
return *reinterpret_cast<const RectangularMatrix<cols, rows, T>*>(vector.data());
|
||
|
|
}
|
||
|
|
|
||
|
13 years ago
|
/**
|
||
|
|
* @brief Construct diagonal matrix
|
||
|
|
*
|
||
|
|
* @see diagonal()
|
||
|
|
*/
|
||
|
|
constexpr static RectangularMatrix<cols, rows, T> fromDiagonal(const Vector<DiagonalSize, T>& diagonal) {
|
||
|
|
return RectangularMatrix(typename Implementation::GenerateSequence<cols>::Type(), diagonal);
|
||
|
|
}
|
||
|
|
|
||
|
13 years ago
|
/** @brief Construct zero-filled matrix */
|
||
|
13 years ago
|
constexpr /*implicit*/ RectangularMatrix() {}
|
||
|
14 years ago
|
|
||
|
|
/**
|
||
|
13 years ago
|
* @brief Construct matrix from column vectors
|
||
|
|
* @param first First column vector
|
||
|
|
* @param next Next column vectors
|
||
|
14 years ago
|
*
|
||
|
13 years ago
|
* @todo Creating matrix from arbitrary combination of matrices with n rows
|
||
|
14 years ago
|
*/
|
||
|
13 years ago
|
template<class ...U> constexpr /*implicit*/ RectangularMatrix(const Vector<rows, T>& first, const U&... next): _data{first, next...} {
|
||
|
13 years ago
|
static_assert(sizeof...(next)+1 == cols, "Improper number of arguments passed to RectangularMatrix constructor");
|
||
|
14 years ago
|
}
|
||
|
|
|
||
|
13 years ago
|
/**
|
||
|
|
* @brief Construct matrix from another of different type
|
||
|
|
*
|
||
|
|
* Performs only default casting on the values, no rounding or
|
||
|
|
* anything else. Example usage:
|
||
|
|
* @code
|
||
|
13 years ago
|
* RectangularMatrix<4, 1, Float> floatingPoint(1.3f, 2.7f, -15.0f, 7.0f);
|
||
|
|
* RectangularMatrix<4, 1, Byte> integral(floatingPoint);
|
||
|
13 years ago
|
* // integral == {1, 2, -15, 7}
|
||
|
|
* @endcode
|
||
|
|
*/
|
||
|
13 years ago
|
#ifndef CORRADE_GCC46_COMPATIBILITY
|
||
|
13 years ago
|
template<class U> constexpr explicit RectangularMatrix(const RectangularMatrix<cols, rows, U>& other): RectangularMatrix(typename Implementation::GenerateSequence<cols>::Type(), other) {}
|
||
|
13 years ago
|
#else
|
||
|
13 years ago
|
template<class U> explicit RectangularMatrix(const RectangularMatrix<cols, rows, U>& other) {
|
||
|
13 years ago
|
*this = RectangularMatrix(typename Implementation::GenerateSequence<cols>::Type(), other);
|
||
|
|
}
|
||
|
|
#endif
|
||
|
13 years ago
|
|
||
|
13 years ago
|
/** @brief Construct matrix from external representation */
|
||
|
|
#ifndef CORRADE_GCC46_COMPATIBILITY
|
||
|
13 years ago
|
template<class U, class V = decltype(Implementation::RectangularMatrixConverter<cols, rows, T, U>::from(std::declval<U>()))> constexpr explicit RectangularMatrix(const U& other): RectangularMatrix(Implementation::RectangularMatrixConverter<cols, rows, T, U>::from(other)) {}
|
||
|
13 years ago
|
#else
|
||
|
13 years ago
|
template<class U, class V = decltype(Implementation::RectangularMatrixConverter<cols, rows, T, U>::from(std::declval<U>()))> explicit RectangularMatrix(const U& other) {
|
||
|
13 years ago
|
*this = Implementation::RectangularMatrixConverter<cols, rows, T, U>::from(other);
|
||
|
|
}
|
||
|
|
#endif
|
||
|
|
|
||
|
14 years ago
|
/** @brief Copy constructor */
|
||
|
13 years ago
|
constexpr RectangularMatrix(const RectangularMatrix<cols, rows, T>&) = default;
|
||
|
14 years ago
|
|
||
|
|
/** @brief Assignment operator */
|
||
|
13 years ago
|
RectangularMatrix<cols, rows, T>& operator=(const RectangularMatrix<cols, rows, T>&) = default;
|
||
|
14 years ago
|
|
||
|
13 years ago
|
/** @brief Convert matrix to external representation */
|
||
|
13 years ago
|
template<class U, class V = decltype(Implementation::RectangularMatrixConverter<cols, rows, T, U>::to(std::declval<RectangularMatrix<cols, rows, T>>()))> constexpr explicit operator U() const {
|
||
|
13 years ago
|
/** @bug Why this is not constexpr under GCC 4.6? */
|
||
|
|
return Implementation::RectangularMatrixConverter<cols, rows, T, U>::to(*this);
|
||
|
|
}
|
||
|
|
|
||
|
14 years ago
|
/**
|
||
|
|
* @brief Raw data
|
||
|
13 years ago
|
* @return One-dimensional array of `cols*rows` length in column-major
|
||
|
14 years ago
|
* order.
|
||
|
13 years ago
|
*
|
||
|
|
* @see operator[]
|
||
|
14 years ago
|
*/
|
||
|
13 years ago
|
T* data() { return _data[0].data(); }
|
||
|
|
constexpr const T* data() const { return _data[0].data(); } /**< @overload */
|
||
|
14 years ago
|
|
||
|
|
/**
|
||
|
|
* @brief %Matrix column
|
||
|
|
*
|
||
|
13 years ago
|
* Particular elements can be accessed using Vector::operator[], e.g.:
|
||
|
|
* @code
|
||
|
13 years ago
|
* RectangularMatrix<4, 3, Float> m;
|
||
|
|
* Float a = m[2][1];
|
||
|
13 years ago
|
* @endcode
|
||
|
|
*
|
||
|
13 years ago
|
* @see row(), data()
|
||
|
14 years ago
|
*/
|
||
|
13 years ago
|
Vector<rows, T>& operator[](std::size_t col) { return _data[col]; }
|
||
|
13 years ago
|
constexpr const Vector<rows, T>& operator[](std::size_t col) const { return _data[col]; } /**< @overload */
|
||
|
14 years ago
|
|
||
|
13 years ago
|
/**
|
||
|
|
* @brief %Matrix row
|
||
|
|
*
|
||
|
|
* Consider using transposed() when accessing rows frequently, as this
|
||
|
|
* is slower than accessing columns due to the way the matrix is stored.
|
||
|
|
* @see operator[]()
|
||
|
|
*/
|
||
|
13 years ago
|
Vector<cols, T> row(std::size_t row) const;
|
||
|
13 years ago
|
|
||
|
13 years ago
|
/** @brief Equality comparison */
|
||
|
13 years ago
|
bool operator==(const RectangularMatrix<cols, rows, T>& other) const {
|
||
|
13 years ago
|
for(std::size_t i = 0; i != cols; ++i)
|
||
|
|
if(_data[i] != other._data[i]) return false;
|
||
|
14 years ago
|
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
|
||
|
14 years ago
|
/**
|
||
|
|
* @brief Non-equality operator
|
||
|
|
*
|
||
|
|
* @see Vector::operator<(), Vector::operator<=(), Vector::operator>=(),
|
||
|
|
* Vector::operator>()
|
||
|
|
*/
|
||
|
13 years ago
|
bool operator!=(const RectangularMatrix<cols, rows, T>& other) const {
|
||
|
14 years ago
|
return !operator==(other);
|
||
|
|
}
|
||
|
|
|
||
|
13 years ago
|
/**
|
||
|
|
* @brief Negated matrix
|
||
|
|
*
|
||
|
|
* The computation is done column-wise. @f[
|
||
|
|
* \boldsymbol B_j = -\boldsymbol A_j
|
||
|
|
* @f]
|
||
|
|
*/
|
||
|
|
RectangularMatrix<cols, rows, T> operator-() const;
|
||
|
|
|
||
|
14 years ago
|
/**
|
||
|
|
* @brief Add and assign matrix
|
||
|
|
*
|
||
|
13 years ago
|
* The computation is done column-wise in-place. @f[
|
||
|
|
* \boldsymbol A_j = \boldsymbol A_j + \boldsymbol B_j
|
||
|
14 years ago
|
* @f]
|
||
|
|
*/
|
||
|
|
RectangularMatrix<cols, rows, T>& operator+=(const RectangularMatrix<cols, rows, T>& other) {
|
||
|
13 years ago
|
for(std::size_t i = 0; i != cols; ++i)
|
||
|
14 years ago
|
_data[i] += other._data[i];
|
||
|
|
|
||
|
|
return *this;
|
||
|
|
}
|
||
|
|
|
||
|
14 years ago
|
/**
|
||
|
|
* @brief Add matrix
|
||
|
|
*
|
||
|
|
* @see operator+=()
|
||
|
|
*/
|
||
|
13 years ago
|
RectangularMatrix<cols, rows, T> operator+(const RectangularMatrix<cols, rows, T>& other) const {
|
||
|
14 years ago
|
return RectangularMatrix<cols, rows, T>(*this)+=other;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @brief Subtract and assign matrix
|
||
|
|
*
|
||
|
13 years ago
|
* The computation is done column-wise in-place. @f[
|
||
|
|
* \boldsymbol A_j = \boldsymbol A_j - \boldsymbol B_j
|
||
|
14 years ago
|
* @f]
|
||
|
14 years ago
|
*/
|
||
|
|
RectangularMatrix<cols, rows, T>& operator-=(const RectangularMatrix<cols, rows, T>& other) {
|
||
|
13 years ago
|
for(std::size_t i = 0; i != cols; ++i)
|
||
|
14 years ago
|
_data[i] -= other._data[i];
|
||
|
|
|
||
|
|
return *this;
|
||
|
|
}
|
||
|
|
|
||
|
14 years ago
|
/**
|
||
|
|
* @brief Subtract matrix
|
||
|
|
*
|
||
|
|
* @see operator-=()
|
||
|
|
*/
|
||
|
13 years ago
|
RectangularMatrix<cols, rows, T> operator-(const RectangularMatrix<cols, rows, T>& other) const {
|
||
|
14 years ago
|
return RectangularMatrix<cols, rows, T>(*this)-=other;
|
||
|
|
}
|
||
|
|
|
||
|
14 years ago
|
/**
|
||
|
|
* @brief Multiply matrix with number and assign
|
||
|
|
*
|
||
|
13 years ago
|
* The computation is done column-wise in-place. @f[
|
||
|
|
* \boldsymbol A_j = a \boldsymbol A_j
|
||
|
14 years ago
|
* @f]
|
||
|
14 years ago
|
*/
|
||
|
13 years ago
|
RectangularMatrix<cols, rows, T>& operator*=(T number) {
|
||
|
13 years ago
|
for(std::size_t i = 0; i != cols; ++i)
|
||
|
14 years ago
|
_data[i] *= number;
|
||
|
|
|
||
|
|
return *this;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
13 years ago
|
* @brief Multiply matrix with number
|
||
|
14 years ago
|
*
|
||
|
13 years ago
|
* @see operator*=(T), operator*(T, const RectangularMatrix<cols, rows, T>&)
|
||
|
14 years ago
|
*/
|
||
|
13 years ago
|
RectangularMatrix<cols, rows, T> operator*(T number) const {
|
||
|
|
return RectangularMatrix<cols, rows, T>(*this) *= number;
|
||
|
14 years ago
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @brief Divide matrix with number and assign
|
||
|
|
*
|
||
|
13 years ago
|
* The computation is done column-wise in-place. @f[
|
||
|
|
* \boldsymbol A_j = \frac{\boldsymbol A_j} a
|
||
|
14 years ago
|
* @f]
|
||
|
14 years ago
|
*/
|
||
|
13 years ago
|
RectangularMatrix<cols, rows, T>& operator/=(T number) {
|
||
|
13 years ago
|
for(std::size_t i = 0; i != cols; ++i)
|
||
|
14 years ago
|
_data[i] /= number;
|
||
|
|
|
||
|
|
return *this;
|
||
|
|
}
|
||
|
|
|
||
|
13 years ago
|
/**
|
||
|
|
* @brief Divide matrix with number
|
||
|
|
*
|
||
|
13 years ago
|
* @see operator/=(T),
|
||
|
|
* operator/(T, const RectangularMatrix<cols, rows, T>&)
|
||
|
13 years ago
|
*/
|
||
|
13 years ago
|
RectangularMatrix<cols, rows, T> operator/(T number) const {
|
||
|
|
return RectangularMatrix<cols, rows, T>(*this) /= number;
|
||
|
13 years ago
|
}
|
||
|
|
|
||
|
14 years ago
|
/**
|
||
|
|
* @brief Multiply matrix
|
||
|
|
*
|
||
|
|
* @f[
|
||
|
|
* (\boldsymbol {AB})_{ji} = \sum_{k=0}^{m-1} \boldsymbol A_{ki} \boldsymbol B_{jk}
|
||
|
|
* @f]
|
||
|
|
*/
|
||
|
13 years ago
|
template<std::size_t size> RectangularMatrix<size, rows, T> operator*(const RectangularMatrix<size, cols, T>& other) const;
|
||
|
14 years ago
|
|
||
|
|
/**
|
||
|
|
* @brief Multiply vector
|
||
|
|
*
|
||
|
|
* Internally the same as multiplying with one-column matrix, but
|
||
|
14 years ago
|
* returns vector. @f[
|
||
|
|
* (\boldsymbol {Aa})_i = \sum_{k=0}^{m-1} \boldsymbol A_{ki} \boldsymbol a_k
|
||
|
|
* @f]
|
||
|
14 years ago
|
*/
|
||
|
13 years ago
|
Vector<rows, T> operator*(const Vector<cols, T>& other) const {
|
||
|
|
return operator*(RectangularMatrix<1, cols, T>(other))[0];
|
||
|
14 years ago
|
}
|
||
|
|
|
||
|
13 years ago
|
/**
|
||
|
|
* @brief Transposed matrix
|
||
|
|
*
|
||
|
|
* @see row()
|
||
|
|
*/
|
||
|
13 years ago
|
RectangularMatrix<rows, cols, T> transposed() const;
|
||
|
14 years ago
|
|
||
|
13 years ago
|
/**
|
||
|
|
* @brief Values on diagonal
|
||
|
|
*
|
||
|
|
* @see fromDiagonal()
|
||
|
|
*/
|
||
|
13 years ago
|
constexpr Vector<DiagonalSize, T> diagonal() const;
|
||
|
13 years ago
|
|
||
|
13 years ago
|
/**
|
||
|
|
* @brief Convert matrix to vector
|
||
|
|
*
|
||
|
|
* Returns the matrix unrolled into one large vector, i.e. first column
|
||
|
|
* of the matrix will make first `rows` elements of resulting vector.
|
||
|
|
* Useful for performing vector operations with the matrix (e.g.
|
||
|
|
* summing the elements etc.).
|
||
|
|
* @see fromVector()
|
||
|
|
*/
|
||
|
13 years ago
|
Vector<rows*cols, T> toVector() const {
|
||
|
13 years ago
|
return *reinterpret_cast<const Vector<rows*cols, T>*>(data());
|
||
|
13 years ago
|
}
|
||
|
|
|
||
|
13 years ago
|
#ifndef DOXYGEN_GENERATING_OUTPUT
|
||
|
13 years ago
|
protected:
|
||
|
13 years ago
|
#else
|
||
|
|
private:
|
||
|
|
#endif
|
||
|
13 years ago
|
/* Implementation for RectangularMatrix<cols, rows, T>::fromDiagonal() and Matrix<size, T>(T) */
|
||
|
|
template<std::size_t ...sequence> constexpr explicit RectangularMatrix(Implementation::Sequence<sequence...>, const Vector<DiagonalSize, T>& diagonal);
|
||
|
|
|
||
|
14 years ago
|
private:
|
||
|
13 years ago
|
/* Implementation for RectangularMatrix<cols, rows, T>::RectangularMatrix(const RectangularMatrix<cols, rows, U>&) */
|
||
|
13 years ago
|
template<class U, std::size_t ...sequence> constexpr explicit RectangularMatrix(Implementation::Sequence<sequence...>, const RectangularMatrix<cols, rows, U>& matrix): _data{Vector<rows, T>(matrix[sequence])...} {}
|
||
|
13 years ago
|
|
||
|
13 years ago
|
template<std::size_t ...sequence> constexpr Vector<DiagonalSize, T> diagonalInternal(Implementation::Sequence<sequence...>) const;
|
||
|
|
|
||
|
13 years ago
|
Vector<rows, T> _data[cols];
|
||
|
14 years ago
|
};
|
||
|
13 years ago
|
|
||
|
|
#ifndef CORRADE_GCC46_COMPATIBILITY
|
||
|
|
/**
|
||
|
|
@brief Matrix with 2 columns and 3 rows
|
||
|
|
|
||
|
|
Convenience alternative to <tt>%RectangularMatrix<2, 3, T></tt>. See
|
||
|
|
@ref RectangularMatrix for more information.
|
||
|
|
@note Not available on GCC < 4.7. Use <tt>%RectangularMatrix<2, 3, T></tt>
|
||
|
|
instead.
|
||
|
|
@see @ref Magnum::Matrix2x3, @ref Magnum::Matrix2x3d
|
||
|
|
*/
|
||
|
|
template<class T> using Matrix2x3 = RectangularMatrix<2, 3, T>;
|
||
|
|
|
||
|
|
/**
|
||
|
|
@brief Matrix with 3 columns and 2 rows
|
||
|
|
|
||
|
|
Convenience alternative to <tt>%RectangularMatrix<3, 2, T></tt>. See
|
||
|
|
@ref RectangularMatrix for more information.
|
||
|
|
@note Not available on GCC < 4.7. Use <tt>%RectangularMatrix<3, 2, T></tt>
|
||
|
|
instead.
|
||
|
|
@see @ref Magnum::Matrix3x2, @ref Magnum::Matrix3x2d
|
||
|
|
*/
|
||
|
|
template<class T> using Matrix3x2 = RectangularMatrix<3, 2, T>;
|
||
|
|
|
||
|
|
/**
|
||
|
|
@brief Matrix with 2 columns and 4 rows
|
||
|
|
|
||
|
|
Convenience alternative to <tt>%RectangularMatrix<2, 4, T></tt>. See
|
||
|
|
@ref RectangularMatrix for more information.
|
||
|
|
@note Not available on GCC < 4.7. Use <tt>%RectangularMatrix<2, 4, T></tt>
|
||
|
|
instead.
|
||
|
|
@see @ref Magnum::Matrix2x4, @ref Magnum::Matrix2x4d
|
||
|
|
*/
|
||
|
|
template<class T> using Matrix2x4 = RectangularMatrix<2, 4, T>;
|
||
|
|
|
||
|
|
/**
|
||
|
|
@brief Matrix with 4 columns and 2 rows
|
||
|
|
|
||
|
|
Convenience alternative to <tt>%RectangularMatrix<4, 2, T></tt>. See
|
||
|
|
@ref RectangularMatrix for more information.
|
||
|
|
@note Not available on GCC < 4.7. Use <tt>%RectangularMatrix<4, 2, T></tt>
|
||
|
|
instead.
|
||
|
|
@see @ref Magnum::Matrix4x2, @ref Magnum::Matrix4x2d
|
||
|
|
*/
|
||
|
|
template<class T> using Matrix4x2 = RectangularMatrix<4, 2, T>;
|
||
|
|
|
||
|
|
/**
|
||
|
|
@brief Matrix with 3 columns and 4 rows
|
||
|
|
|
||
|
|
Convenience alternative to <tt>%RectangularMatrix<3, 4, T></tt>. See
|
||
|
|
@ref RectangularMatrix for more information.
|
||
|
|
@note Not available on GCC < 4.7. Use <tt>%RectangularMatrix<3, 4, T></tt>
|
||
|
|
instead.
|
||
|
|
@see @ref Magnum::Matrix3x4, @ref Magnum::Matrix3x4d
|
||
|
|
*/
|
||
|
|
template<class T> using Matrix3x4 = RectangularMatrix<3, 4, T>;
|
||
|
|
|
||
|
|
/**
|
||
|
|
@brief Matrix with 4 columns and 3 rows
|
||
|
|
|
||
|
|
Convenience alternative to <tt>%RectangularMatrix<4, 3, T></tt>. See
|
||
|
|
@ref RectangularMatrix for more information.
|
||
|
|
@note Not available on GCC < 4.7. Use <tt>%RectangularMatrix<4, 3, T></tt>
|
||
|
|
instead.
|
||
|
|
@see @ref Magnum::Matrix4x3, @ref Magnum::Matrix4x3d
|
||
|
|
*/
|
||
|
|
template<class T> using Matrix4x3 = RectangularMatrix<4, 3, T>;
|
||
|
|
#endif
|
||
|
14 years ago
|
|
||
|
14 years ago
|
/** @relates RectangularMatrix
|
||
|
|
@brief Multiply number with matrix
|
||
|
|
|
||
|
13 years ago
|
Same as RectangularMatrix::operator*(T) const.
|
||
|
14 years ago
|
*/
|
||
|
13 years ago
|
template<std::size_t cols, std::size_t rows, class T> inline RectangularMatrix<cols, rows, T> operator*(
|
||
|
|
#ifdef DOXYGEN_GENERATING_OUTPUT
|
||
|
|
T
|
||
|
|
#else
|
||
|
|
typename std::common_type<T>::type
|
||
|
|
#endif
|
||
|
|
number, const RectangularMatrix<cols, rows, T>& matrix)
|
||
|
|
{
|
||
|
14 years ago
|
return matrix*number;
|
||
|
|
}
|
||
|
|
|
||
|
|
/** @relates RectangularMatrix
|
||
|
|
@brief Divide matrix with number and invert
|
||
|
|
|
||
|
13 years ago
|
The computation is done column-wise. @f[
|
||
|
|
\boldsymbol B_j = \frac a {\boldsymbol A_j}
|
||
|
14 years ago
|
@f]
|
||
|
13 years ago
|
@see RectangularMatrix::operator/(T) const
|
||
|
14 years ago
|
*/
|
||
|
13 years ago
|
template<std::size_t cols, std::size_t rows, class T> inline RectangularMatrix<cols, rows, T> operator/(
|
||
|
|
#ifdef DOXYGEN_GENERATING_OUTPUT
|
||
|
|
T
|
||
|
|
#else
|
||
|
|
typename std::common_type<T>::type
|
||
|
|
#endif
|
||
|
|
number, const RectangularMatrix<cols, rows, T>& matrix)
|
||
|
|
{
|
||
|
14 years ago
|
RectangularMatrix<cols, rows, T> out;
|
||
|
|
|
||
|
13 years ago
|
for(std::size_t i = 0; i != cols; ++i)
|
||
|
|
out[i] = number/matrix[i];
|
||
|
14 years ago
|
|
||
|
|
return out;
|
||
|
|
}
|
||
|
|
|
||
|
13 years ago
|
/** @relates RectangularMatrix
|
||
|
|
@brief Multiply vector with rectangular matrix
|
||
|
|
|
||
|
|
Internally the same as multiplying one-column matrix with one-row matrix. @f[
|
||
|
|
(\boldsymbol {aA})_{ji} = \boldsymbol a_i \boldsymbol A_j
|
||
|
|
@f]
|
||
|
|
@see RectangularMatrix::operator*(const RectangularMatrix<size, cols, T>&) const
|
||
|
|
*/
|
||
|
|
template<std::size_t size, std::size_t cols, class T> inline RectangularMatrix<cols, size, T> operator*(const Vector<size, T>& vector, const RectangularMatrix<cols, 1, T>& matrix) {
|
||
|
|
return RectangularMatrix<1, size, T>(vector)*matrix;
|
||
|
|
}
|
||
|
|
|
||
|
14 years ago
|
/** @debugoperator{Magnum::Math::RectangularMatrix} */
|
||
|
14 years ago
|
template<std::size_t cols, std::size_t rows, class T> Corrade::Utility::Debug operator<<(Corrade::Utility::Debug debug, const Magnum::Math::RectangularMatrix<cols, rows, T>& value) {
|
||
|
14 years ago
|
debug << "Matrix(";
|
||
|
|
debug.setFlag(Corrade::Utility::Debug::SpaceAfterEachValue, false);
|
||
|
14 years ago
|
for(std::size_t row = 0; row != rows; ++row) {
|
||
|
14 years ago
|
if(row != 0) debug << ",\n ";
|
||
|
14 years ago
|
for(std::size_t col = 0; col != cols; ++col) {
|
||
|
14 years ago
|
if(col != 0) debug << ", ";
|
||
|
14 years ago
|
debug << value[col][row];
|
||
|
14 years ago
|
}
|
||
|
|
}
|
||
|
14 years ago
|
debug << ")";
|
||
|
14 years ago
|
debug.setFlag(Corrade::Utility::Debug::SpaceAfterEachValue, true);
|
||
|
|
return debug;
|
||
|
|
}
|
||
|
|
|
||
|
14 years ago
|
#ifndef DOXYGEN_GENERATING_OUTPUT
|
||
|
13 years ago
|
/* Explicit instantiation for types used in OpenGL */
|
||
|
14 years ago
|
/* Square matrices */
|
||
|
13 years ago
|
extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<2, 2, Float>&);
|
||
|
|
extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<3, 3, Float>&);
|
||
|
|
extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<4, 4, Float>&);
|
||
|
14 years ago
|
#ifndef MAGNUM_TARGET_GLES
|
||
|
13 years ago
|
extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<2, 2, Double>&);
|
||
|
|
extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<3, 3, Double>&);
|
||
|
|
extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<4, 4, Double>&);
|
||
|
14 years ago
|
#endif
|
||
|
|
|
||
|
|
/* Rectangular matrices */
|
||
|
13 years ago
|
extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<2, 3, Float>&);
|
||
|
|
extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<3, 2, Float>&);
|
||
|
|
extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<2, 4, Float>&);
|
||
|
|
extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<4, 2, Float>&);
|
||
|
|
extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<3, 4, Float>&);
|
||
|
|
extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<4, 3, Float>&);
|
||
|
14 years ago
|
#ifndef MAGNUM_TARGET_GLES
|
||
|
13 years ago
|
extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<2, 3, Double>&);
|
||
|
|
extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<3, 2, Double>&);
|
||
|
|
extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<2, 4, Double>&);
|
||
|
|
extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<4, 2, Double>&);
|
||
|
|
extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<3, 4, Double>&);
|
||
|
|
extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<4, 3, Double>&);
|
||
|
14 years ago
|
#endif
|
||
|
|
|
||
|
14 years ago
|
#define MAGNUM_RECTANGULARMATRIX_SUBCLASS_IMPLEMENTATION(cols, rows, ...) \
|
||
|
13 years ago
|
static __VA_ARGS__& from(T* data) { \
|
||
|
14 years ago
|
return *reinterpret_cast<__VA_ARGS__*>(data); \
|
||
|
|
} \
|
||
|
13 years ago
|
static const __VA_ARGS__& from(const T* data) { \
|
||
|
14 years ago
|
return *reinterpret_cast<const __VA_ARGS__*>(data); \
|
||
|
13 years ago
|
} \
|
||
|
|
constexpr static __VA_ARGS__ fromDiagonal(const Vector<Math::RectangularMatrix<cols, rows, T>::DiagonalSize, T>& diagonal) { \
|
||
|
|
return Math::RectangularMatrix<cols, rows, T>::fromDiagonal(diagonal); \
|
||
|
14 years ago
|
} \
|
||
|
|
\
|
||
|
13 years ago
|
__VA_ARGS__ operator-() const { \
|
||
|
14 years ago
|
return Math::RectangularMatrix<cols, rows, T>::operator-(); \
|
||
|
|
} \
|
||
|
13 years ago
|
__VA_ARGS__& operator+=(const Math::RectangularMatrix<cols, rows, T>& other) { \
|
||
|
14 years ago
|
Math::RectangularMatrix<cols, rows, T>::operator+=(other); \
|
||
|
14 years ago
|
return *this; \
|
||
|
|
} \
|
||
|
13 years ago
|
__VA_ARGS__ operator+(const Math::RectangularMatrix<cols, rows, T>& other) const { \
|
||
|
13 years ago
|
return Math::RectangularMatrix<cols, rows, T>::operator+(other); \
|
||
|
14 years ago
|
} \
|
||
|
13 years ago
|
__VA_ARGS__& operator-=(const Math::RectangularMatrix<cols, rows, T>& other) { \
|
||
|
14 years ago
|
Math::RectangularMatrix<cols, rows, T>::operator-=(other); \
|
||
|
14 years ago
|
return *this; \
|
||
|
14 years ago
|
} \
|
||
|
13 years ago
|
__VA_ARGS__ operator-(const Math::RectangularMatrix<cols, rows, T>& other) const { \
|
||
|
13 years ago
|
return Math::RectangularMatrix<cols, rows, T>::operator-(other); \
|
||
|
14 years ago
|
} \
|
||
|
13 years ago
|
__VA_ARGS__& operator*=(T number) { \
|
||
|
14 years ago
|
Math::RectangularMatrix<cols, rows, T>::operator*=(number); \
|
||
|
14 years ago
|
return *this; \
|
||
|
|
} \
|
||
|
13 years ago
|
__VA_ARGS__ operator*(T number) const { \
|
||
|
13 years ago
|
return Math::RectangularMatrix<cols, rows, T>::operator*(number); \
|
||
|
14 years ago
|
} \
|
||
|
13 years ago
|
__VA_ARGS__& operator/=(T number) { \
|
||
|
14 years ago
|
Math::RectangularMatrix<cols, rows, T>::operator/=(number); \
|
||
|
14 years ago
|
return *this; \
|
||
|
13 years ago
|
} \
|
||
|
13 years ago
|
__VA_ARGS__ operator/(T number) const { \
|
||
|
13 years ago
|
return Math::RectangularMatrix<cols, rows, T>::operator/(number); \
|
||
|
14 years ago
|
}
|
||
|
13 years ago
|
|
||
|
|
#define MAGNUM_MATRIX_OPERATOR_IMPLEMENTATION(...) \
|
||
|
|
template<std::size_t size, class T> inline __VA_ARGS__ operator*(typename std::common_type<T>::type number, const __VA_ARGS__& matrix) { \
|
||
|
|
return number*static_cast<const Math::RectangularMatrix<size, size, T>&>(matrix); \
|
||
|
|
} \
|
||
|
|
template<std::size_t size, class T> inline __VA_ARGS__ operator/(typename std::common_type<T>::type number, const __VA_ARGS__& matrix) { \
|
||
|
|
return number/static_cast<const Math::RectangularMatrix<size, size, T>&>(matrix); \
|
||
|
|
} \
|
||
|
|
template<std::size_t size, class T> inline __VA_ARGS__ operator*(const Vector<size, T>& vector, const RectangularMatrix<size, 1, T>& matrix) { \
|
||
|
13 years ago
|
return Math::RectangularMatrix<1, size, T>(vector)*matrix; \
|
||
|
13 years ago
|
}
|
||
|
|
|
||
|
|
#define MAGNUM_MATRIXn_OPERATOR_IMPLEMENTATION(size, Type) \
|
||
|
|
template<class T> inline Type<T> operator*(typename std::common_type<T>::type number, const Type<T>& matrix) { \
|
||
|
|
return number*static_cast<const Math::RectangularMatrix<size, size, T>&>(matrix); \
|
||
|
|
} \
|
||
|
|
template<class T> inline Type<T> operator/(typename std::common_type<T>::type number, const Type<T>& matrix) { \
|
||
|
|
return number/static_cast<const Math::RectangularMatrix<size, size, T>&>(matrix); \
|
||
|
|
} \
|
||
|
|
template<class T> inline Type<T> operator*(const Vector<size, T>& vector, const RectangularMatrix<size, 1, T>& matrix) { \
|
||
|
13 years ago
|
return Math::RectangularMatrix<1, size, T>(vector)*matrix; \
|
||
|
13 years ago
|
}
|
||
|
14 years ago
|
#endif
|
||
|
|
|
||
|
13 years ago
|
namespace Implementation {
|
||
|
|
template<std::size_t rows, std::size_t i, class T, std::size_t ...sequence> inline constexpr Vector<rows, T> diagonalMatrixColumn2(Implementation::Sequence<sequence...>, const T& number) {
|
||
|
|
return {(sequence == i ? number : T(0))...};
|
||
|
|
}
|
||
|
|
template<std::size_t rows, std::size_t i, class T> inline constexpr Vector<rows, T> diagonalMatrixColumn(const T& number) {
|
||
|
|
return diagonalMatrixColumn2<rows, i, T>(typename Implementation::GenerateSequence<rows>::Type(), number);
|
||
|
|
}
|
||
|
13 years ago
|
}
|
||
|
|
|
||
|
13 years ago
|
template<std::size_t cols, std::size_t rows, class T> template<std::size_t ...sequence> inline constexpr RectangularMatrix<cols, rows, T>::RectangularMatrix(Implementation::Sequence<sequence...>, const Vector<DiagonalSize, T>& diagonal): _data{Implementation::diagonalMatrixColumn<rows, sequence>(sequence < DiagonalSize ? diagonal[sequence] : T{})...} {}
|
||
|
|
|
||
|
13 years ago
|
template<std::size_t cols, std::size_t rows, class T> inline Vector<cols, T> RectangularMatrix<cols, rows, T>::row(std::size_t row) const {
|
||
|
|
Vector<cols, T> out;
|
||
|
|
|
||
|
|
for(std::size_t i = 0; i != cols; ++i)
|
||
|
|
out[i] = _data[i][row];
|
||
|
|
|
||
|
|
return out;
|
||
|
|
}
|
||
|
|
|
||
|
|
template<std::size_t cols, std::size_t rows, class T> inline RectangularMatrix<cols, rows, T> RectangularMatrix<cols, rows, T>::operator-() const {
|
||
|
|
RectangularMatrix<cols, rows, T> out;
|
||
|
|
|
||
|
|
for(std::size_t i = 0; i != cols; ++i)
|
||
|
|
out._data[i] = -_data[i];
|
||
|
|
|
||
|
|
return out;
|
||
|
|
}
|
||
|
|
|
||
|
|
template<std::size_t cols, std::size_t rows, class T> template<std::size_t size> inline RectangularMatrix<size, rows, T> RectangularMatrix<cols, rows, T>::operator*(const RectangularMatrix<size, cols, T>& other) const {
|
||
|
|
RectangularMatrix<size, rows, T> out;
|
||
|
|
|
||
|
|
for(std::size_t col = 0; col != size; ++col)
|
||
|
|
for(std::size_t row = 0; row != rows; ++row)
|
||
|
|
for(std::size_t pos = 0; pos != cols; ++pos)
|
||
|
|
out[col][row] += _data[pos][row]*other._data[col][pos];
|
||
|
|
|
||
|
|
return out;
|
||
|
|
}
|
||
|
|
|
||
|
|
template<std::size_t cols, std::size_t rows, class T> inline RectangularMatrix<rows, cols, T> RectangularMatrix<cols, rows, T>::transposed() const {
|
||
|
|
RectangularMatrix<rows, cols, T> out;
|
||
|
|
|
||
|
|
for(std::size_t col = 0; col != cols; ++col)
|
||
|
|
for(std::size_t row = 0; row != rows; ++row)
|
||
|
|
out[row][col] = _data[col][row];
|
||
|
|
|
||
|
|
return out;
|
||
|
|
}
|
||
|
|
|
||
|
13 years ago
|
template<std::size_t cols, std::size_t rows, class T> inline constexpr auto RectangularMatrix<cols, rows, T>::diagonal() const -> Vector<DiagonalSize, T> { return diagonalInternal(typename Implementation::GenerateSequence<DiagonalSize>::Type()); }
|
||
|
13 years ago
|
|
||
|
13 years ago
|
#ifndef DOXYGEN_GENERATING_OUTPUT
|
||
|
13 years ago
|
template<std::size_t cols, std::size_t rows, class T> template<std::size_t ...sequence> inline constexpr auto RectangularMatrix<cols, rows, T>::diagonalInternal(Implementation::Sequence<sequence...>) const -> Vector<DiagonalSize, T> {
|
||
|
|
return {(*this)[sequence][sequence]...};
|
||
|
13 years ago
|
}
|
||
|
13 years ago
|
#endif
|
||
|
13 years ago
|
|
||
|
14 years ago
|
}}
|
||
|
|
|
||
|
|
namespace Corrade { namespace Utility {
|
||
|
|
|
||
|
|
/** @configurationvalue{Magnum::Math::RectangularMatrix} */
|
||
|
14 years ago
|
template<std::size_t cols, std::size_t rows, class T> struct ConfigurationValue<Magnum::Math::RectangularMatrix<cols, rows, T>> {
|
||
|
14 years ago
|
ConfigurationValue() = delete;
|
||
|
|
|
||
|
14 years ago
|
/** @brief Writes elements separated with spaces */
|
||
|
14 years ago
|
static std::string toString(const Magnum::Math::RectangularMatrix<cols, rows, T>& value, ConfigurationValueFlags flags) {
|
||
|
14 years ago
|
std::string output;
|
||
|
|
|
||
|
14 years ago
|
for(std::size_t row = 0; row != rows; ++row) {
|
||
|
|
for(std::size_t col = 0; col != cols; ++col) {
|
||
|
14 years ago
|
if(!output.empty()) output += ' ';
|
||
|
13 years ago
|
output += ConfigurationValue<T>::toString(value[col][row], flags);
|
||
|
14 years ago
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
return output;
|
||
|
|
}
|
||
|
|
|
||
|
|
/** @brief Reads elements separated with whitespace */
|
||
|
14 years ago
|
static Magnum::Math::RectangularMatrix<cols, rows, T> fromString(const std::string& stringValue, ConfigurationValueFlags flags) {
|
||
|
14 years ago
|
Magnum::Math::RectangularMatrix<cols, rows, T> result;
|
||
|
|
|
||
|
14 years ago
|
std::size_t oldpos = 0, pos = std::string::npos, i = 0;
|
||
|
|
do {
|
||
|
|
pos = stringValue.find(' ', oldpos);
|
||
|
|
std::string part = stringValue.substr(oldpos, pos-oldpos);
|
||
|
|
|
||
|
|
if(!part.empty()) {
|
||
|
13 years ago
|
result[i%cols][i/cols] = ConfigurationValue<T>::fromString(part, flags);
|
||
|
14 years ago
|
++i;
|
||
|
14 years ago
|
}
|
||
|
14 years ago
|
|
||
|
|
oldpos = pos+1;
|
||
|
|
} while(pos != std::string::npos);
|
||
|
14 years ago
|
|
||
|
|
return result;
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|
||
|
14 years ago
|
#ifndef DOXYGEN_GENERATING_OUTPUT
|
||
|
|
/* Square matrices */
|
||
|
13 years ago
|
extern template struct MAGNUM_EXPORT ConfigurationValue<Magnum::Math::RectangularMatrix<2, 2, Magnum::Float>>;
|
||
|
|
extern template struct MAGNUM_EXPORT ConfigurationValue<Magnum::Math::RectangularMatrix<3, 3, Magnum::Float>>;
|
||
|
|
extern template struct MAGNUM_EXPORT ConfigurationValue<Magnum::Math::RectangularMatrix<4, 4, Magnum::Float>>;
|
||
|
14 years ago
|
#ifndef MAGNUM_TARGET_GLES
|
||
|
13 years ago
|
extern template struct MAGNUM_EXPORT ConfigurationValue<Magnum::Math::RectangularMatrix<2, 2, Magnum::Double>>;
|
||
|
|
extern template struct MAGNUM_EXPORT ConfigurationValue<Magnum::Math::RectangularMatrix<3, 3, Magnum::Double>>;
|
||
|
|
extern template struct MAGNUM_EXPORT ConfigurationValue<Magnum::Math::RectangularMatrix<4, 4, Magnum::Double>>;
|
||
|
14 years ago
|
#endif
|
||
|
|
|
||
|
|
/* Rectangular matrices */
|
||
|
13 years ago
|
extern template struct MAGNUM_EXPORT ConfigurationValue<Magnum::Math::RectangularMatrix<2, 3, Magnum::Float>>;
|
||
|
|
extern template struct MAGNUM_EXPORT ConfigurationValue<Magnum::Math::RectangularMatrix<3, 2, Magnum::Float>>;
|
||
|
|
extern template struct MAGNUM_EXPORT ConfigurationValue<Magnum::Math::RectangularMatrix<2, 4, Magnum::Float>>;
|
||
|
|
extern template struct MAGNUM_EXPORT ConfigurationValue<Magnum::Math::RectangularMatrix<4, 2, Magnum::Float>>;
|
||
|
|
extern template struct MAGNUM_EXPORT ConfigurationValue<Magnum::Math::RectangularMatrix<3, 4, Magnum::Float>>;
|
||
|
|
extern template struct MAGNUM_EXPORT ConfigurationValue<Magnum::Math::RectangularMatrix<4, 3, Magnum::Float>>;
|
||
|
14 years ago
|
#ifndef MAGNUM_TARGET_GLES
|
||
|
13 years ago
|
extern template struct MAGNUM_EXPORT ConfigurationValue<Magnum::Math::RectangularMatrix<2, 3, Magnum::Double>>;
|
||
|
|
extern template struct MAGNUM_EXPORT ConfigurationValue<Magnum::Math::RectangularMatrix<3, 2, Magnum::Double>>;
|
||
|
|
extern template struct MAGNUM_EXPORT ConfigurationValue<Magnum::Math::RectangularMatrix<2, 4, Magnum::Double>>;
|
||
|
|
extern template struct MAGNUM_EXPORT ConfigurationValue<Magnum::Math::RectangularMatrix<4, 2, Magnum::Double>>;
|
||
|
|
extern template struct MAGNUM_EXPORT ConfigurationValue<Magnum::Math::RectangularMatrix<3, 4, Magnum::Double>>;
|
||
|
|
extern template struct MAGNUM_EXPORT ConfigurationValue<Magnum::Math::RectangularMatrix<4, 3, Magnum::Double>>;
|
||
|
14 years ago
|
#endif
|
||
|
|
#endif
|
||
|
|
|
||
|
14 years ago
|
}}
|
||
|
|
|
||
|
|
#endif
|