@ -19,48 +19,12 @@
* @ brief Class Magnum : : Math : : RectangularMatrix
*/
# include <cmath>
# include <limits>
# include <Utility/Debug.h>
# include <Utility/ConfigurationValue.h>
# include "MathTypeTraits.h"
# include "magnumVisibility.h"
# include "Math/Vector.h"
namespace Magnum { namespace Math {
/** @todo Properly test all constexpr */
/** @todoc Remove `ifndef` when Doxygen is sane again */
# ifndef DOXYGEN_GENERATING_OUTPUT
template < std : : size_t , std : : size_t , class > class RectangularMatrix ;
# endif
# ifndef DOXYGEN_GENERATING_OUTPUT
namespace Implementation {
template < std : : size_t . . . > struct Sequence { } ;
/* E.g. GenerateSequence<3>::Type is Sequence<0, 1, 2> */
template < std : : size_t N , std : : size_t . . . sequence > struct GenerateSequence :
GenerateSequence < N - 1 , N - 1 , sequence . . . > { } ;
template < std : : size_t . . . sequence > struct GenerateSequence < 0 , sequence . . . > {
typedef Sequence < sequence . . . > Type ;
} ;
/* Implementation for RectangularMatrix<cols, rows, T>::from(const RectangularMatrix<cols, rows, U>&) */
template < class T , class U , std : : size_t c , std : : size_t . . . sequence > inline constexpr Math : : RectangularMatrix < c , sizeof . . . ( sequence ) / c , T > rectangularMatrixFrom ( Sequence < sequence . . . > , const Math : : RectangularMatrix < c , sizeof . . . ( sequence ) / c , U > & matrix ) {
return { T ( matrix . data ( ) [ sequence ] ) . . . } ;
}
}
# endif
/** @todoc Remove `ifndef` when Doxygen is sane again */
# ifndef DOXYGEN_GENERATING_OUTPUT
template < std : : size_t size , class T > class Vector ;
# endif
/**
@ brief Rectangular matrix
@ tparam cols Column count
@ -75,7 +39,7 @@ math formulas are in reverse order (i.e. @f$ \boldsymbol A_{ji} @f$ instead
of @ f $ \ boldsymbol A_ { ij } @ f $ ) .
*/
template < std : : size_t cols , std : : size_t rows , class T > class RectangularMatrix {
static_assert ( cols ! = 0 & & rows ! = 0 , " Matrix cannot have zero elements " ) ;
static_assert ( cols ! = 0 & & rows ! = 0 , " Rectangular Matrix cannot have zero elements" ) ;
public :
typedef T Type ; /**< @brief Data type */
@ -98,18 +62,6 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
return * reinterpret_cast < const RectangularMatrix < cols , rows , T > * > ( data ) ;
}
/**
* @ brief % Matrix from column vectors
* @ param first First column vector
* @ param next Next column vectors
*
* @ todo Creating matrix from arbitrary combination of matrices with n rows
*/
template < class . . . U > inline constexpr static RectangularMatrix < cols , rows , T > from ( const Vector < rows , T > & first , const U & . . . next ) {
static_assert ( sizeof . . . ( next ) + 1 = = cols , " Improper number of arguments passed to Matrix from Vector constructor " ) ;
return from ( typename Implementation : : GenerateSequence < rows > : : Type ( ) , first , next . . . ) ;
}
/**
* @ brief % Matrix from another of different type
*
@ -122,21 +74,21 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
* @ endcode
*/
template < class U > inline constexpr static RectangularMatrix < cols , rows , T > from ( const RectangularMatrix < cols , rows , U > & other ) {
return Implementation : : rectangularMatrixFrom < T , U > ( typename Implementation : : GenerateSequence < cols * row s > : : Type ( ) , other ) ;
return from ( typename Implementation : : GenerateSequence < cols > : : Type ( ) , other ) ;
}
/** @brief Zero-filled matrix constructor */
inline constexpr /*implicit*/ RectangularMatrix ( ) : _data ( ) { }
/** @brief Construct zero-filled matrix */
inline constexpr /*implicit*/ RectangularMatrix ( ) { }
/**
* @ brief Initializer - list constructor
* @ param first First value
* @ param next Next value s
* @ brief Construct matrix from column vectors
* @ param first First column vector
* @ param next Next column vector s
*
* Note that the values are in column - major order .
* @ todo Creating matrix from arbitrary combination of matrices with n rows
*/
template < class . . . U > inline constexpr /*implicit*/ RectangularMatrix ( T first , U . . . next ) : _data { first , next . . . } {
static_assert ( sizeof . . . ( next ) + 1 = = cols * rows , " Improper number of arguments passed to RectangularMatrix constructor " ) ;
template < class . . . U > inline constexpr /*implicit*/ RectangularMatrix ( const Vector < rows , T > & first , const U & . . . next ) : _data { first , next . . . } {
static_assert ( sizeof . . . ( next ) + 1 = = cols , " Improper number of arguments passed to RectangularMatrix constructor " ) ;
}
/** @brief Copy constructor */
@ -149,47 +101,35 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
* @ brief Raw data
* @ return One - dimensional array of ` size * size ` length in column - major
* order .
*
* @ see operator [ ]
*/
inline T * data ( ) { return _data ; }
inline constexpr const T * data ( ) const { return _data ; } /**< @overload */
inline T * data ( ) { return reinterpret_cast < T * > ( _data ) ; }
inline constexpr const T * data ( ) const { return reinterpret_cast < const T * > ( _data ) ; } /**< @overload */
/**
* @ brief % Matrix column
*
* For accessing individual elements prefer to use operator ( ) , as it
* is guaranteed to not involve unnecessary conversions .
* Particular elements can be accessed using Vector : : operator [ ] , e . g . :
* @ code
* RectangularMatrix < 4 , 3 , float > m ;
* float a = m [ 2 ] [ 1 ] ;
* @ endcode
*
* @ see data ( )
*/
inline Vector < rows , T > & operator [ ] ( std : : size_t col ) {
return Vector < rows , T > : : from ( _data + col * rows ) ;
return _data [ col ] ;
}
/** @overload */
inline constexpr const Vector < rows , T > & operator [ ] ( std : : size_t col ) const {
return Vector < rows , T > : : from ( _data + col * rows ) ;
}
/**
* @ brief Element on given position
*
* Prefer this instead of using ` [ ] [ ] ` .
* @ see operator [ ]
*/
inline T & operator ( ) ( std : : size_t col , std : : size_t row ) {
return _data [ col * rows + row ] ;
}
/** @overload */
inline constexpr const T & operator ( ) ( std : : size_t col , std : : size_t row ) const {
return _data [ col * rows + row ] ;
return _data [ col ] ;
}
/**
* @ brief Equality operator
*
* @ see Vector : : operator < ( ) , Vector : : operator < = ( ) , Vector : : operator > = ( ) ,
* Vector : : operator > ( )
*/
/** @brief Equality comparison */
inline bool operator = = ( const RectangularMatrix < cols , rows , T > & other ) const {
for ( std : : size_t i = 0 ; i ! = cols * rows ; + + i )
if ( ! MathTypeTraits < T > : : equals ( _data [ i ] , other . _data [ i ] ) ) return false ;
for ( std : : size_t i = 0 ; i ! = cols ; + + i )
if ( _data [ i ] ! = other . _data [ i ] ) return false ;
return true ;
}
@ -207,12 +147,12 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
/**
* @ brief Add and assign matrix
*
* The computation is done in - place . @ f [
* \ boldsymbol A_ { ji } = \ boldsymbol A_ { ji } + \ boldsymbol B_ { ji }
* The computation is done column - wise in - place . @ f [
* \ boldsymbol A_j = \ boldsymbol A_j + \ boldsymbol B_j
* @ f ]
*/
RectangularMatrix < cols , rows , T > & operator + = ( const RectangularMatrix < cols , rows , T > & other ) {
for ( std : : size_t i = 0 ; i ! = cols * rows ; + + i )
for ( std : : size_t i = 0 ; i ! = cols ; + + i )
_data [ i ] + = other . _data [ i ] ;
return * this ;
@ -230,14 +170,14 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
/**
* @ brief Negated matrix
*
* The computation is done in - place . @ f [
* \ boldsymbol A_ { ji } = - \ boldsymbol A_ { ji }
* The computation is done column - wise in - place . @ f [
* \ boldsymbol A_j = - \ boldsymbol A_j
* @ f ]
*/
RectangularMatrix < cols , rows , T > operator - ( ) const {
RectangularMatrix < cols , rows , T > out ;
for ( std : : size_t i = 0 ; i ! = cols * rows ; + + i )
for ( std : : size_t i = 0 ; i ! = cols ; + + i )
out . _data [ i ] = - _data [ i ] ;
return out ;
@ -246,12 +186,12 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
/**
* @ brief Subtract and assign matrix
*
* The computation is done in - place . @ f [
* \ boldsymbol A_ { ji } = \ boldsymbol A_ { ji } - \ boldsymbol B_ { ji }
* The computation is done column - wise in - place . @ f [
* \ boldsymbol A_j = \ boldsymbol A_j - \ boldsymbol B_j
* @ f ]
*/
RectangularMatrix < cols , rows , T > & operator - = ( const RectangularMatrix < cols , rows , T > & other ) {
for ( std : : size_t i = 0 ; i ! = cols * rows ; + + i )
for ( std : : size_t i = 0 ; i ! = cols ; + + i )
_data [ i ] - = other . _data [ i ] ;
return * this ;
@ -282,8 +222,8 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
/**
* @ brief Multiply matrix with number and assign
*
* The computation is done in - place . @ f [
* \ boldsymbol A_ { ji } = a \ boldsymbol A_ { ji }
* The computation is done column - wise in - place . @ f [
* \ boldsymbol A_j = a \ boldsymbol A_j
* @ f ]
*/
# ifndef DOXYGEN_GENERATING_OUTPUT
@ -291,7 +231,7 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
# else
template < class U > RectangularMatrix < cols , rows , T > & operator * = ( U number ) {
# endif
for ( std : : size_t i = 0 ; i ! = cols * rows ; + + i )
for ( std : : size_t i = 0 ; i ! = cols ; + + i )
_data [ i ] * = number ;
return * this ;
@ -313,8 +253,8 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
/**
* @ brief Divide matrix with number and assign
*
* The computation is done in - place . @ f [
* \ boldsymbol A_ { ji } = \ frac { \ boldsymbol A_ { ji } } a
* The computation is done column - wise in - place . @ f [
* \ boldsymbol A_j = \ frac { \ boldsymbol A_j } a
* @ f ]
*/
# ifndef DOXYGEN_GENERATING_OUTPUT
@ -322,7 +262,7 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
# else
template < class U > RectangularMatrix < cols , rows , T > & operator / = ( U number ) {
# endif
for ( std : : size_t i = 0 ; i ! = cols * rows ; + + i )
for ( std : : size_t i = 0 ; i ! = cols ; + + i )
_data [ i ] / = number ;
return * this ;
@ -341,7 +281,7 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
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 ) + = ( * this ) ( pos , row ) * other ( col , pos ) ;
out [ col ] [ row ] + = ( * this ) [ pos ] [ row ] * other [ col ] [ pos ] ;
return out ;
}
@ -355,7 +295,7 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
* @ f ]
*/
Vector < rows , T > operator * ( const Vector < rows , T > & other ) const {
return operator * ( static_cast < RectangularMatrix < 1 , rows , T > > ( other ) ) ;
return operator * ( RectangularMatrix < 1 , rows , T > ( other ) ) [ 0 ] ;
}
/** @brief Transposed matrix */
@ -364,23 +304,18 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
for ( std : : size_t col = 0 ; col ! = cols ; + + col )
for ( std : : size_t row = 0 ; row ! = rows ; + + row )
out ( row , col ) = ( * this ) ( col , row ) ;
out [ row ] [ col ] = ( * this ) [ col ] [ row ] ;
return out ;
}
# ifndef DOXYGEN_GENERATING_OUTPUT
protected :
T _data [ rows * cols ] ;
# endif
private :
template < std : : size_t . . . sequence , class . . . U > inline constexpr static RectangularMatrix < cols , rows , T > from ( Implementation : : Sequence < sequence . . . > s , const Vector < rows , T > & first , U . . . next ) {
return from ( s , next . . . , first [ sequence ] . . . ) ;
}
template < std : : size_t . . . sequence , class . . . U > inline constexpr static RectangularMatrix < cols , rows , T > from ( Implementation : : Sequence < sequence . . . > , T first , U . . . next ) {
return RectangularMatrix < cols , rows , T > ( first , next . . . ) ;
/* Implementation for RectangularMatrix<cols, rows, T>::from(const RectangularMatrix<cols, rows, U>&) */
template < class U , std : : size_t c , std : : size_t . . . sequence > inline constexpr static Math : : RectangularMatrix < c , sizeof . . . ( sequence ) , T > from ( Implementation : : Sequence < sequence . . . > , const Math : : RectangularMatrix < c , sizeof . . . ( sequence ) , U > & matrix ) {
return { Vector < sizeof . . . ( sequence ) , T > : : from ( matrix [ sequence ] ) . . . } ;
}
Vector < rows , T > _data [ cols ] ;
} ;
/** @relates RectangularMatrix
@ -399,8 +334,8 @@ template<std::size_t cols, std::size_t rows, class T, class U> inline typename s
/** @relates RectangularMatrix
@ brief Divide matrix with number and invert
@ f [
\ boldsymbol B_ { ji } = \ frac a { \ boldsymbol A_ { ji } }
The computation is done column - wise . @ f [
\ boldsymbol B_j = \ frac a { \ boldsymbol A_j }
@ f ]
@ see RectangularMatrix : : operator / ( U ) const
*/
@ -411,12 +346,24 @@ template<std::size_t cols, std::size_t rows, class T, class U> typename std::ena
# endif
RectangularMatrix < cols , rows , T > out ;
for ( std : : size_t i = 0 ; i ! = cols * rows ; + + i )
out . data ( ) [ i ] = number / matrix . data ( ) [ i ] ;
for ( std : : size_t i = 0 ; i ! = cols ; + + i )
out [ i ] = number / matrix [ i ] ;
return out ;
}
/** @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 ;
}
/** @debugoperator{Magnum::Math::RectangularMatrix} */
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 ) {
debug < < " Matrix( " ;
@ -433,24 +380,8 @@ template<std::size_t cols, std::size_t rows, class T> Corrade::Utility::Debug op
return debug ;
}
/* Explicit instantiation for types used in OpenGL */
# ifndef DOXYGEN_GENERATING_OUTPUT
/* Vectors */
extern template Corrade : : Utility : : Debug MAGNUM_EXPORT operator < < ( Corrade : : Utility : : Debug , const RectangularMatrix < 1 , 2 , float > & ) ;
extern template Corrade : : Utility : : Debug MAGNUM_EXPORT operator < < ( Corrade : : Utility : : Debug , const RectangularMatrix < 1 , 3 , float > & ) ;
extern template Corrade : : Utility : : Debug MAGNUM_EXPORT operator < < ( Corrade : : Utility : : Debug , const RectangularMatrix < 1 , 4 , float > & ) ;
extern template Corrade : : Utility : : Debug MAGNUM_EXPORT operator < < ( Corrade : : Utility : : Debug , const RectangularMatrix < 1 , 2 , int > & ) ;
extern template Corrade : : Utility : : Debug MAGNUM_EXPORT operator < < ( Corrade : : Utility : : Debug , const RectangularMatrix < 1 , 3 , int > & ) ;
extern template Corrade : : Utility : : Debug MAGNUM_EXPORT operator < < ( Corrade : : Utility : : Debug , const RectangularMatrix < 1 , 4 , int > & ) ;
extern template Corrade : : Utility : : Debug MAGNUM_EXPORT operator < < ( Corrade : : Utility : : Debug , const RectangularMatrix < 1 , 2 , unsigned int > & ) ;
extern template Corrade : : Utility : : Debug MAGNUM_EXPORT operator < < ( Corrade : : Utility : : Debug , const RectangularMatrix < 1 , 3 , unsigned int > & ) ;
extern template Corrade : : Utility : : Debug MAGNUM_EXPORT operator < < ( Corrade : : Utility : : Debug , const RectangularMatrix < 1 , 4 , unsigned int > & ) ;
# ifndef MAGNUM_TARGET_GLES
extern template Corrade : : Utility : : Debug MAGNUM_EXPORT operator < < ( Corrade : : Utility : : Debug , const RectangularMatrix < 1 , 2 , double > & ) ;
extern template Corrade : : Utility : : Debug MAGNUM_EXPORT operator < < ( Corrade : : Utility : : Debug , const RectangularMatrix < 1 , 3 , double > & ) ;
extern template Corrade : : Utility : : Debug MAGNUM_EXPORT operator < < ( Corrade : : Utility : : Debug , const RectangularMatrix < 1 , 4 , double > & ) ;
# endif
/* Explicit instantiation for types used in OpenGL */
/* Square matrices */
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 > & ) ;
@ -476,9 +407,7 @@ extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utilit
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 > & ) ;
# endif
# endif
# ifndef DOXYGEN_GENERATING_OUTPUT
# define MAGNUM_RECTANGULARMATRIX_SUBCLASS_IMPLEMENTATION(cols, rows, ...) \
inline constexpr static __VA_ARGS__ & from ( T * data ) { \
return * reinterpret_cast < __VA_ARGS__ * > ( data ) ; \
@ -486,9 +415,6 @@ extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utilit
inline constexpr static const __VA_ARGS__ & from ( const T * data ) { \
return * reinterpret_cast < const __VA_ARGS__ * > ( data ) ; \
} \
template < class . . . U > inline constexpr static __VA_ARGS__ from ( const Math : : Vector < rows , T > & first , const U & . . . next ) { \
return Math : : RectangularMatrix < cols , rows , T > : : from ( first , next . . . ) ; \
} \
template < class U > inline constexpr static RectangularMatrix < cols , rows , T > from ( const Math : : RectangularMatrix < cols , rows , U > & other ) { \
return Math : : RectangularMatrix < cols , rows , T > : : from ( other ) ; \
} \
@ -496,39 +422,38 @@ extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utilit
inline __VA_ARGS__ & operator = ( const Math : : RectangularMatrix < cols , rows , T > & other ) { \
Math : : RectangularMatrix < cols , rows , T > : : operator = ( other ) ; \
return * this ; \
}
# define MAGNUM_RECTANGULARMATRIX_SUBCLASS_OPERATOR_IMPLEMENTATION(cols, rows, ...) \
} \
\
inline __VA_ARGS__ operator - ( ) const { \
return Math : : RectangularMatrix < cols , rows , T > : : operator - ( ) ; \
} \
inline __VA_ARGS__ operator + ( const Math : : RectangularMatrix < cols , rows , T > & other ) const { \
return Math : : RectangularMatrix < cols , rows , T > : : operator + ( other ) ; \
} \
inline __VA_ARGS__ & operator + = ( const Math : : RectangularMatrix < cols , rows , T > & other ) { \
Math : : RectangularMatrix < cols , rows , T > : : operator + = ( other ) ; \
return * this ; \
} \
inline __VA_ARGS__ operator - ( const Math : : RectangularMatrix < cols , rows , T > & other ) const { \
return Math : : RectangularMatrix < cols , rows , T > : : operator - ( other ) ; \
inline __VA_ARGS__ operator + ( const Math : : RectangularMatrix < cols , rows , T > & other ) const { \
return Math : : RectangularMatrix < cols , rows , T > : : operator + ( other ) ; \
} \
inline __VA_ARGS__ & operator - = ( const Math : : RectangularMatrix < cols , rows , T > & other ) { \
Math : : RectangularMatrix < cols , rows , T > : : operator - = ( other ) ; \
return * this ; \
} \
template < class U > inline typename std : : enable_if < std : : is_arithmetic < U > : : value , __VA_ARGS__ > : : type operator * ( U numb er) const { \
return Math : : RectangularMatrix < cols , rows , T > : : operator * ( numb er) ; \
inline __VA_ARGS__ operator - ( const Math : : RectangularMatrix < cols , rows , T > & oth er) const { \
return Math : : RectangularMatrix < cols , rows , T > : : operator - ( oth er) ; \
} \
template < class U > inline typename std : : enable_if < std : : is_arithmetic < U > : : value , __VA_ARGS__ & > : : type operator * = ( U number ) { \
Math : : RectangularMatrix < cols , rows , T > : : operator * = ( number ) ; \
return * this ; \
} \
template < class U > inline typename std : : enable_if < std : : is_arithmetic < U > : : value , __VA_ARGS__ > : : type operator / ( U number ) const { \
return Math : : RectangularMatrix < cols , rows , T > : : operator / ( number ) ; \
template < class U > inline typename std : : enable_if < std : : is_arithmetic < U > : : value , __VA_ARGS__ > : : type operator * ( U number ) const { \
return Math : : RectangularMatrix < cols , rows , T > : : operator * ( number ) ; \
} \
template < class U > inline typename std : : enable_if < std : : is_arithmetic < U > : : value , __VA_ARGS__ & > : : type operator / = ( U number ) { \
Math : : RectangularMatrix < cols , rows , T > : : operator / = ( number ) ; \
return * this ; \
} \
template < class U > inline typename std : : enable_if < std : : is_arithmetic < U > : : value , __VA_ARGS__ > : : type operator / ( U number ) const { \
return Math : : RectangularMatrix < cols , rows , T > : : operator / ( number ) ; \
}
# endif
@ -547,7 +472,7 @@ template<std::size_t cols, std::size_t rows, class T> struct ConfigurationValue<
for ( std : : size_t row = 0 ; row ! = rows ; + + row ) {
for ( std : : size_t col = 0 ; col ! = cols ; + + col ) {
if ( ! output . empty ( ) ) output + = ' ' ;
output + = ConfigurationValue < T > : : toString ( value ( col , row ) , flags ) ;
output + = ConfigurationValue < T > : : toString ( value [ col ] [ row ] , flags ) ;
}
}
@ -564,7 +489,7 @@ template<std::size_t cols, std::size_t rows, class T> struct ConfigurationValue<
std : : string part = stringValue . substr ( oldpos , pos - oldpos ) ;
if ( ! part . empty ( ) ) {
result ( i % cols , i / cols ) = ConfigurationValue < T > : : fromString ( part , flags ) ;
result [ i % cols ] [ i / cols ] = ConfigurationValue < T > : : fromString ( part , flags ) ;
+ + i ;
}
@ -576,22 +501,6 @@ template<std::size_t cols, std::size_t rows, class T> struct ConfigurationValue<
} ;
# ifndef DOXYGEN_GENERATING_OUTPUT
/* Vectors */
extern template struct MAGNUM_EXPORT ConfigurationValue < Magnum : : Math : : RectangularMatrix < 1 , 2 , float > > ;
extern template struct MAGNUM_EXPORT ConfigurationValue < Magnum : : Math : : RectangularMatrix < 1 , 3 , float > > ;
extern template struct MAGNUM_EXPORT ConfigurationValue < Magnum : : Math : : RectangularMatrix < 1 , 4 , float > > ;
extern template struct MAGNUM_EXPORT ConfigurationValue < Magnum : : Math : : RectangularMatrix < 1 , 2 , int > > ;
extern template struct MAGNUM_EXPORT ConfigurationValue < Magnum : : Math : : RectangularMatrix < 1 , 3 , int > > ;
extern template struct MAGNUM_EXPORT ConfigurationValue < Magnum : : Math : : RectangularMatrix < 1 , 4 , int > > ;
extern template struct MAGNUM_EXPORT ConfigurationValue < Magnum : : Math : : RectangularMatrix < 1 , 2 , unsigned int > > ;
extern template struct MAGNUM_EXPORT ConfigurationValue < Magnum : : Math : : RectangularMatrix < 1 , 3 , unsigned int > > ;
extern template struct MAGNUM_EXPORT ConfigurationValue < Magnum : : Math : : RectangularMatrix < 1 , 4 , unsigned int > > ;
# ifndef MAGNUM_TARGET_GLES
extern template struct MAGNUM_EXPORT ConfigurationValue < Magnum : : Math : : RectangularMatrix < 1 , 2 , double > > ;
extern template struct MAGNUM_EXPORT ConfigurationValue < Magnum : : Math : : RectangularMatrix < 1 , 3 , double > > ;
extern template struct MAGNUM_EXPORT ConfigurationValue < Magnum : : Math : : RectangularMatrix < 1 , 4 , double > > ;
# endif
/* Square matrices */
extern template struct MAGNUM_EXPORT ConfigurationValue < Magnum : : Math : : RectangularMatrix < 2 , 2 , float > > ;
extern template struct MAGNUM_EXPORT ConfigurationValue < Magnum : : Math : : RectangularMatrix < 3 , 3 , float > > ;
@ -621,7 +530,4 @@ extern template struct MAGNUM_EXPORT ConfigurationValue<Magnum::Math::Rectangula
} }
/* Include also Vector, so the definition is complete */
# include "Vector.h"
# endif