stabilize build system: depends, installer, boost/bdb fixes, cross targets groundwork

This commit is contained in:
2026-02-24 18:38:47 +00:00
parent da8c28aaeb
commit 65cb2619a7
13106 changed files with 2484322 additions and 1804 deletions
@@ -0,0 +1,32 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_BE94EA1A31B211E0BBF943CFDFD72085
#define UUID_BE94EA1A31B211E0BBF943CFDFD72085
#include <boost/qvm/error.hpp>
#include <boost/qvm/mat_operations.hpp>
#include <boost/qvm/mat_access.hpp>
#include <boost/qvm/mat_traits_defaults.hpp>
#include <boost/qvm/mat_traits_array.hpp>
#include <boost/qvm/map.hpp>
#include <boost/qvm/mat.hpp>
#include <boost/qvm/math.hpp>
#include <boost/qvm/quat_operations.hpp>
#include <boost/qvm/quat_access.hpp>
#include <boost/qvm/quat_traits_defaults.hpp>
#include <boost/qvm/quat_traits.hpp>
#include <boost/qvm/quat.hpp>
#include <boost/qvm/quat_vec_operations.hpp>
#include <boost/qvm/swizzle.hpp>
#include <boost/qvm/vec_operations.hpp>
#include <boost/qvm/vec_access.hpp>
#include <boost/qvm/vec_traits_defaults.hpp>
#include <boost/qvm/vec_traits_array.hpp>
#include <boost/qvm/vec.hpp>
#include <boost/qvm/vec_mat_operations.hpp>
#include <boost/qvm/to_string.hpp>
#endif
@@ -0,0 +1,9 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_QVM_ASSERT
#include <boost/assert.hpp>
#define BOOST_QVM_ASSERT BOOST_ASSERT
#endif
@@ -0,0 +1,90 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_C5DC682E196211E0A4C1686BDFD72085
#define UUID_C5DC682E196211E0A4C1686BDFD72085
#include <boost/qvm/deduce_scalar.hpp>
#include <boost/qvm/mat_traits.hpp>
#include <boost/qvm/static_assert.hpp>
namespace
boost
{
namespace
qvm
{
template <class T,int Rows,int Cols>
struct mat;
namespace
qvm_detail
{
template <class M,int R,int C,
int MR=mat_traits<M>::rows,
int MC=mat_traits<M>::cols>
struct
deduce_mat_default
{
BOOST_QVM_STATIC_ASSERT(is_mat<M>::value);
typedef mat<typename mat_traits<M>::scalar_type,R,C> type;
};
template <class M,int R,int C>
struct
deduce_mat_default<M,R,C,R,C>
{
BOOST_QVM_STATIC_ASSERT(is_mat<M>::value);
typedef M type;
};
}
template <class Type,int Rows=mat_traits<Type>::rows,int Cols=mat_traits<Type>::cols>
struct
deduce_mat
{
BOOST_QVM_STATIC_ASSERT(is_mat<Type>::value);
typedef typename qvm_detail::deduce_mat_default<Type,Rows,Cols>::type type;
};
namespace
qvm_detail
{
template <class A,class B,int R,int C,
bool VA=is_mat<A>::value,
bool VB=is_mat<B>::value,
int AR=mat_traits<A>::rows,
int AC=mat_traits<A>::cols,
int BR=mat_traits<B>::rows,
int BC=mat_traits<B>::cols>
struct
deduce_m2_default
{
typedef mat<
typename deduce_scalar<
typename scalar<A>::type,
typename scalar<B>::type>::type,
R,C> type;
};
template <class M,int R,int C>
struct
deduce_m2_default<M,M,R,C,true,true,R,C,R,C>
{
typedef M type;
};
}
template <class A,class B,int R,int C>
struct
deduce_mat2
{
BOOST_QVM_STATIC_ASSERT(is_mat<A>::value || is_mat<B>::value);
typedef typename qvm_detail::deduce_m2_default<A,B,R,C>::type type;
};
}
}
#endif
@@ -0,0 +1,63 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_435FA7E8196311E0A176DE6BDFD72085
#define UUID_435FA7E8196311E0A176DE6BDFD72085
#include <boost/qvm/deduce_scalar.hpp>
#include <boost/qvm/quat_traits.hpp>
#include <boost/qvm/static_assert.hpp>
namespace
boost
{
namespace
qvm
{
template <class T>
struct quat;
template <class Q>
struct
deduce_quat
{
BOOST_QVM_STATIC_ASSERT(is_quat<Q>::value);
typedef Q type;
};
namespace
qvm_detail
{
template <class A,class B,
bool QA=is_quat<A>::value,
bool QB=is_quat<B>::value>
struct
deduce_quat2_default
{
typedef quat<
typename deduce_scalar<
typename scalar<A>::type,
typename scalar<B>::type>::type> type;
};
template <class Q>
struct
deduce_quat2_default<Q,Q,true,true>
{
typedef Q type;
};
}
template <class A,class B>
struct
deduce_quat2
{
BOOST_QVM_STATIC_ASSERT(is_quat<A>::value || is_quat<B>::value);
typedef typename qvm_detail::deduce_quat2_default<A,B>::type type;
};
}
}
#endif
@@ -0,0 +1,131 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_F20566FC196311E0B99D606CDFD72085
#define UUID_F20566FC196311E0B99D606CDFD72085
#include <boost/qvm/scalar_traits.hpp>
namespace
boost
{
namespace
qvm
{
namespace
deduce_scalar_detail
{
template <class A,class B> struct deduce_scalar_impl { };
template <class T>
struct
deduce_scalar_impl<T,T>
{
typedef T type;
};
template <> struct deduce_scalar_impl<signed char,unsigned char> { typedef unsigned char type; };
template <> struct deduce_scalar_impl<signed char,unsigned short> { typedef unsigned short type; };
template <> struct deduce_scalar_impl<signed char,unsigned int> { typedef unsigned int type; };
template <> struct deduce_scalar_impl<signed char,unsigned long> { typedef unsigned long type; };
template <> struct deduce_scalar_impl<signed char,signed short> { typedef signed short type; };
template <> struct deduce_scalar_impl<signed char,signed int> { typedef signed int type; };
template <> struct deduce_scalar_impl<signed char,signed long> { typedef signed long type; };
template <> struct deduce_scalar_impl<signed char,float> { typedef float type; };
template <> struct deduce_scalar_impl<signed char,double> { typedef double type; };
template <> struct deduce_scalar_impl<unsigned char,unsigned short> { typedef unsigned short type; };
template <> struct deduce_scalar_impl<unsigned char,unsigned int> { typedef unsigned int type; };
template <> struct deduce_scalar_impl<unsigned char,unsigned long> { typedef unsigned long type; };
template <> struct deduce_scalar_impl<unsigned char,signed short> { typedef signed short type; };
template <> struct deduce_scalar_impl<unsigned char,signed int> { typedef signed int type; };
template <> struct deduce_scalar_impl<unsigned char,signed long> { typedef signed long type; };
template <> struct deduce_scalar_impl<unsigned char,float> { typedef float type; };
template <> struct deduce_scalar_impl<unsigned char,double> { typedef double type; };
template <> struct deduce_scalar_impl<signed short,unsigned short> { typedef unsigned short type; };
template <> struct deduce_scalar_impl<signed short,unsigned int> { typedef unsigned int type; };
template <> struct deduce_scalar_impl<signed short,unsigned long> { typedef unsigned long type; };
template <> struct deduce_scalar_impl<signed short,signed int> { typedef signed int type; };
template <> struct deduce_scalar_impl<signed short,signed long> { typedef signed long type; };
template <> struct deduce_scalar_impl<signed short,float> { typedef float type; };
template <> struct deduce_scalar_impl<signed short,double> { typedef double type; };
template <> struct deduce_scalar_impl<unsigned short,unsigned int> { typedef unsigned int type; };
template <> struct deduce_scalar_impl<unsigned short,unsigned long> { typedef unsigned long type; };
template <> struct deduce_scalar_impl<unsigned short,signed int> { typedef signed int type; };
template <> struct deduce_scalar_impl<unsigned short,signed long> { typedef signed long type; };
template <> struct deduce_scalar_impl<unsigned short,float> { typedef float type; };
template <> struct deduce_scalar_impl<unsigned short,double> { typedef double type; };
template <> struct deduce_scalar_impl<signed int,unsigned int> { typedef unsigned int type; };
template <> struct deduce_scalar_impl<signed int,unsigned long> { typedef unsigned long type; };
template <> struct deduce_scalar_impl<signed int,signed long> { typedef signed long type; };
template <> struct deduce_scalar_impl<signed int,float> { typedef float type; };
template <> struct deduce_scalar_impl<signed int,double> { typedef double type; };
template <> struct deduce_scalar_impl<unsigned int,unsigned long> { typedef unsigned long type; };
template <> struct deduce_scalar_impl<unsigned int,signed long> { typedef signed long type; };
template <> struct deduce_scalar_impl<unsigned int,float> { typedef float type; };
template <> struct deduce_scalar_impl<unsigned int,double> { typedef double type; };
template <> struct deduce_scalar_impl<signed long,unsigned long> { typedef unsigned long type; };
template <> struct deduce_scalar_impl<signed long,float> { typedef float type; };
template <> struct deduce_scalar_impl<signed long,double> { typedef double type; };
template <> struct deduce_scalar_impl<unsigned long,float> { typedef float type; };
template <> struct deduce_scalar_impl<unsigned long,double> { typedef double type; };
template <> struct deduce_scalar_impl<float,double> { typedef double type; };
template <> struct deduce_scalar_impl<unsigned char,signed char> { typedef unsigned char type; };
template <> struct deduce_scalar_impl<unsigned short,signed char> { typedef unsigned short type; };
template <> struct deduce_scalar_impl<unsigned int,signed char> { typedef unsigned int type; };
template <> struct deduce_scalar_impl<unsigned long,signed char> { typedef unsigned long type; };
template <> struct deduce_scalar_impl<signed short,signed char> { typedef signed short type; };
template <> struct deduce_scalar_impl<signed int,signed char> { typedef signed int type; };
template <> struct deduce_scalar_impl<signed long,signed char> { typedef signed long type; };
template <> struct deduce_scalar_impl<float,signed char> { typedef float type; };
template <> struct deduce_scalar_impl<double,signed char> { typedef double type; };
template <> struct deduce_scalar_impl<unsigned short,unsigned char> { typedef unsigned short type; };
template <> struct deduce_scalar_impl<unsigned int,unsigned char> { typedef unsigned int type; };
template <> struct deduce_scalar_impl<unsigned long,unsigned char> { typedef unsigned long type; };
template <> struct deduce_scalar_impl<signed short,unsigned char> { typedef signed short type; };
template <> struct deduce_scalar_impl<signed int,unsigned char> { typedef signed int type; };
template <> struct deduce_scalar_impl<signed long,unsigned char> { typedef signed long type; };
template <> struct deduce_scalar_impl<float,unsigned char> { typedef float type; };
template <> struct deduce_scalar_impl<double,unsigned char> { typedef double type; };
template <> struct deduce_scalar_impl<unsigned short,signed short> { typedef unsigned short type; };
template <> struct deduce_scalar_impl<unsigned int,signed short> { typedef unsigned int type; };
template <> struct deduce_scalar_impl<unsigned long,signed short> { typedef unsigned long type; };
template <> struct deduce_scalar_impl<signed int,signed short> { typedef signed int type; };
template <> struct deduce_scalar_impl<signed long,signed short> { typedef signed long type; };
template <> struct deduce_scalar_impl<float,signed short> { typedef float type; };
template <> struct deduce_scalar_impl<double,signed short> { typedef double type; };
template <> struct deduce_scalar_impl<unsigned int,unsigned short> { typedef unsigned int type; };
template <> struct deduce_scalar_impl<unsigned long,unsigned short> { typedef unsigned long type; };
template <> struct deduce_scalar_impl<signed int,unsigned short> { typedef signed int type; };
template <> struct deduce_scalar_impl<signed long,unsigned short> { typedef signed long type; };
template <> struct deduce_scalar_impl<float,unsigned short> { typedef float type; };
template <> struct deduce_scalar_impl<double,unsigned short> { typedef double type; };
template <> struct deduce_scalar_impl<unsigned int,signed int> { typedef unsigned int type; };
template <> struct deduce_scalar_impl<unsigned long,signed int> { typedef unsigned long type; };
template <> struct deduce_scalar_impl<signed long,signed int> { typedef signed long type; };
template <> struct deduce_scalar_impl<float,signed int> { typedef float type; };
template <> struct deduce_scalar_impl<double,signed int> { typedef double type; };
template <> struct deduce_scalar_impl<unsigned long,unsigned int> { typedef unsigned long type; };
template <> struct deduce_scalar_impl<signed long,unsigned int> { typedef signed long type; };
template <> struct deduce_scalar_impl<float,unsigned int> { typedef float type; };
template <> struct deduce_scalar_impl<double,unsigned int> { typedef double type; };
template <> struct deduce_scalar_impl<unsigned long,signed long> { typedef unsigned long type; };
template <> struct deduce_scalar_impl<float,signed long> { typedef float type; };
template <> struct deduce_scalar_impl<double,signed long> { typedef double type; };
template <> struct deduce_scalar_impl<float,unsigned long> { typedef float type; };
template <> struct deduce_scalar_impl<double,unsigned long> { typedef double type; };
template <> struct deduce_scalar_impl<double,float> { typedef double type; };
}
template <class A,class B>
struct
deduce_scalar
{
typedef typename deduce_scalar_detail::deduce_scalar_impl<A,B>::type type;
};
}
}
#endif
@@ -0,0 +1,85 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_7E7AB138196311E0907B246CDFD72085
#define UUID_7E7AB138196311E0907B246CDFD72085
#include <boost/qvm/deduce_scalar.hpp>
#include <boost/qvm/vec_traits.hpp>
#include <boost/qvm/static_assert.hpp>
namespace
boost
{
namespace
qvm
{
template <class T,int D>
struct vec;
namespace
qvm_detail
{
template <class V,int D,
int VD=vec_traits<V>::dim>
struct
deduce_vec_default
{
typedef vec<typename vec_traits<V>::scalar_type,D> type;
};
template <class V,int D>
struct
deduce_vec_default<V,D,D>
{
typedef V type;
};
}
template <class V,int Dim=vec_traits<V>::dim>
struct
deduce_vec
{
BOOST_QVM_STATIC_ASSERT(is_vec<V>::value);
typedef typename qvm_detail::deduce_vec_default<V,Dim>::type type;
};
namespace
qvm_detail
{
template <class A,class B,int D,
bool VA=is_vec<A>::value,
bool VB=is_vec<B>::value,
int AD=vec_traits<A>::dim,
int BD=vec_traits<B>::dim>
struct
deduce_v2_default
{
typedef vec<
typename deduce_scalar<
typename scalar<A>::type,
typename scalar<B>::type>::type,
D> type;
};
template <class V,int D>
struct
deduce_v2_default<V,V,D,true,true,D,D>
{
typedef V type;
};
}
template <class A,class B,int D>
struct
deduce_vec2
{
BOOST_QVM_STATIC_ASSERT(is_vec<A>::value || is_vec<B>::value);
typedef typename qvm_detail::deduce_v2_default<A,B,D>::type type;
};
}
}
#endif
@@ -0,0 +1,64 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_995547FAAE0E11DE8CF511E755D89593
#define UUID_995547FAAE0E11DE8CF511E755D89593
#include <boost/qvm/detail/determinant_impl.hpp>
#include <boost/qvm/mat_traits.hpp>
#include <boost/qvm/static_assert.hpp>
namespace
boost
{
namespace
qvm
{
namespace
qvm_detail
{
template <class A>
BOOST_QVM_INLINE_OPERATIONS
typename deduce_mat<A>::type
cofactor_impl( A const & a )
{
BOOST_QVM_STATIC_ASSERT(mat_traits<A>::rows==mat_traits<A>::cols);
int const N=mat_traits<A>::rows;
typedef typename mat_traits<A>::scalar_type T;
T c[N-1][N-1];
typedef typename deduce_mat<A>::type R;
R b;
for( int j=0; j!=N; ++j )
{
for( int i=0; i!=N; ++i )
{
int i1=0;
for( int ii=0; ii!=N; ++ii )
{
if( ii==i )
continue;
int j1=0;
for( int jj=0; jj!=N; ++jj )
{
if( jj==j )
continue;
c[i1][j1] = mat_traits<A>::read_element_idx(ii,jj,a);
++j1;
}
++i1;
}
T det = determinant_impl(c);
if( (i+j)&1 )
det=-det;
mat_traits<R>::write_element_idx(i,j,b) = det;
}
}
return b;
}
}
}
}
#endif
@@ -0,0 +1,79 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_3DCF6B90AE0E11DE9A315BE555D89593
#define UUID_3DCF6B90AE0E11DE9A315BE555D89593
#include <boost/qvm/inline.hpp>
#include <boost/qvm/mat_traits_array.hpp>
#include <boost/qvm/static_assert.hpp>
namespace
boost
{
namespace
qvm
{
namespace
qvm_detail
{
template <int N>
struct
det_size
{
};
template <class M>
BOOST_QVM_INLINE_TRIVIAL
typename mat_traits<M>::scalar_type
determinant_impl_( M const & a, det_size<2> )
{
return
mat_traits<M>::template read_element<0,0>(a) * mat_traits<M>::template read_element<1,1>(a) -
mat_traits<M>::template read_element<1,0>(a) * mat_traits<M>::template read_element<0,1>(a);
}
template <class M,int N>
BOOST_QVM_INLINE_RECURSION
typename mat_traits<M>::scalar_type
determinant_impl_( M const & a, det_size<N> )
{
typedef typename mat_traits<M>::scalar_type T;
T m[N-1][N-1];
T det=T(0);
for( int j1=0; j1!=N; ++j1 )
{
for( int i=1; i!=N; ++i )
{
int j2 = 0;
for( int j=0; j!=N; ++j )
{
if( j==j1 )
continue;
m[i-1][j2] = mat_traits<M>::read_element_idx(i,j,a);
++j2;
}
}
T d=determinant_impl_(m,det_size<N-1>());
if( j1&1 )
d=-d;
det += mat_traits<M>::read_element_idx(0,j1,a) * d;
}
return det;
}
template <class M>
BOOST_QVM_INLINE_TRIVIAL
typename mat_traits<M>::scalar_type
determinant_impl( M const & a )
{
BOOST_QVM_STATIC_ASSERT(mat_traits<M>::rows==mat_traits<M>::cols);
return determinant_impl_(a,det_size<mat_traits<M>::rows>());
}
}
}
}
#endif
@@ -0,0 +1,35 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_4E340430AE4C11DEBA56149755D89593
#define UUID_4E340430AE4C11DEBA56149755D89593
namespace
boost
{
namespace
qvm
{
namespace
qvm_detail
{
template <class T>
struct
remove_const
{
typedef T type;
};
template <class T>
struct
remove_const<T const>
{
typedef T type;
};
}
}
}
#endif
@@ -0,0 +1,338 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_E831FAD6B38F11DE8CECBF0D56D89593
#define UUID_E831FAD6B38F11DE8CECBF0D56D89593
#include <boost/qvm/inline.hpp>
#include <boost/qvm/deduce_vec.hpp>
#include <boost/qvm/enable_if.hpp>
#include <boost/qvm/assert.hpp>
namespace
boost
{
namespace
qvm
{
namespace
qvm_detail
{
BOOST_QVM_INLINE_CRITICAL
void const *
get_null()
{
static int const obj=0;
return &obj;
}
template <int A,class Next=void> struct swizzle_idx { static int const value=A; typedef Next next; };
template <class V,int Idx>
struct
const_value
{
static
BOOST_QVM_INLINE_TRIVIAL
typename vec_traits<V>::scalar_type
value()
{
BOOST_QVM_ASSERT(0);
return typename vec_traits<V>::scalar_type();
}
};
template <class V>
struct
const_value<V,-1>
{
static
BOOST_QVM_INLINE_TRIVIAL
typename vec_traits<V>::scalar_type
value()
{
return scalar_traits<typename vec_traits<V>::scalar_type>::value(0);
}
};
template <class V>
struct
const_value<V,-2>
{
static
BOOST_QVM_INLINE_TRIVIAL
typename vec_traits<V>::scalar_type
value()
{
return scalar_traits<typename vec_traits<V>::scalar_type>::value(1);
}
};
template <int Index,bool Neg=(Index<0)>
struct neg_zero;
template <int Index>
struct
neg_zero<Index,true>
{
static int const value=0;
};
template <int Index>
struct
neg_zero<Index,false>
{
static int const value=Index;
};
template <class SwizzleList,int Index,int C=0>
struct
swizzle
{
static int const value=swizzle<typename SwizzleList::next,Index,C+1>::value;
};
template <class SwizzleList,int Match>
struct
swizzle<SwizzleList,Match,Match>
{
static int const value=SwizzleList::value;
};
template <int Index,int C>
struct swizzle<void,Index,C>;
template <class SwizzleList,int C=0>
struct
swizzle_list_length
{
static int const value=swizzle_list_length<typename SwizzleList::next,C+1>::value;
};
template <int C>
struct
swizzle_list_length<void,C>
{
static int const value=C;
};
template <class SwizzleList,int D>
struct
validate_swizzle_list
{
static bool const value =
((SwizzleList::value)<D) && //don't touch extra (), MSVC parsing bug.
validate_swizzle_list<typename SwizzleList::next,D>::value;
};
template <int D>
struct
validate_swizzle_list<void,D>
{
static bool const value=true;
};
template <class OriginalType,class SwizzleList>
class
sw_
{
sw_( sw_ const & );
sw_ & operator=( sw_ const & );
~sw_();
BOOST_QVM_STATIC_ASSERT((validate_swizzle_list<SwizzleList,vec_traits<OriginalType>::dim>::value));
public:
template <class T>
BOOST_QVM_INLINE_TRIVIAL
sw_ &
operator=( T const & x )
{
assign(*this,x);
return *this;
}
template <class R>
BOOST_QVM_INLINE_TRIVIAL
operator R() const
{
R r;
assign(r,*this);
return r;
}
};
template <class SwizzleList>
class
sw01_
{
sw01_( sw01_ const & );
sw01_ & operator=( sw01_ const & );
~sw01_();
public:
template <class R>
BOOST_QVM_INLINE_TRIVIAL
operator R() const
{
R r;
assign(r,*this);
return r;
}
};
template <class OriginalType,class SwizzleList>
class
sws_
{
sws_( sws_ const & );
sws_ & operator=( sws_ const & );
~sws_();
BOOST_QVM_STATIC_ASSERT((validate_swizzle_list<SwizzleList,1>::value));
public:
template <class R>
BOOST_QVM_INLINE_TRIVIAL
operator R() const
{
R r;
assign(r,*this);
return r;
}
};
}
template <class OriginalVector,class SwizzleList>
struct
vec_traits<qvm_detail::sw_<OriginalVector,SwizzleList> >
{
typedef qvm_detail::sw_<OriginalVector,SwizzleList> this_vector;
typedef typename vec_traits<OriginalVector>::scalar_type scalar_type;
static int const dim=qvm_detail::swizzle_list_length<SwizzleList>::value;
template <int I>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element( this_vector const & x )
{
BOOST_QVM_STATIC_ASSERT(I>=0);
BOOST_QVM_STATIC_ASSERT(I<dim);
int const idx=qvm_detail::swizzle<SwizzleList,I>::value;
BOOST_QVM_STATIC_ASSERT(idx<vec_traits<OriginalVector>::dim);
return idx>=0?
vec_traits<OriginalVector>::template read_element<qvm_detail::neg_zero<idx>::value>(reinterpret_cast<OriginalVector const &>(x)) :
qvm_detail::const_value<this_vector,idx>::value();
}
template <int I>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element( this_vector & x )
{
BOOST_QVM_STATIC_ASSERT(I>=0);
BOOST_QVM_STATIC_ASSERT(I<dim);
int const idx=qvm_detail::swizzle<SwizzleList,I>::value;
BOOST_QVM_STATIC_ASSERT(idx>=0);
BOOST_QVM_STATIC_ASSERT(idx<vec_traits<OriginalVector>::dim);
return vec_traits<OriginalVector>::template write_element<idx>(reinterpret_cast<OriginalVector &>(x));
}
};
template <class SwizzleList>
struct
vec_traits<qvm_detail::sw01_<SwizzleList> >
{
typedef qvm_detail::sw01_<SwizzleList> this_vector;
typedef int scalar_type;
static int const dim=qvm_detail::swizzle_list_length<SwizzleList>::value;
template <int I>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element( this_vector const & )
{
BOOST_QVM_STATIC_ASSERT(I>=0);
BOOST_QVM_STATIC_ASSERT(I<dim);
int const idx=qvm_detail::swizzle<SwizzleList,I>::value;
BOOST_QVM_STATIC_ASSERT(idx<0);
return qvm_detail::const_value<this_vector,idx>::value();
}
};
template <class OriginalScalar,class SwizzleList>
struct
vec_traits<qvm_detail::sws_<OriginalScalar,SwizzleList> >
{
typedef qvm_detail::sws_<OriginalScalar,SwizzleList> this_vector;
typedef OriginalScalar scalar_type;
static int const dim=qvm_detail::swizzle_list_length<SwizzleList>::value;
template <int I>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element( this_vector const & x )
{
BOOST_QVM_STATIC_ASSERT(I>=0);
BOOST_QVM_STATIC_ASSERT(I<dim);
int const idx=qvm_detail::swizzle<SwizzleList,I>::value;
BOOST_QVM_STATIC_ASSERT(idx<1);
return idx==0?
reinterpret_cast<OriginalScalar const &>(x) :
qvm_detail::const_value<this_vector,idx>::value();
}
template <int I>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element( this_vector & x )
{
BOOST_QVM_STATIC_ASSERT(I>=0);
BOOST_QVM_STATIC_ASSERT(I<dim);
int const idx=qvm_detail::swizzle<SwizzleList,I>::value;
BOOST_QVM_STATIC_ASSERT(idx==0);
return reinterpret_cast<OriginalScalar &>(x);
}
};
template <class OriginalVector,class SwizzleList,int D>
struct
deduce_vec<qvm_detail::sw_<OriginalVector,SwizzleList>,D>
{
typedef vec<typename vec_traits<OriginalVector>::scalar_type,D> type;
};
template <class OriginalVector,class SwizzleList,int D>
struct
deduce_vec2<qvm_detail::sw_<OriginalVector,SwizzleList>,qvm_detail::sw_<OriginalVector,SwizzleList>,D>
{
typedef vec<typename vec_traits<OriginalVector>::scalar_type,D> type;
};
template <class Scalar,class SwizzleList,int D>
struct
deduce_vec<qvm_detail::sws_<Scalar,SwizzleList>,D>
{
typedef vec<Scalar,D> type;
};
template <class Scalar,class SwizzleList,int D>
struct
deduce_vec2<qvm_detail::sws_<Scalar,SwizzleList>,qvm_detail::sws_<Scalar,SwizzleList>,D>
{
typedef vec<Scalar,D> type;
};
}
}
#endif
@@ -0,0 +1,128 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_B3B8081A277711E09E007F2DDFD72085
#define UUID_B3B8081A277711E09E007F2DDFD72085
#include <boost/qvm/deduce_mat.hpp>
#include <boost/qvm/static_assert.hpp>
#include <boost/qvm/assert.hpp>
namespace
boost
{
namespace
qvm
{
namespace
qvm_detail
{
template <class OriginalMatrix>
class
transposed_
{
transposed_( transposed_ const & );
transposed_ & operator=( transposed_ const & );
~transposed_();
public:
template <class T>
BOOST_QVM_INLINE_TRIVIAL
transposed_ &
operator=( T const & x )
{
assign(*this,x);
return *this;
}
template <class R>
BOOST_QVM_INLINE_TRIVIAL
operator R() const
{
R r;
assign(r,*this);
return r;
}
};
}
template <class OriginalMatrix>
struct
mat_traits< qvm_detail::transposed_<OriginalMatrix> >
{
typedef typename mat_traits<OriginalMatrix>::scalar_type scalar_type;
typedef qvm_detail::transposed_<OriginalMatrix> this_matrix;
static int const rows=mat_traits<OriginalMatrix>::cols;
static int const cols=mat_traits<OriginalMatrix>::rows;
template <int Row,int Col>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element( this_matrix const & x )
{
BOOST_QVM_STATIC_ASSERT(Row>=0);
BOOST_QVM_STATIC_ASSERT(Row<rows);
BOOST_QVM_STATIC_ASSERT(Col>=0);
BOOST_QVM_STATIC_ASSERT(Col<cols);
return mat_traits<OriginalMatrix>::template read_element<Col,Row>(reinterpret_cast<OriginalMatrix const &>(x));
}
template <int Row,int Col>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element( this_matrix & x )
{
BOOST_QVM_STATIC_ASSERT(Row>=0);
BOOST_QVM_STATIC_ASSERT(Row<rows);
BOOST_QVM_STATIC_ASSERT(Col>=0);
BOOST_QVM_STATIC_ASSERT(Col<cols);
return mat_traits<OriginalMatrix>::template write_element<Col,Row>(reinterpret_cast<OriginalMatrix &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element_idx( int row, int col, this_matrix const & x )
{
BOOST_QVM_ASSERT(row>=0);
BOOST_QVM_ASSERT(row<rows);
BOOST_QVM_ASSERT(col>=0);
BOOST_QVM_ASSERT(col<cols);
return mat_traits<OriginalMatrix>::read_element_idx(col,row,reinterpret_cast<OriginalMatrix const &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element_idx( int row, int col, this_matrix & x )
{
BOOST_QVM_ASSERT(row>=0);
BOOST_QVM_ASSERT(row<rows);
BOOST_QVM_ASSERT(col>=0);
BOOST_QVM_ASSERT(col<cols);
return mat_traits<OriginalMatrix>::write_element_idx(col,row,reinterpret_cast<OriginalMatrix &>(x));
}
};
template <class OriginalMatrix,int R,int C>
struct
deduce_mat<qvm_detail::transposed_<OriginalMatrix>,R,C>
{
typedef mat<typename mat_traits<OriginalMatrix>::scalar_type,R,C> type;
};
template <class OriginalMatrix,int R,int C>
struct
deduce_mat2<qvm_detail::transposed_<OriginalMatrix>,qvm_detail::transposed_<OriginalMatrix>,R,C>
{
typedef mat<typename mat_traits<OriginalMatrix>::scalar_type,R,C> type;
};
}
}
#endif
@@ -0,0 +1,24 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_A4FA0794391911DF85A6622B56D89593
#define UUID_A4FA0794391911DF85A6622B56D89593
#include <boost/utility/enable_if.hpp>
namespace
boost
{
namespace
qvm
{
using boost::enable_if;
using boost::enable_if_c;
using boost::lazy_enable_if;
using boost::lazy_enable_if_c;
}
}
#endif
@@ -0,0 +1,40 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_92B1247AAE1111DE9655F2FC55D89593
#define UUID_92B1247AAE1111DE9655F2FC55D89593
#include "boost/exception/exception.hpp"
#include "boost/exception/error_info.hpp"
#include <exception>
namespace
boost
{
namespace
qvm
{
struct
error:
virtual boost::exception,
virtual std::exception
{
char const *
what() const throw()
{
return "Boost QVM error";
}
~error() throw()
{
}
};
struct zero_determinant_error: virtual error { };
struct zero_magnitude_error: virtual error { };
}
}
#endif
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,714 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_QVM_61CDD11E9D9C167272E61DF0844F4A77
#define BOOST_QVM_61CDD11E9D9C167272E61DF0844F4A77
//This file was generated by a program. Do not edit manually.
#include <boost/qvm/detail/swizzle_traits.hpp>
#include <boost/qvm/enable_if.hpp>
#include <boost/qvm/inline.hpp>
namespace
boost
{
namespace
qvm
{
BOOST_QVM_INLINE_TRIVIAL
qvm_detail::sw01_<qvm_detail::swizzle_idx<-2,qvm_detail::swizzle_idx<-2 > > > const &
_11()
{
return *reinterpret_cast<qvm_detail::sw01_<qvm_detail::swizzle_idx<-2,qvm_detail::swizzle_idx<-2 > > > const *>(qvm_detail::get_null());
}
BOOST_QVM_INLINE_TRIVIAL
qvm_detail::sw01_<qvm_detail::swizzle_idx<-1,qvm_detail::swizzle_idx<-2 > > > const &
_01()
{
return *reinterpret_cast<qvm_detail::sw01_<qvm_detail::swizzle_idx<-1,qvm_detail::swizzle_idx<-2 > > > const *>(qvm_detail::get_null());
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=4,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<3,qvm_detail::swizzle_idx<-2 > > > const &>::type
W1( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<3,qvm_detail::swizzle_idx<-2 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=4,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<3,qvm_detail::swizzle_idx<-2 > > > &>::type
W1( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<3,qvm_detail::swizzle_idx<-2 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=3,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<2,qvm_detail::swizzle_idx<-2 > > > const &>::type
Z1( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<2,qvm_detail::swizzle_idx<-2 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=3,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<2,qvm_detail::swizzle_idx<-2 > > > &>::type
Z1( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<2,qvm_detail::swizzle_idx<-2 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=2,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<1,qvm_detail::swizzle_idx<-2 > > > const &>::type
Y1( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<1,qvm_detail::swizzle_idx<-2 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=2,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<1,qvm_detail::swizzle_idx<-2 > > > &>::type
Y1( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<1,qvm_detail::swizzle_idx<-2 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=1,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<-2 > > > const &>::type
X1( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<-2 > > > const &>(a);
}
template <class S>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_scalar<S>::value,
qvm_detail::sws_<S,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<-2 > > > const &>::type
X1( S const & a )
{
return reinterpret_cast<qvm_detail::sws_<S,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<-2 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=1,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<-2 > > > &>::type
X1( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<-2 > > > &>(a);
}
template <class S>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_scalar<S>::value,
qvm_detail::sws_<S,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<-2 > > > &>::type
X1( S & a )
{
return reinterpret_cast<qvm_detail::sws_<S,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<-2 > > > &>(a);
}
BOOST_QVM_INLINE_TRIVIAL
qvm_detail::sw01_<qvm_detail::swizzle_idx<-2,qvm_detail::swizzle_idx<-1 > > > const &
_10()
{
return *reinterpret_cast<qvm_detail::sw01_<qvm_detail::swizzle_idx<-2,qvm_detail::swizzle_idx<-1 > > > const *>(qvm_detail::get_null());
}
BOOST_QVM_INLINE_TRIVIAL
qvm_detail::sw01_<qvm_detail::swizzle_idx<-1,qvm_detail::swizzle_idx<-1 > > > const &
_00()
{
return *reinterpret_cast<qvm_detail::sw01_<qvm_detail::swizzle_idx<-1,qvm_detail::swizzle_idx<-1 > > > const *>(qvm_detail::get_null());
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=4,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<3,qvm_detail::swizzle_idx<-1 > > > const &>::type
W0( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<3,qvm_detail::swizzle_idx<-1 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=4,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<3,qvm_detail::swizzle_idx<-1 > > > &>::type
W0( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<3,qvm_detail::swizzle_idx<-1 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=3,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<2,qvm_detail::swizzle_idx<-1 > > > const &>::type
Z0( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<2,qvm_detail::swizzle_idx<-1 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=3,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<2,qvm_detail::swizzle_idx<-1 > > > &>::type
Z0( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<2,qvm_detail::swizzle_idx<-1 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=2,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<1,qvm_detail::swizzle_idx<-1 > > > const &>::type
Y0( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<1,qvm_detail::swizzle_idx<-1 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=2,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<1,qvm_detail::swizzle_idx<-1 > > > &>::type
Y0( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<1,qvm_detail::swizzle_idx<-1 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=1,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<-1 > > > const &>::type
X0( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<-1 > > > const &>(a);
}
template <class S>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_scalar<S>::value,
qvm_detail::sws_<S,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<-1 > > > const &>::type
X0( S const & a )
{
return reinterpret_cast<qvm_detail::sws_<S,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<-1 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=1,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<-1 > > > &>::type
X0( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<-1 > > > &>(a);
}
template <class S>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_scalar<S>::value,
qvm_detail::sws_<S,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<-1 > > > &>::type
X0( S & a )
{
return reinterpret_cast<qvm_detail::sws_<S,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<-1 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=4,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<-2,qvm_detail::swizzle_idx<3 > > > const &>::type
_1W( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<-2,qvm_detail::swizzle_idx<3 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=4,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<-2,qvm_detail::swizzle_idx<3 > > > &>::type
_1W( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<-2,qvm_detail::swizzle_idx<3 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=4,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<-1,qvm_detail::swizzle_idx<3 > > > const &>::type
_0W( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<-1,qvm_detail::swizzle_idx<3 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=4,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<-1,qvm_detail::swizzle_idx<3 > > > &>::type
_0W( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<-1,qvm_detail::swizzle_idx<3 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=4,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<3,qvm_detail::swizzle_idx<3 > > > const &>::type
WW( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<3,qvm_detail::swizzle_idx<3 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=4,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<3,qvm_detail::swizzle_idx<3 > > > &>::type
WW( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<3,qvm_detail::swizzle_idx<3 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=4,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<2,qvm_detail::swizzle_idx<3 > > > const &>::type
ZW( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<2,qvm_detail::swizzle_idx<3 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=4,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<2,qvm_detail::swizzle_idx<3 > > > &>::type
ZW( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<2,qvm_detail::swizzle_idx<3 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=4,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<1,qvm_detail::swizzle_idx<3 > > > const &>::type
YW( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<1,qvm_detail::swizzle_idx<3 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=4,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<1,qvm_detail::swizzle_idx<3 > > > &>::type
YW( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<1,qvm_detail::swizzle_idx<3 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=4,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<3 > > > const &>::type
XW( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<3 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=4,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<3 > > > &>::type
XW( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<3 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=3,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<-2,qvm_detail::swizzle_idx<2 > > > const &>::type
_1Z( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<-2,qvm_detail::swizzle_idx<2 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=3,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<-2,qvm_detail::swizzle_idx<2 > > > &>::type
_1Z( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<-2,qvm_detail::swizzle_idx<2 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=3,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<-1,qvm_detail::swizzle_idx<2 > > > const &>::type
_0Z( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<-1,qvm_detail::swizzle_idx<2 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=3,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<-1,qvm_detail::swizzle_idx<2 > > > &>::type
_0Z( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<-1,qvm_detail::swizzle_idx<2 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=4,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<3,qvm_detail::swizzle_idx<2 > > > const &>::type
WZ( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<3,qvm_detail::swizzle_idx<2 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=4,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<3,qvm_detail::swizzle_idx<2 > > > &>::type
WZ( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<3,qvm_detail::swizzle_idx<2 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=3,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<2,qvm_detail::swizzle_idx<2 > > > const &>::type
ZZ( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<2,qvm_detail::swizzle_idx<2 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=3,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<2,qvm_detail::swizzle_idx<2 > > > &>::type
ZZ( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<2,qvm_detail::swizzle_idx<2 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=3,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<1,qvm_detail::swizzle_idx<2 > > > const &>::type
YZ( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<1,qvm_detail::swizzle_idx<2 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=3,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<1,qvm_detail::swizzle_idx<2 > > > &>::type
YZ( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<1,qvm_detail::swizzle_idx<2 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=3,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<2 > > > const &>::type
XZ( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<2 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=3,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<2 > > > &>::type
XZ( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<2 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=2,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<-2,qvm_detail::swizzle_idx<1 > > > const &>::type
_1Y( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<-2,qvm_detail::swizzle_idx<1 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=2,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<-2,qvm_detail::swizzle_idx<1 > > > &>::type
_1Y( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<-2,qvm_detail::swizzle_idx<1 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=2,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<-1,qvm_detail::swizzle_idx<1 > > > const &>::type
_0Y( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<-1,qvm_detail::swizzle_idx<1 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=2,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<-1,qvm_detail::swizzle_idx<1 > > > &>::type
_0Y( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<-1,qvm_detail::swizzle_idx<1 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=4,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<3,qvm_detail::swizzle_idx<1 > > > const &>::type
WY( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<3,qvm_detail::swizzle_idx<1 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=4,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<3,qvm_detail::swizzle_idx<1 > > > &>::type
WY( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<3,qvm_detail::swizzle_idx<1 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=3,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<2,qvm_detail::swizzle_idx<1 > > > const &>::type
ZY( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<2,qvm_detail::swizzle_idx<1 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=3,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<2,qvm_detail::swizzle_idx<1 > > > &>::type
ZY( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<2,qvm_detail::swizzle_idx<1 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=2,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<1,qvm_detail::swizzle_idx<1 > > > const &>::type
YY( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<1,qvm_detail::swizzle_idx<1 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=2,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<1,qvm_detail::swizzle_idx<1 > > > &>::type
YY( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<1,qvm_detail::swizzle_idx<1 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=2,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<1 > > > const &>::type
XY( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<1 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=2,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<1 > > > &>::type
XY( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<1 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=1,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<-2,qvm_detail::swizzle_idx<0 > > > const &>::type
_1X( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<-2,qvm_detail::swizzle_idx<0 > > > const &>(a);
}
template <class S>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_scalar<S>::value,
qvm_detail::sws_<S,qvm_detail::swizzle_idx<-2,qvm_detail::swizzle_idx<0 > > > const &>::type
_1X( S const & a )
{
return reinterpret_cast<qvm_detail::sws_<S,qvm_detail::swizzle_idx<-2,qvm_detail::swizzle_idx<0 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=1,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<-2,qvm_detail::swizzle_idx<0 > > > &>::type
_1X( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<-2,qvm_detail::swizzle_idx<0 > > > &>(a);
}
template <class S>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_scalar<S>::value,
qvm_detail::sws_<S,qvm_detail::swizzle_idx<-2,qvm_detail::swizzle_idx<0 > > > &>::type
_1X( S & a )
{
return reinterpret_cast<qvm_detail::sws_<S,qvm_detail::swizzle_idx<-2,qvm_detail::swizzle_idx<0 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=1,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<-1,qvm_detail::swizzle_idx<0 > > > const &>::type
_0X( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<-1,qvm_detail::swizzle_idx<0 > > > const &>(a);
}
template <class S>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_scalar<S>::value,
qvm_detail::sws_<S,qvm_detail::swizzle_idx<-1,qvm_detail::swizzle_idx<0 > > > const &>::type
_0X( S const & a )
{
return reinterpret_cast<qvm_detail::sws_<S,qvm_detail::swizzle_idx<-1,qvm_detail::swizzle_idx<0 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=1,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<-1,qvm_detail::swizzle_idx<0 > > > &>::type
_0X( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<-1,qvm_detail::swizzle_idx<0 > > > &>(a);
}
template <class S>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_scalar<S>::value,
qvm_detail::sws_<S,qvm_detail::swizzle_idx<-1,qvm_detail::swizzle_idx<0 > > > &>::type
_0X( S & a )
{
return reinterpret_cast<qvm_detail::sws_<S,qvm_detail::swizzle_idx<-1,qvm_detail::swizzle_idx<0 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=4,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<3,qvm_detail::swizzle_idx<0 > > > const &>::type
WX( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<3,qvm_detail::swizzle_idx<0 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=4,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<3,qvm_detail::swizzle_idx<0 > > > &>::type
WX( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<3,qvm_detail::swizzle_idx<0 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=3,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<2,qvm_detail::swizzle_idx<0 > > > const &>::type
ZX( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<2,qvm_detail::swizzle_idx<0 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=3,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<2,qvm_detail::swizzle_idx<0 > > > &>::type
ZX( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<2,qvm_detail::swizzle_idx<0 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=2,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<1,qvm_detail::swizzle_idx<0 > > > const &>::type
YX( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<1,qvm_detail::swizzle_idx<0 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=2,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<1,qvm_detail::swizzle_idx<0 > > > &>::type
YX( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<1,qvm_detail::swizzle_idx<0 > > > &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=1,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<0 > > > const &>::type
XX( V const & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<0 > > > const &>(a);
}
template <class S>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_scalar<S>::value,
qvm_detail::sws_<S,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<0 > > > const &>::type
XX( S const & a )
{
return reinterpret_cast<qvm_detail::sws_<S,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<0 > > > const &>(a);
}
template <class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value && vec_traits<V>::dim>=1,
qvm_detail::sw_<V,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<0 > > > &>::type
XX( V & a )
{
return reinterpret_cast<qvm_detail::sw_<V,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<0 > > > &>(a);
}
template <class S>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_scalar<S>::value,
qvm_detail::sws_<S,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<0 > > > &>::type
XX( S & a )
{
return reinterpret_cast<qvm_detail::sws_<S,qvm_detail::swizzle_idx<0,qvm_detail::swizzle_idx<0 > > > &>(a);
}
}
}
#endif
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,113 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_QVM_F622919DE18B1FDAB0CA992B9729D49
#define BOOST_QVM_F622919DE18B1FDAB0CA992B9729D49
//This file was generated by a program. Do not edit manually.
#include <boost/qvm/deduce_vec.hpp>
#include <boost/qvm/enable_if.hpp>
#include <boost/qvm/inline.hpp>
#include <boost/qvm/mat_traits.hpp>
namespace
boost
{
namespace
qvm
{
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
mat_traits<A>::rows==2 && mat_traits<A>::cols==2 &&
vec_traits<B>::dim==2,
deduce_vec2<A,B,2> >::type
operator*( A const & a, B const & b )
{
typedef typename mat_traits<A>::scalar_type Ta;
typedef typename vec_traits<B>::scalar_type Tb;
Ta const a00 = mat_traits<A>::template read_element<0,0>(a);
Ta const a01 = mat_traits<A>::template read_element<0,1>(a);
Ta const a10 = mat_traits<A>::template read_element<1,0>(a);
Ta const a11 = mat_traits<A>::template read_element<1,1>(a);
Tb const b0 = vec_traits<B>::template read_element<0>(b);
Tb const b1 = vec_traits<B>::template read_element<1>(b);
typedef typename deduce_vec2<A,B,2>::type R;
BOOST_QVM_STATIC_ASSERT(vec_traits<R>::dim==2);
R r;
vec_traits<R>::template write_element<0>(r)=a00*b0+a01*b1;
vec_traits<R>::template write_element<1>(r)=a10*b0+a11*b1;
return r;
}
namespace
sfinae
{
using ::boost::qvm::operator*;
}
namespace
qvm_detail
{
template <int R,int C>
struct mul_mv_defined;
template <>
struct
mul_mv_defined<2,2>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
mat_traits<B>::rows==2 && mat_traits<B>::cols==2 &&
vec_traits<A>::dim==2,
deduce_vec2<A,B,2> >::type
operator*( A const & a, B const & b )
{
typedef typename vec_traits<A>::scalar_type Ta;
typedef typename mat_traits<B>::scalar_type Tb;
Ta const a0 = vec_traits<A>::template read_element<0>(a);
Ta const a1 = vec_traits<A>::template read_element<1>(a);
Tb const b00 = mat_traits<B>::template read_element<0,0>(b);
Tb const b01 = mat_traits<B>::template read_element<0,1>(b);
Tb const b10 = mat_traits<B>::template read_element<1,0>(b);
Tb const b11 = mat_traits<B>::template read_element<1,1>(b);
typedef typename deduce_vec2<A,B,2>::type R;
BOOST_QVM_STATIC_ASSERT(vec_traits<R>::dim==2);
R r;
vec_traits<R>::template write_element<0>(r)=a0*b00+a1*b10;
vec_traits<R>::template write_element<1>(r)=a0*b01+a1*b11;
return r;
}
namespace
sfinae
{
using ::boost::qvm::operator*;
}
namespace
qvm_detail
{
template <int R,int C>
struct mul_vm_defined;
template <>
struct
mul_vm_defined<2,2>
{
static bool const value=true;
};
}
}
}
#endif
@@ -0,0 +1,127 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_QVM_2C807EC599D5E980B2EAC9CC53BF67D6
#define BOOST_QVM_2C807EC599D5E980B2EAC9CC53BF67D6
//This file was generated by a program. Do not edit manually.
#include <boost/qvm/deduce_vec.hpp>
#include <boost/qvm/enable_if.hpp>
#include <boost/qvm/inline.hpp>
#include <boost/qvm/mat_traits.hpp>
namespace
boost
{
namespace
qvm
{
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
mat_traits<A>::rows==3 && mat_traits<A>::cols==3 &&
vec_traits<B>::dim==3,
deduce_vec2<A,B,3> >::type
operator*( A const & a, B const & b )
{
typedef typename mat_traits<A>::scalar_type Ta;
typedef typename vec_traits<B>::scalar_type Tb;
Ta const a00 = mat_traits<A>::template read_element<0,0>(a);
Ta const a01 = mat_traits<A>::template read_element<0,1>(a);
Ta const a02 = mat_traits<A>::template read_element<0,2>(a);
Ta const a10 = mat_traits<A>::template read_element<1,0>(a);
Ta const a11 = mat_traits<A>::template read_element<1,1>(a);
Ta const a12 = mat_traits<A>::template read_element<1,2>(a);
Ta const a20 = mat_traits<A>::template read_element<2,0>(a);
Ta const a21 = mat_traits<A>::template read_element<2,1>(a);
Ta const a22 = mat_traits<A>::template read_element<2,2>(a);
Tb const b0 = vec_traits<B>::template read_element<0>(b);
Tb const b1 = vec_traits<B>::template read_element<1>(b);
Tb const b2 = vec_traits<B>::template read_element<2>(b);
typedef typename deduce_vec2<A,B,3>::type R;
BOOST_QVM_STATIC_ASSERT(vec_traits<R>::dim==3);
R r;
vec_traits<R>::template write_element<0>(r)=a00*b0+a01*b1+a02*b2;
vec_traits<R>::template write_element<1>(r)=a10*b0+a11*b1+a12*b2;
vec_traits<R>::template write_element<2>(r)=a20*b0+a21*b1+a22*b2;
return r;
}
namespace
sfinae
{
using ::boost::qvm::operator*;
}
namespace
qvm_detail
{
template <int R,int C>
struct mul_mv_defined;
template <>
struct
mul_mv_defined<3,3>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
mat_traits<B>::rows==3 && mat_traits<B>::cols==3 &&
vec_traits<A>::dim==3,
deduce_vec2<A,B,3> >::type
operator*( A const & a, B const & b )
{
typedef typename vec_traits<A>::scalar_type Ta;
typedef typename mat_traits<B>::scalar_type Tb;
Ta const a0 = vec_traits<A>::template read_element<0>(a);
Ta const a1 = vec_traits<A>::template read_element<1>(a);
Ta const a2 = vec_traits<A>::template read_element<2>(a);
Tb const b00 = mat_traits<B>::template read_element<0,0>(b);
Tb const b01 = mat_traits<B>::template read_element<0,1>(b);
Tb const b02 = mat_traits<B>::template read_element<0,2>(b);
Tb const b10 = mat_traits<B>::template read_element<1,0>(b);
Tb const b11 = mat_traits<B>::template read_element<1,1>(b);
Tb const b12 = mat_traits<B>::template read_element<1,2>(b);
Tb const b20 = mat_traits<B>::template read_element<2,0>(b);
Tb const b21 = mat_traits<B>::template read_element<2,1>(b);
Tb const b22 = mat_traits<B>::template read_element<2,2>(b);
typedef typename deduce_vec2<A,B,3>::type R;
BOOST_QVM_STATIC_ASSERT(vec_traits<R>::dim==3);
R r;
vec_traits<R>::template write_element<0>(r)=a0*b00+a1*b10+a2*b20;
vec_traits<R>::template write_element<1>(r)=a0*b01+a1*b11+a2*b21;
vec_traits<R>::template write_element<2>(r)=a0*b02+a1*b12+a2*b22;
return r;
}
namespace
sfinae
{
using ::boost::qvm::operator*;
}
namespace
qvm_detail
{
template <int R,int C>
struct mul_vm_defined;
template <>
struct
mul_vm_defined<3,3>
{
static bool const value=true;
};
}
}
}
#endif
@@ -0,0 +1,145 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_QVM_BF14D67E2DDC8E6683EF574961FF698F
#define BOOST_QVM_BF14D67E2DDC8E6683EF574961FF698F
//This file was generated by a program. Do not edit manually.
#include <boost/qvm/deduce_vec.hpp>
#include <boost/qvm/enable_if.hpp>
#include <boost/qvm/inline.hpp>
#include <boost/qvm/mat_traits.hpp>
namespace
boost
{
namespace
qvm
{
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
mat_traits<A>::rows==4 && mat_traits<A>::cols==4 &&
vec_traits<B>::dim==4,
deduce_vec2<A,B,4> >::type
operator*( A const & a, B const & b )
{
typedef typename mat_traits<A>::scalar_type Ta;
typedef typename vec_traits<B>::scalar_type Tb;
Ta const a00 = mat_traits<A>::template read_element<0,0>(a);
Ta const a01 = mat_traits<A>::template read_element<0,1>(a);
Ta const a02 = mat_traits<A>::template read_element<0,2>(a);
Ta const a03 = mat_traits<A>::template read_element<0,3>(a);
Ta const a10 = mat_traits<A>::template read_element<1,0>(a);
Ta const a11 = mat_traits<A>::template read_element<1,1>(a);
Ta const a12 = mat_traits<A>::template read_element<1,2>(a);
Ta const a13 = mat_traits<A>::template read_element<1,3>(a);
Ta const a20 = mat_traits<A>::template read_element<2,0>(a);
Ta const a21 = mat_traits<A>::template read_element<2,1>(a);
Ta const a22 = mat_traits<A>::template read_element<2,2>(a);
Ta const a23 = mat_traits<A>::template read_element<2,3>(a);
Ta const a30 = mat_traits<A>::template read_element<3,0>(a);
Ta const a31 = mat_traits<A>::template read_element<3,1>(a);
Ta const a32 = mat_traits<A>::template read_element<3,2>(a);
Ta const a33 = mat_traits<A>::template read_element<3,3>(a);
Tb const b0 = vec_traits<B>::template read_element<0>(b);
Tb const b1 = vec_traits<B>::template read_element<1>(b);
Tb const b2 = vec_traits<B>::template read_element<2>(b);
Tb const b3 = vec_traits<B>::template read_element<3>(b);
typedef typename deduce_vec2<A,B,4>::type R;
BOOST_QVM_STATIC_ASSERT(vec_traits<R>::dim==4);
R r;
vec_traits<R>::template write_element<0>(r)=a00*b0+a01*b1+a02*b2+a03*b3;
vec_traits<R>::template write_element<1>(r)=a10*b0+a11*b1+a12*b2+a13*b3;
vec_traits<R>::template write_element<2>(r)=a20*b0+a21*b1+a22*b2+a23*b3;
vec_traits<R>::template write_element<3>(r)=a30*b0+a31*b1+a32*b2+a33*b3;
return r;
}
namespace
sfinae
{
using ::boost::qvm::operator*;
}
namespace
qvm_detail
{
template <int R,int C>
struct mul_mv_defined;
template <>
struct
mul_mv_defined<4,4>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
mat_traits<B>::rows==4 && mat_traits<B>::cols==4 &&
vec_traits<A>::dim==4,
deduce_vec2<A,B,4> >::type
operator*( A const & a, B const & b )
{
typedef typename vec_traits<A>::scalar_type Ta;
typedef typename mat_traits<B>::scalar_type Tb;
Ta const a0 = vec_traits<A>::template read_element<0>(a);
Ta const a1 = vec_traits<A>::template read_element<1>(a);
Ta const a2 = vec_traits<A>::template read_element<2>(a);
Ta const a3 = vec_traits<A>::template read_element<3>(a);
Tb const b00 = mat_traits<B>::template read_element<0,0>(b);
Tb const b01 = mat_traits<B>::template read_element<0,1>(b);
Tb const b02 = mat_traits<B>::template read_element<0,2>(b);
Tb const b03 = mat_traits<B>::template read_element<0,3>(b);
Tb const b10 = mat_traits<B>::template read_element<1,0>(b);
Tb const b11 = mat_traits<B>::template read_element<1,1>(b);
Tb const b12 = mat_traits<B>::template read_element<1,2>(b);
Tb const b13 = mat_traits<B>::template read_element<1,3>(b);
Tb const b20 = mat_traits<B>::template read_element<2,0>(b);
Tb const b21 = mat_traits<B>::template read_element<2,1>(b);
Tb const b22 = mat_traits<B>::template read_element<2,2>(b);
Tb const b23 = mat_traits<B>::template read_element<2,3>(b);
Tb const b30 = mat_traits<B>::template read_element<3,0>(b);
Tb const b31 = mat_traits<B>::template read_element<3,1>(b);
Tb const b32 = mat_traits<B>::template read_element<3,2>(b);
Tb const b33 = mat_traits<B>::template read_element<3,3>(b);
typedef typename deduce_vec2<A,B,4>::type R;
BOOST_QVM_STATIC_ASSERT(vec_traits<R>::dim==4);
R r;
vec_traits<R>::template write_element<0>(r)=a0*b00+a1*b10+a2*b20+a3*b30;
vec_traits<R>::template write_element<1>(r)=a0*b01+a1*b11+a2*b21+a3*b31;
vec_traits<R>::template write_element<2>(r)=a0*b02+a1*b12+a2*b22+a3*b32;
vec_traits<R>::template write_element<3>(r)=a0*b03+a1*b13+a2*b23+a3*b33;
return r;
}
namespace
sfinae
{
using ::boost::qvm::operator*;
}
namespace
qvm_detail
{
template <int R,int C>
struct mul_vm_defined;
template <>
struct
mul_vm_defined<4,4>
{
static bool const value=true;
};
}
}
}
#endif
@@ -0,0 +1,666 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_QVM_5DD4CBFC96F5453B13D89A1CDBAE32
#define BOOST_QVM_5DD4CBFC96F5453B13D89A1CDBAE32
//This file was generated by a program. Do not edit manually.
#include <boost/qvm/deduce_scalar.hpp>
#include <boost/qvm/deduce_vec.hpp>
#include <boost/qvm/enable_if.hpp>
#include <boost/qvm/error.hpp>
#include <boost/qvm/inline.hpp>
#include <boost/qvm/math.hpp>
#include <boost/qvm/static_assert.hpp>
#include <boost/qvm/throw_exception.hpp>
#include <boost/qvm/vec_traits.hpp>
namespace
boost
{
namespace
qvm
{
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
vec_traits<A>::dim==2 && vec_traits<B>::dim==2,
deduce_vec2<A,B,2> >::type
operator+( A const & a, B const & b )
{
typedef typename deduce_vec2<A,B,2>::type R;
BOOST_QVM_STATIC_ASSERT(vec_traits<R>::dim==2);
R r;
vec_traits<R>::template write_element<0>(r)=vec_traits<A>::template read_element<0>(a)+vec_traits<B>::template read_element<0>(b);
vec_traits<R>::template write_element<1>(r)=vec_traits<A>::template read_element<1>(a)+vec_traits<B>::template read_element<1>(b);
return r;
}
namespace
sfinae
{
using ::boost::qvm::operator+;
}
namespace
qvm_detail
{
template <int D>
struct plus_vv_defined;
template <>
struct
plus_vv_defined<2>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
vec_traits<A>::dim==2 && vec_traits<B>::dim==2,
deduce_vec2<A,B,2> >::type
operator-( A const & a, B const & b )
{
typedef typename deduce_vec2<A,B,2>::type R;
BOOST_QVM_STATIC_ASSERT(vec_traits<R>::dim==2);
R r;
vec_traits<R>::template write_element<0>(r)=vec_traits<A>::template read_element<0>(a)-vec_traits<B>::template read_element<0>(b);
vec_traits<R>::template write_element<1>(r)=vec_traits<A>::template read_element<1>(a)-vec_traits<B>::template read_element<1>(b);
return r;
}
namespace
sfinae
{
using ::boost::qvm::operator-;
}
namespace
qvm_detail
{
template <int D>
struct minus_vv_defined;
template <>
struct
minus_vv_defined<2>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
vec_traits<A>::dim==2 && vec_traits<B>::dim==2,
A &>::type
operator+=( A & a, B const & b )
{
vec_traits<A>::template write_element<0>(a)+=vec_traits<B>::template read_element<0>(b);
vec_traits<A>::template write_element<1>(a)+=vec_traits<B>::template read_element<1>(b);
return a;
}
namespace
sfinae
{
using ::boost::qvm::operator+=;
}
namespace
qvm_detail
{
template <int D>
struct plus_eq_vv_defined;
template <>
struct
plus_eq_vv_defined<2>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
vec_traits<A>::dim==2 && vec_traits<B>::dim==2,
A &>::type
operator-=( A & a, B const & b )
{
vec_traits<A>::template write_element<0>(a)-=vec_traits<B>::template read_element<0>(b);
vec_traits<A>::template write_element<1>(a)-=vec_traits<B>::template read_element<1>(b);
return a;
}
namespace
sfinae
{
using ::boost::qvm::operator-=;
}
namespace
qvm_detail
{
template <int D>
struct minus_eq_vv_defined;
template <>
struct
minus_eq_vv_defined<2>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
vec_traits<A>::dim==2 && is_scalar<B>::value,
deduce_vec<A> >::type
operator*( A const & a, B b )
{
typedef typename deduce_vec<A>::type R;
R r;
vec_traits<R>::template write_element<0>(r)=vec_traits<A>::template read_element<0>(a)*b;
vec_traits<R>::template write_element<1>(r)=vec_traits<A>::template read_element<1>(a)*b;
return r;
}
namespace
sfinae
{
using ::boost::qvm::operator*;
}
namespace
qvm_detail
{
template <int D>
struct mul_vs_defined;
template <>
struct
mul_vs_defined<2>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
is_scalar<A>::value && vec_traits<B>::dim==2,
deduce_vec<B> >::type
operator*( A a, B const & b )
{
typedef typename deduce_vec<B>::type R;
R r;
vec_traits<R>::template write_element<0>(r)=a*vec_traits<B>::template read_element<0>(b);
vec_traits<R>::template write_element<1>(r)=a*vec_traits<B>::template read_element<1>(b);
return r;
}
namespace
sfinae
{
using ::boost::qvm::operator*;
}
namespace
qvm_detail
{
template <int D>
struct mul_sv_defined;
template <>
struct
mul_sv_defined<2>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
vec_traits<A>::dim==2 && is_scalar<B>::value,
A &>::type
operator*=( A & a, B b )
{
vec_traits<A>::template write_element<0>(a)*=b;
vec_traits<A>::template write_element<1>(a)*=b;
return a;
}
namespace
sfinae
{
using ::boost::qvm::operator*=;
}
namespace
qvm_detail
{
template <int D>
struct mul_eq_vs_defined;
template <>
struct
mul_eq_vs_defined<2>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
vec_traits<A>::dim==2 && is_scalar<B>::value,
deduce_vec<A> >::type
operator/( A const & a, B b )
{
typedef typename deduce_vec<A>::type R;
R r;
vec_traits<R>::template write_element<0>(r)=vec_traits<A>::template read_element<0>(a)/b;
vec_traits<R>::template write_element<1>(r)=vec_traits<A>::template read_element<1>(a)/b;
return r;
}
namespace
sfinae
{
using ::boost::qvm::operator/;
}
namespace
qvm_detail
{
template <int D>
struct div_vs_defined;
template <>
struct
div_vs_defined<2>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
vec_traits<A>::dim==2 && is_scalar<B>::value,
A &>::type
operator/=( A & a, B b )
{
vec_traits<A>::template write_element<0>(a)/=b;
vec_traits<A>::template write_element<1>(a)/=b;
return a;
}
namespace
sfinae
{
using ::boost::qvm::operator/=;
}
namespace
qvm_detail
{
template <int D>
struct div_eq_vs_defined;
template <>
struct
div_eq_vs_defined<2>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
vec_traits<A>::dim==2 && vec_traits<B>::dim==2,
A &>::type
assign( A & a, B const & b )
{
vec_traits<A>::template write_element<0>(a)=vec_traits<B>::template read_element<0>(b);
vec_traits<A>::template write_element<1>(a)=vec_traits<B>::template read_element<1>(b);
return a;
}
namespace
sfinae
{
using ::boost::qvm::assign;
}
namespace
qvm_detail
{
template <int D>
struct assign_vv_defined;
template <>
struct
assign_vv_defined<2>
{
static bool const value=true;
};
}
template <class R,class A>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
is_vec<A>::value &&
vec_traits<R>::dim==2 && vec_traits<A>::dim==2,
R>::type
convert_to( A const & a )
{
R r;
vec_traits<R>::template write_element<0>(r)=vec_traits<A>::template read_element<0>(a);
vec_traits<R>::template write_element<1>(r)=vec_traits<A>::template read_element<1>(a);
return r;
}
namespace
sfinae
{
using ::boost::qvm::convert_to;
}
namespace
qvm_detail
{
template <int D>
struct convert_to_v_defined;
template <>
struct
convert_to_v_defined<2>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
vec_traits<A>::dim==2 && vec_traits<B>::dim==2,
bool>::type
operator==( A const & a, B const & b )
{
return
vec_traits<A>::template read_element<0>(a)==vec_traits<B>::template read_element<0>(b) &&
vec_traits<A>::template read_element<1>(a)==vec_traits<B>::template read_element<1>(b);
}
namespace
sfinae
{
using ::boost::qvm::operator==;
}
namespace
qvm_detail
{
template <int D>
struct eq_vv_defined;
template <>
struct
eq_vv_defined<2>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
vec_traits<A>::dim==2 && vec_traits<B>::dim==2,
bool>::type
operator!=( A const & a, B const & b )
{
return
!(vec_traits<A>::template read_element<0>(a)==vec_traits<B>::template read_element<0>(b)) ||
!(vec_traits<A>::template read_element<1>(a)==vec_traits<B>::template read_element<1>(b));
}
namespace
sfinae
{
using ::boost::qvm::operator!=;
}
namespace
qvm_detail
{
template <int D>
struct neq_vv_defined;
template <>
struct
neq_vv_defined<2>
{
static bool const value=true;
};
}
template <class A>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
vec_traits<A>::dim==2,
deduce_vec<A> >::type
operator-( A const & a )
{
typedef typename deduce_vec<A>::type R;
R r;
vec_traits<R>::template write_element<0>(r)=-vec_traits<A>::template read_element<0>(a);
vec_traits<R>::template write_element<1>(r)=-vec_traits<A>::template read_element<1>(a);
return r;
}
namespace
sfinae
{
using ::boost::qvm::operator-;
}
namespace
qvm_detail
{
template <int D>
struct minus_v_defined;
template <>
struct
minus_v_defined<2>
{
static bool const value=true;
};
}
template <class A>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
is_vec<A>::value && vec_traits<A>::dim==2,
typename vec_traits<A>::scalar_type>::type
mag( A const & a )
{
typedef typename vec_traits<A>::scalar_type T;
T const a0=vec_traits<A>::template read_element<0>(a);
T const a1=vec_traits<A>::template read_element<1>(a);
T const m2=a0*a0+a1*a1;
T const mag=sqrt<T>(m2);
return mag;
}
namespace
sfinae
{
using ::boost::qvm::mag;
}
namespace
qvm_detail
{
template <int D>
struct mag_v_defined;
template <>
struct
mag_v_defined<2>
{
static bool const value=true;
};
}
template <class A>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
is_vec<A>::value && vec_traits<A>::dim==2,
typename vec_traits<A>::scalar_type>::type
mag_sqr( A const & a )
{
typedef typename vec_traits<A>::scalar_type T;
T const a0=vec_traits<A>::template read_element<0>(a);
T const a1=vec_traits<A>::template read_element<1>(a);
T const m2=a0*a0+a1*a1;
return m2;
}
namespace
sfinae
{
using ::boost::qvm::mag_sqr;
}
namespace
qvm_detail
{
template <int D>
struct mag_sqr_v_defined;
template <>
struct
mag_sqr_v_defined<2>
{
static bool const value=true;
};
}
template <class A>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
vec_traits<A>::dim==2,
deduce_vec<A> >::type
normalized( A const & a )
{
typedef typename vec_traits<A>::scalar_type T;
T const a0=vec_traits<A>::template read_element<0>(a);
T const a1=vec_traits<A>::template read_element<1>(a);
T const m2=a0*a0+a1*a1;
if( m2==scalar_traits<typename vec_traits<A>::scalar_type>::value(0) )
BOOST_QVM_THROW_EXCEPTION(zero_magnitude_error());
T const rm=scalar_traits<T>::value(1)/sqrt<T>(m2);
typedef typename deduce_vec<A>::type R;
R r;
vec_traits<R>::template write_element<0>(r)=a0*rm;
vec_traits<R>::template write_element<1>(r)=a1*rm;
return r;
}
namespace
sfinae
{
using ::boost::qvm::normalized;
}
template <class A>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
vec_traits<A>::dim==2,
void>::type
normalize( A & a )
{
typedef typename vec_traits<A>::scalar_type T;
T const a0=vec_traits<A>::template read_element<0>(a);
T const a1=vec_traits<A>::template read_element<1>(a);
T const m2=a0*a0+a1*a1;
if( m2==scalar_traits<typename vec_traits<A>::scalar_type>::value(0) )
BOOST_QVM_THROW_EXCEPTION(zero_magnitude_error());
T const rm=scalar_traits<T>::value(1)/sqrt<T>(m2);
vec_traits<A>::template write_element<0>(a)*=rm;
vec_traits<A>::template write_element<1>(a)*=rm;
}
namespace
sfinae
{
using ::boost::qvm::normalize;
}
namespace
qvm_detail
{
template <int D>
struct normalize_v_defined;
template <>
struct
normalize_v_defined<2>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
vec_traits<A>::dim==2 && vec_traits<B>::dim==2,
deduce_scalar<typename vec_traits<A>::scalar_type,typename vec_traits<B>::scalar_type> >::type
dot( A const & a, B const & b )
{
typedef typename vec_traits<A>::scalar_type Ta;
typedef typename vec_traits<B>::scalar_type Tb;
typedef typename deduce_scalar<Ta,Tb>::type Tr;
Ta const a0=vec_traits<A>::template read_element<0>(a);
Ta const a1=vec_traits<A>::template read_element<1>(a);
Tb const b0=vec_traits<B>::template read_element<0>(b);
Tb const b1=vec_traits<B>::template read_element<1>(b);
Tr const dot=a0*b0+a1*b1;
return dot;
}
namespace
sfinae
{
using ::boost::qvm::dot;
}
namespace
qvm_detail
{
template <int D>
struct dot_vv_defined;
template <>
struct
dot_vv_defined<2>
{
static bool const value=true;
};
}
}
}
#endif
@@ -0,0 +1,688 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_QVM_209A50EE407836FD124932F69E7D49DC
#define BOOST_QVM_209A50EE407836FD124932F69E7D49DC
//This file was generated by a program. Do not edit manually.
#include <boost/qvm/deduce_scalar.hpp>
#include <boost/qvm/deduce_vec.hpp>
#include <boost/qvm/enable_if.hpp>
#include <boost/qvm/error.hpp>
#include <boost/qvm/inline.hpp>
#include <boost/qvm/math.hpp>
#include <boost/qvm/static_assert.hpp>
#include <boost/qvm/throw_exception.hpp>
#include <boost/qvm/vec_traits.hpp>
namespace
boost
{
namespace
qvm
{
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
vec_traits<A>::dim==3 && vec_traits<B>::dim==3,
deduce_vec2<A,B,3> >::type
operator+( A const & a, B const & b )
{
typedef typename deduce_vec2<A,B,3>::type R;
BOOST_QVM_STATIC_ASSERT(vec_traits<R>::dim==3);
R r;
vec_traits<R>::template write_element<0>(r)=vec_traits<A>::template read_element<0>(a)+vec_traits<B>::template read_element<0>(b);
vec_traits<R>::template write_element<1>(r)=vec_traits<A>::template read_element<1>(a)+vec_traits<B>::template read_element<1>(b);
vec_traits<R>::template write_element<2>(r)=vec_traits<A>::template read_element<2>(a)+vec_traits<B>::template read_element<2>(b);
return r;
}
namespace
sfinae
{
using ::boost::qvm::operator+;
}
namespace
qvm_detail
{
template <int D>
struct plus_vv_defined;
template <>
struct
plus_vv_defined<3>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
vec_traits<A>::dim==3 && vec_traits<B>::dim==3,
deduce_vec2<A,B,3> >::type
operator-( A const & a, B const & b )
{
typedef typename deduce_vec2<A,B,3>::type R;
BOOST_QVM_STATIC_ASSERT(vec_traits<R>::dim==3);
R r;
vec_traits<R>::template write_element<0>(r)=vec_traits<A>::template read_element<0>(a)-vec_traits<B>::template read_element<0>(b);
vec_traits<R>::template write_element<1>(r)=vec_traits<A>::template read_element<1>(a)-vec_traits<B>::template read_element<1>(b);
vec_traits<R>::template write_element<2>(r)=vec_traits<A>::template read_element<2>(a)-vec_traits<B>::template read_element<2>(b);
return r;
}
namespace
sfinae
{
using ::boost::qvm::operator-;
}
namespace
qvm_detail
{
template <int D>
struct minus_vv_defined;
template <>
struct
minus_vv_defined<3>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
vec_traits<A>::dim==3 && vec_traits<B>::dim==3,
A &>::type
operator+=( A & a, B const & b )
{
vec_traits<A>::template write_element<0>(a)+=vec_traits<B>::template read_element<0>(b);
vec_traits<A>::template write_element<1>(a)+=vec_traits<B>::template read_element<1>(b);
vec_traits<A>::template write_element<2>(a)+=vec_traits<B>::template read_element<2>(b);
return a;
}
namespace
sfinae
{
using ::boost::qvm::operator+=;
}
namespace
qvm_detail
{
template <int D>
struct plus_eq_vv_defined;
template <>
struct
plus_eq_vv_defined<3>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
vec_traits<A>::dim==3 && vec_traits<B>::dim==3,
A &>::type
operator-=( A & a, B const & b )
{
vec_traits<A>::template write_element<0>(a)-=vec_traits<B>::template read_element<0>(b);
vec_traits<A>::template write_element<1>(a)-=vec_traits<B>::template read_element<1>(b);
vec_traits<A>::template write_element<2>(a)-=vec_traits<B>::template read_element<2>(b);
return a;
}
namespace
sfinae
{
using ::boost::qvm::operator-=;
}
namespace
qvm_detail
{
template <int D>
struct minus_eq_vv_defined;
template <>
struct
minus_eq_vv_defined<3>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
vec_traits<A>::dim==3 && is_scalar<B>::value,
deduce_vec<A> >::type
operator*( A const & a, B b )
{
typedef typename deduce_vec<A>::type R;
R r;
vec_traits<R>::template write_element<0>(r)=vec_traits<A>::template read_element<0>(a)*b;
vec_traits<R>::template write_element<1>(r)=vec_traits<A>::template read_element<1>(a)*b;
vec_traits<R>::template write_element<2>(r)=vec_traits<A>::template read_element<2>(a)*b;
return r;
}
namespace
sfinae
{
using ::boost::qvm::operator*;
}
namespace
qvm_detail
{
template <int D>
struct mul_vs_defined;
template <>
struct
mul_vs_defined<3>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
is_scalar<A>::value && vec_traits<B>::dim==3,
deduce_vec<B> >::type
operator*( A a, B const & b )
{
typedef typename deduce_vec<B>::type R;
R r;
vec_traits<R>::template write_element<0>(r)=a*vec_traits<B>::template read_element<0>(b);
vec_traits<R>::template write_element<1>(r)=a*vec_traits<B>::template read_element<1>(b);
vec_traits<R>::template write_element<2>(r)=a*vec_traits<B>::template read_element<2>(b);
return r;
}
namespace
sfinae
{
using ::boost::qvm::operator*;
}
namespace
qvm_detail
{
template <int D>
struct mul_sv_defined;
template <>
struct
mul_sv_defined<3>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
vec_traits<A>::dim==3 && is_scalar<B>::value,
A &>::type
operator*=( A & a, B b )
{
vec_traits<A>::template write_element<0>(a)*=b;
vec_traits<A>::template write_element<1>(a)*=b;
vec_traits<A>::template write_element<2>(a)*=b;
return a;
}
namespace
sfinae
{
using ::boost::qvm::operator*=;
}
namespace
qvm_detail
{
template <int D>
struct mul_eq_vs_defined;
template <>
struct
mul_eq_vs_defined<3>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
vec_traits<A>::dim==3 && is_scalar<B>::value,
deduce_vec<A> >::type
operator/( A const & a, B b )
{
typedef typename deduce_vec<A>::type R;
R r;
vec_traits<R>::template write_element<0>(r)=vec_traits<A>::template read_element<0>(a)/b;
vec_traits<R>::template write_element<1>(r)=vec_traits<A>::template read_element<1>(a)/b;
vec_traits<R>::template write_element<2>(r)=vec_traits<A>::template read_element<2>(a)/b;
return r;
}
namespace
sfinae
{
using ::boost::qvm::operator/;
}
namespace
qvm_detail
{
template <int D>
struct div_vs_defined;
template <>
struct
div_vs_defined<3>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
vec_traits<A>::dim==3 && is_scalar<B>::value,
A &>::type
operator/=( A & a, B b )
{
vec_traits<A>::template write_element<0>(a)/=b;
vec_traits<A>::template write_element<1>(a)/=b;
vec_traits<A>::template write_element<2>(a)/=b;
return a;
}
namespace
sfinae
{
using ::boost::qvm::operator/=;
}
namespace
qvm_detail
{
template <int D>
struct div_eq_vs_defined;
template <>
struct
div_eq_vs_defined<3>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
vec_traits<A>::dim==3 && vec_traits<B>::dim==3,
A &>::type
assign( A & a, B const & b )
{
vec_traits<A>::template write_element<0>(a)=vec_traits<B>::template read_element<0>(b);
vec_traits<A>::template write_element<1>(a)=vec_traits<B>::template read_element<1>(b);
vec_traits<A>::template write_element<2>(a)=vec_traits<B>::template read_element<2>(b);
return a;
}
namespace
sfinae
{
using ::boost::qvm::assign;
}
namespace
qvm_detail
{
template <int D>
struct assign_vv_defined;
template <>
struct
assign_vv_defined<3>
{
static bool const value=true;
};
}
template <class R,class A>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
is_vec<A>::value &&
vec_traits<R>::dim==3 && vec_traits<A>::dim==3,
R>::type
convert_to( A const & a )
{
R r;
vec_traits<R>::template write_element<0>(r)=vec_traits<A>::template read_element<0>(a);
vec_traits<R>::template write_element<1>(r)=vec_traits<A>::template read_element<1>(a);
vec_traits<R>::template write_element<2>(r)=vec_traits<A>::template read_element<2>(a);
return r;
}
namespace
sfinae
{
using ::boost::qvm::convert_to;
}
namespace
qvm_detail
{
template <int D>
struct convert_to_v_defined;
template <>
struct
convert_to_v_defined<3>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
vec_traits<A>::dim==3 && vec_traits<B>::dim==3,
bool>::type
operator==( A const & a, B const & b )
{
return
vec_traits<A>::template read_element<0>(a)==vec_traits<B>::template read_element<0>(b) &&
vec_traits<A>::template read_element<1>(a)==vec_traits<B>::template read_element<1>(b) &&
vec_traits<A>::template read_element<2>(a)==vec_traits<B>::template read_element<2>(b);
}
namespace
sfinae
{
using ::boost::qvm::operator==;
}
namespace
qvm_detail
{
template <int D>
struct eq_vv_defined;
template <>
struct
eq_vv_defined<3>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
vec_traits<A>::dim==3 && vec_traits<B>::dim==3,
bool>::type
operator!=( A const & a, B const & b )
{
return
!(vec_traits<A>::template read_element<0>(a)==vec_traits<B>::template read_element<0>(b)) ||
!(vec_traits<A>::template read_element<1>(a)==vec_traits<B>::template read_element<1>(b)) ||
!(vec_traits<A>::template read_element<2>(a)==vec_traits<B>::template read_element<2>(b));
}
namespace
sfinae
{
using ::boost::qvm::operator!=;
}
namespace
qvm_detail
{
template <int D>
struct neq_vv_defined;
template <>
struct
neq_vv_defined<3>
{
static bool const value=true;
};
}
template <class A>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
vec_traits<A>::dim==3,
deduce_vec<A> >::type
operator-( A const & a )
{
typedef typename deduce_vec<A>::type R;
R r;
vec_traits<R>::template write_element<0>(r)=-vec_traits<A>::template read_element<0>(a);
vec_traits<R>::template write_element<1>(r)=-vec_traits<A>::template read_element<1>(a);
vec_traits<R>::template write_element<2>(r)=-vec_traits<A>::template read_element<2>(a);
return r;
}
namespace
sfinae
{
using ::boost::qvm::operator-;
}
namespace
qvm_detail
{
template <int D>
struct minus_v_defined;
template <>
struct
minus_v_defined<3>
{
static bool const value=true;
};
}
template <class A>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
is_vec<A>::value && vec_traits<A>::dim==3,
typename vec_traits<A>::scalar_type>::type
mag( A const & a )
{
typedef typename vec_traits<A>::scalar_type T;
T const a0=vec_traits<A>::template read_element<0>(a);
T const a1=vec_traits<A>::template read_element<1>(a);
T const a2=vec_traits<A>::template read_element<2>(a);
T const m2=a0*a0+a1*a1+a2*a2;
T const mag=sqrt<T>(m2);
return mag;
}
namespace
sfinae
{
using ::boost::qvm::mag;
}
namespace
qvm_detail
{
template <int D>
struct mag_v_defined;
template <>
struct
mag_v_defined<3>
{
static bool const value=true;
};
}
template <class A>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
is_vec<A>::value && vec_traits<A>::dim==3,
typename vec_traits<A>::scalar_type>::type
mag_sqr( A const & a )
{
typedef typename vec_traits<A>::scalar_type T;
T const a0=vec_traits<A>::template read_element<0>(a);
T const a1=vec_traits<A>::template read_element<1>(a);
T const a2=vec_traits<A>::template read_element<2>(a);
T const m2=a0*a0+a1*a1+a2*a2;
return m2;
}
namespace
sfinae
{
using ::boost::qvm::mag_sqr;
}
namespace
qvm_detail
{
template <int D>
struct mag_sqr_v_defined;
template <>
struct
mag_sqr_v_defined<3>
{
static bool const value=true;
};
}
template <class A>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
vec_traits<A>::dim==3,
deduce_vec<A> >::type
normalized( A const & a )
{
typedef typename vec_traits<A>::scalar_type T;
T const a0=vec_traits<A>::template read_element<0>(a);
T const a1=vec_traits<A>::template read_element<1>(a);
T const a2=vec_traits<A>::template read_element<2>(a);
T const m2=a0*a0+a1*a1+a2*a2;
if( m2==scalar_traits<typename vec_traits<A>::scalar_type>::value(0) )
BOOST_QVM_THROW_EXCEPTION(zero_magnitude_error());
T const rm=scalar_traits<T>::value(1)/sqrt<T>(m2);
typedef typename deduce_vec<A>::type R;
R r;
vec_traits<R>::template write_element<0>(r)=a0*rm;
vec_traits<R>::template write_element<1>(r)=a1*rm;
vec_traits<R>::template write_element<2>(r)=a2*rm;
return r;
}
namespace
sfinae
{
using ::boost::qvm::normalized;
}
template <class A>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
vec_traits<A>::dim==3,
void>::type
normalize( A & a )
{
typedef typename vec_traits<A>::scalar_type T;
T const a0=vec_traits<A>::template read_element<0>(a);
T const a1=vec_traits<A>::template read_element<1>(a);
T const a2=vec_traits<A>::template read_element<2>(a);
T const m2=a0*a0+a1*a1+a2*a2;
if( m2==scalar_traits<typename vec_traits<A>::scalar_type>::value(0) )
BOOST_QVM_THROW_EXCEPTION(zero_magnitude_error());
T const rm=scalar_traits<T>::value(1)/sqrt<T>(m2);
vec_traits<A>::template write_element<0>(a)*=rm;
vec_traits<A>::template write_element<1>(a)*=rm;
vec_traits<A>::template write_element<2>(a)*=rm;
}
namespace
sfinae
{
using ::boost::qvm::normalize;
}
namespace
qvm_detail
{
template <int D>
struct normalize_v_defined;
template <>
struct
normalize_v_defined<3>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
vec_traits<A>::dim==3 && vec_traits<B>::dim==3,
deduce_scalar<typename vec_traits<A>::scalar_type,typename vec_traits<B>::scalar_type> >::type
dot( A const & a, B const & b )
{
typedef typename vec_traits<A>::scalar_type Ta;
typedef typename vec_traits<B>::scalar_type Tb;
typedef typename deduce_scalar<Ta,Tb>::type Tr;
Ta const a0=vec_traits<A>::template read_element<0>(a);
Ta const a1=vec_traits<A>::template read_element<1>(a);
Ta const a2=vec_traits<A>::template read_element<2>(a);
Tb const b0=vec_traits<B>::template read_element<0>(b);
Tb const b1=vec_traits<B>::template read_element<1>(b);
Tb const b2=vec_traits<B>::template read_element<2>(b);
Tr const dot=a0*b0+a1*b1+a2*b2;
return dot;
}
namespace
sfinae
{
using ::boost::qvm::dot;
}
namespace
qvm_detail
{
template <int D>
struct dot_vv_defined;
template <>
struct
dot_vv_defined<3>
{
static bool const value=true;
};
}
}
}
#endif
@@ -0,0 +1,710 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_QVM_AD4F14F2444066D06BC430B7323BA122
#define BOOST_QVM_AD4F14F2444066D06BC430B7323BA122
//This file was generated by a program. Do not edit manually.
#include <boost/qvm/deduce_scalar.hpp>
#include <boost/qvm/deduce_vec.hpp>
#include <boost/qvm/enable_if.hpp>
#include <boost/qvm/error.hpp>
#include <boost/qvm/inline.hpp>
#include <boost/qvm/math.hpp>
#include <boost/qvm/static_assert.hpp>
#include <boost/qvm/throw_exception.hpp>
#include <boost/qvm/vec_traits.hpp>
namespace
boost
{
namespace
qvm
{
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
vec_traits<A>::dim==4 && vec_traits<B>::dim==4,
deduce_vec2<A,B,4> >::type
operator+( A const & a, B const & b )
{
typedef typename deduce_vec2<A,B,4>::type R;
BOOST_QVM_STATIC_ASSERT(vec_traits<R>::dim==4);
R r;
vec_traits<R>::template write_element<0>(r)=vec_traits<A>::template read_element<0>(a)+vec_traits<B>::template read_element<0>(b);
vec_traits<R>::template write_element<1>(r)=vec_traits<A>::template read_element<1>(a)+vec_traits<B>::template read_element<1>(b);
vec_traits<R>::template write_element<2>(r)=vec_traits<A>::template read_element<2>(a)+vec_traits<B>::template read_element<2>(b);
vec_traits<R>::template write_element<3>(r)=vec_traits<A>::template read_element<3>(a)+vec_traits<B>::template read_element<3>(b);
return r;
}
namespace
sfinae
{
using ::boost::qvm::operator+;
}
namespace
qvm_detail
{
template <int D>
struct plus_vv_defined;
template <>
struct
plus_vv_defined<4>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
vec_traits<A>::dim==4 && vec_traits<B>::dim==4,
deduce_vec2<A,B,4> >::type
operator-( A const & a, B const & b )
{
typedef typename deduce_vec2<A,B,4>::type R;
BOOST_QVM_STATIC_ASSERT(vec_traits<R>::dim==4);
R r;
vec_traits<R>::template write_element<0>(r)=vec_traits<A>::template read_element<0>(a)-vec_traits<B>::template read_element<0>(b);
vec_traits<R>::template write_element<1>(r)=vec_traits<A>::template read_element<1>(a)-vec_traits<B>::template read_element<1>(b);
vec_traits<R>::template write_element<2>(r)=vec_traits<A>::template read_element<2>(a)-vec_traits<B>::template read_element<2>(b);
vec_traits<R>::template write_element<3>(r)=vec_traits<A>::template read_element<3>(a)-vec_traits<B>::template read_element<3>(b);
return r;
}
namespace
sfinae
{
using ::boost::qvm::operator-;
}
namespace
qvm_detail
{
template <int D>
struct minus_vv_defined;
template <>
struct
minus_vv_defined<4>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
vec_traits<A>::dim==4 && vec_traits<B>::dim==4,
A &>::type
operator+=( A & a, B const & b )
{
vec_traits<A>::template write_element<0>(a)+=vec_traits<B>::template read_element<0>(b);
vec_traits<A>::template write_element<1>(a)+=vec_traits<B>::template read_element<1>(b);
vec_traits<A>::template write_element<2>(a)+=vec_traits<B>::template read_element<2>(b);
vec_traits<A>::template write_element<3>(a)+=vec_traits<B>::template read_element<3>(b);
return a;
}
namespace
sfinae
{
using ::boost::qvm::operator+=;
}
namespace
qvm_detail
{
template <int D>
struct plus_eq_vv_defined;
template <>
struct
plus_eq_vv_defined<4>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
vec_traits<A>::dim==4 && vec_traits<B>::dim==4,
A &>::type
operator-=( A & a, B const & b )
{
vec_traits<A>::template write_element<0>(a)-=vec_traits<B>::template read_element<0>(b);
vec_traits<A>::template write_element<1>(a)-=vec_traits<B>::template read_element<1>(b);
vec_traits<A>::template write_element<2>(a)-=vec_traits<B>::template read_element<2>(b);
vec_traits<A>::template write_element<3>(a)-=vec_traits<B>::template read_element<3>(b);
return a;
}
namespace
sfinae
{
using ::boost::qvm::operator-=;
}
namespace
qvm_detail
{
template <int D>
struct minus_eq_vv_defined;
template <>
struct
minus_eq_vv_defined<4>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
vec_traits<A>::dim==4 && is_scalar<B>::value,
deduce_vec<A> >::type
operator*( A const & a, B b )
{
typedef typename deduce_vec<A>::type R;
R r;
vec_traits<R>::template write_element<0>(r)=vec_traits<A>::template read_element<0>(a)*b;
vec_traits<R>::template write_element<1>(r)=vec_traits<A>::template read_element<1>(a)*b;
vec_traits<R>::template write_element<2>(r)=vec_traits<A>::template read_element<2>(a)*b;
vec_traits<R>::template write_element<3>(r)=vec_traits<A>::template read_element<3>(a)*b;
return r;
}
namespace
sfinae
{
using ::boost::qvm::operator*;
}
namespace
qvm_detail
{
template <int D>
struct mul_vs_defined;
template <>
struct
mul_vs_defined<4>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
is_scalar<A>::value && vec_traits<B>::dim==4,
deduce_vec<B> >::type
operator*( A a, B const & b )
{
typedef typename deduce_vec<B>::type R;
R r;
vec_traits<R>::template write_element<0>(r)=a*vec_traits<B>::template read_element<0>(b);
vec_traits<R>::template write_element<1>(r)=a*vec_traits<B>::template read_element<1>(b);
vec_traits<R>::template write_element<2>(r)=a*vec_traits<B>::template read_element<2>(b);
vec_traits<R>::template write_element<3>(r)=a*vec_traits<B>::template read_element<3>(b);
return r;
}
namespace
sfinae
{
using ::boost::qvm::operator*;
}
namespace
qvm_detail
{
template <int D>
struct mul_sv_defined;
template <>
struct
mul_sv_defined<4>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
vec_traits<A>::dim==4 && is_scalar<B>::value,
A &>::type
operator*=( A & a, B b )
{
vec_traits<A>::template write_element<0>(a)*=b;
vec_traits<A>::template write_element<1>(a)*=b;
vec_traits<A>::template write_element<2>(a)*=b;
vec_traits<A>::template write_element<3>(a)*=b;
return a;
}
namespace
sfinae
{
using ::boost::qvm::operator*=;
}
namespace
qvm_detail
{
template <int D>
struct mul_eq_vs_defined;
template <>
struct
mul_eq_vs_defined<4>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
vec_traits<A>::dim==4 && is_scalar<B>::value,
deduce_vec<A> >::type
operator/( A const & a, B b )
{
typedef typename deduce_vec<A>::type R;
R r;
vec_traits<R>::template write_element<0>(r)=vec_traits<A>::template read_element<0>(a)/b;
vec_traits<R>::template write_element<1>(r)=vec_traits<A>::template read_element<1>(a)/b;
vec_traits<R>::template write_element<2>(r)=vec_traits<A>::template read_element<2>(a)/b;
vec_traits<R>::template write_element<3>(r)=vec_traits<A>::template read_element<3>(a)/b;
return r;
}
namespace
sfinae
{
using ::boost::qvm::operator/;
}
namespace
qvm_detail
{
template <int D>
struct div_vs_defined;
template <>
struct
div_vs_defined<4>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
vec_traits<A>::dim==4 && is_scalar<B>::value,
A &>::type
operator/=( A & a, B b )
{
vec_traits<A>::template write_element<0>(a)/=b;
vec_traits<A>::template write_element<1>(a)/=b;
vec_traits<A>::template write_element<2>(a)/=b;
vec_traits<A>::template write_element<3>(a)/=b;
return a;
}
namespace
sfinae
{
using ::boost::qvm::operator/=;
}
namespace
qvm_detail
{
template <int D>
struct div_eq_vs_defined;
template <>
struct
div_eq_vs_defined<4>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
vec_traits<A>::dim==4 && vec_traits<B>::dim==4,
A &>::type
assign( A & a, B const & b )
{
vec_traits<A>::template write_element<0>(a)=vec_traits<B>::template read_element<0>(b);
vec_traits<A>::template write_element<1>(a)=vec_traits<B>::template read_element<1>(b);
vec_traits<A>::template write_element<2>(a)=vec_traits<B>::template read_element<2>(b);
vec_traits<A>::template write_element<3>(a)=vec_traits<B>::template read_element<3>(b);
return a;
}
namespace
sfinae
{
using ::boost::qvm::assign;
}
namespace
qvm_detail
{
template <int D>
struct assign_vv_defined;
template <>
struct
assign_vv_defined<4>
{
static bool const value=true;
};
}
template <class R,class A>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
is_vec<A>::value &&
vec_traits<R>::dim==4 && vec_traits<A>::dim==4,
R>::type
convert_to( A const & a )
{
R r;
vec_traits<R>::template write_element<0>(r)=vec_traits<A>::template read_element<0>(a);
vec_traits<R>::template write_element<1>(r)=vec_traits<A>::template read_element<1>(a);
vec_traits<R>::template write_element<2>(r)=vec_traits<A>::template read_element<2>(a);
vec_traits<R>::template write_element<3>(r)=vec_traits<A>::template read_element<3>(a);
return r;
}
namespace
sfinae
{
using ::boost::qvm::convert_to;
}
namespace
qvm_detail
{
template <int D>
struct convert_to_v_defined;
template <>
struct
convert_to_v_defined<4>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
vec_traits<A>::dim==4 && vec_traits<B>::dim==4,
bool>::type
operator==( A const & a, B const & b )
{
return
vec_traits<A>::template read_element<0>(a)==vec_traits<B>::template read_element<0>(b) &&
vec_traits<A>::template read_element<1>(a)==vec_traits<B>::template read_element<1>(b) &&
vec_traits<A>::template read_element<2>(a)==vec_traits<B>::template read_element<2>(b) &&
vec_traits<A>::template read_element<3>(a)==vec_traits<B>::template read_element<3>(b);
}
namespace
sfinae
{
using ::boost::qvm::operator==;
}
namespace
qvm_detail
{
template <int D>
struct eq_vv_defined;
template <>
struct
eq_vv_defined<4>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
vec_traits<A>::dim==4 && vec_traits<B>::dim==4,
bool>::type
operator!=( A const & a, B const & b )
{
return
!(vec_traits<A>::template read_element<0>(a)==vec_traits<B>::template read_element<0>(b)) ||
!(vec_traits<A>::template read_element<1>(a)==vec_traits<B>::template read_element<1>(b)) ||
!(vec_traits<A>::template read_element<2>(a)==vec_traits<B>::template read_element<2>(b)) ||
!(vec_traits<A>::template read_element<3>(a)==vec_traits<B>::template read_element<3>(b));
}
namespace
sfinae
{
using ::boost::qvm::operator!=;
}
namespace
qvm_detail
{
template <int D>
struct neq_vv_defined;
template <>
struct
neq_vv_defined<4>
{
static bool const value=true;
};
}
template <class A>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
vec_traits<A>::dim==4,
deduce_vec<A> >::type
operator-( A const & a )
{
typedef typename deduce_vec<A>::type R;
R r;
vec_traits<R>::template write_element<0>(r)=-vec_traits<A>::template read_element<0>(a);
vec_traits<R>::template write_element<1>(r)=-vec_traits<A>::template read_element<1>(a);
vec_traits<R>::template write_element<2>(r)=-vec_traits<A>::template read_element<2>(a);
vec_traits<R>::template write_element<3>(r)=-vec_traits<A>::template read_element<3>(a);
return r;
}
namespace
sfinae
{
using ::boost::qvm::operator-;
}
namespace
qvm_detail
{
template <int D>
struct minus_v_defined;
template <>
struct
minus_v_defined<4>
{
static bool const value=true;
};
}
template <class A>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
is_vec<A>::value && vec_traits<A>::dim==4,
typename vec_traits<A>::scalar_type>::type
mag( A const & a )
{
typedef typename vec_traits<A>::scalar_type T;
T const a0=vec_traits<A>::template read_element<0>(a);
T const a1=vec_traits<A>::template read_element<1>(a);
T const a2=vec_traits<A>::template read_element<2>(a);
T const a3=vec_traits<A>::template read_element<3>(a);
T const m2=a0*a0+a1*a1+a2*a2+a3*a3;
T const mag=sqrt<T>(m2);
return mag;
}
namespace
sfinae
{
using ::boost::qvm::mag;
}
namespace
qvm_detail
{
template <int D>
struct mag_v_defined;
template <>
struct
mag_v_defined<4>
{
static bool const value=true;
};
}
template <class A>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
is_vec<A>::value && vec_traits<A>::dim==4,
typename vec_traits<A>::scalar_type>::type
mag_sqr( A const & a )
{
typedef typename vec_traits<A>::scalar_type T;
T const a0=vec_traits<A>::template read_element<0>(a);
T const a1=vec_traits<A>::template read_element<1>(a);
T const a2=vec_traits<A>::template read_element<2>(a);
T const a3=vec_traits<A>::template read_element<3>(a);
T const m2=a0*a0+a1*a1+a2*a2+a3*a3;
return m2;
}
namespace
sfinae
{
using ::boost::qvm::mag_sqr;
}
namespace
qvm_detail
{
template <int D>
struct mag_sqr_v_defined;
template <>
struct
mag_sqr_v_defined<4>
{
static bool const value=true;
};
}
template <class A>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
vec_traits<A>::dim==4,
deduce_vec<A> >::type
normalized( A const & a )
{
typedef typename vec_traits<A>::scalar_type T;
T const a0=vec_traits<A>::template read_element<0>(a);
T const a1=vec_traits<A>::template read_element<1>(a);
T const a2=vec_traits<A>::template read_element<2>(a);
T const a3=vec_traits<A>::template read_element<3>(a);
T const m2=a0*a0+a1*a1+a2*a2+a3*a3;
if( m2==scalar_traits<typename vec_traits<A>::scalar_type>::value(0) )
BOOST_QVM_THROW_EXCEPTION(zero_magnitude_error());
T const rm=scalar_traits<T>::value(1)/sqrt<T>(m2);
typedef typename deduce_vec<A>::type R;
R r;
vec_traits<R>::template write_element<0>(r)=a0*rm;
vec_traits<R>::template write_element<1>(r)=a1*rm;
vec_traits<R>::template write_element<2>(r)=a2*rm;
vec_traits<R>::template write_element<3>(r)=a3*rm;
return r;
}
namespace
sfinae
{
using ::boost::qvm::normalized;
}
template <class A>
BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
vec_traits<A>::dim==4,
void>::type
normalize( A & a )
{
typedef typename vec_traits<A>::scalar_type T;
T const a0=vec_traits<A>::template read_element<0>(a);
T const a1=vec_traits<A>::template read_element<1>(a);
T const a2=vec_traits<A>::template read_element<2>(a);
T const a3=vec_traits<A>::template read_element<3>(a);
T const m2=a0*a0+a1*a1+a2*a2+a3*a3;
if( m2==scalar_traits<typename vec_traits<A>::scalar_type>::value(0) )
BOOST_QVM_THROW_EXCEPTION(zero_magnitude_error());
T const rm=scalar_traits<T>::value(1)/sqrt<T>(m2);
vec_traits<A>::template write_element<0>(a)*=rm;
vec_traits<A>::template write_element<1>(a)*=rm;
vec_traits<A>::template write_element<2>(a)*=rm;
vec_traits<A>::template write_element<3>(a)*=rm;
}
namespace
sfinae
{
using ::boost::qvm::normalize;
}
namespace
qvm_detail
{
template <int D>
struct normalize_v_defined;
template <>
struct
normalize_v_defined<4>
{
static bool const value=true;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
vec_traits<A>::dim==4 && vec_traits<B>::dim==4,
deduce_scalar<typename vec_traits<A>::scalar_type,typename vec_traits<B>::scalar_type> >::type
dot( A const & a, B const & b )
{
typedef typename vec_traits<A>::scalar_type Ta;
typedef typename vec_traits<B>::scalar_type Tb;
typedef typename deduce_scalar<Ta,Tb>::type Tr;
Ta const a0=vec_traits<A>::template read_element<0>(a);
Ta const a1=vec_traits<A>::template read_element<1>(a);
Ta const a2=vec_traits<A>::template read_element<2>(a);
Ta const a3=vec_traits<A>::template read_element<3>(a);
Tb const b0=vec_traits<B>::template read_element<0>(b);
Tb const b1=vec_traits<B>::template read_element<1>(b);
Tb const b2=vec_traits<B>::template read_element<2>(b);
Tb const b3=vec_traits<B>::template read_element<3>(b);
Tr const dot=a0*b0+a1*b1+a2*b2+a3*b3;
return dot;
}
namespace
sfinae
{
using ::boost::qvm::dot;
}
namespace
qvm_detail
{
template <int D>
struct dot_vv_defined;
template <>
struct
dot_vv_defined<4>
{
static bool const value=true;
};
}
}
}
#endif
@@ -0,0 +1,34 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_QVM_FORCEINLINE
# if defined(_MSC_VER)
# define BOOST_QVM_FORCEINLINE __forceinline
# elif defined(__GNUC__) && __GNUC__>3
# define BOOST_QVM_FORCEINLINE inline __attribute__ ((always_inline))
# else
# define BOOST_QVM_FORCEINLINE inline
# endif
#endif
#ifndef BOOST_QVM_INLINE
#define BOOST_QVM_INLINE inline
#endif
#ifndef BOOST_QVM_INLINE_TRIVIAL
#define BOOST_QVM_INLINE_TRIVIAL BOOST_QVM_FORCEINLINE
#endif
#ifndef BOOST_QVM_INLINE_CRITICAL
#define BOOST_QVM_INLINE_CRITICAL BOOST_QVM_FORCEINLINE
#endif
#ifndef BOOST_QVM_INLINE_OPERATIONS
#define BOOST_QVM_INLINE_OPERATIONS BOOST_QVM_INLINE
#endif
#ifndef BOOST_QVM_INLINE_RECURSION
#define BOOST_QVM_INLINE_RECURSION BOOST_QVM_INLINE_OPERATIONS
#endif
@@ -0,0 +1,13 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_74318C76B4ED11E58A3AE198BB8E7F8B
#define UUID_74318C76B4ED11E58A3AE198BB8E7F8B
#include <boost/qvm/map_vec_mat.hpp>
#include <boost/qvm/map_mat_vec.hpp>
#include <boost/qvm/map_mat_mat.hpp>
#endif
@@ -0,0 +1,895 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_20D98340A3EB11DEB2180CD156D89593
#define UUID_20D98340A3EB11DEB2180CD156D89593
#include <boost/qvm/inline.hpp>
#include <boost/qvm/deduce_mat.hpp>
#include <boost/qvm/assert.hpp>
#include <boost/qvm/enable_if.hpp>
#include <boost/qvm/detail/transp_impl.hpp>
namespace
boost
{
namespace
qvm
{
////////////////////////////////////////////////
namespace
qvm_detail
{
template <int Row,class OriginalMatrix>
class
del_row_
{
del_row_( del_row_ const & );
del_row_ & operator=( del_row_ const & );
~del_row_();
public:
template <class T>
BOOST_QVM_INLINE_TRIVIAL
del_row_ &
operator=( T const & x )
{
assign(*this,x);
return *this;
}
template <class R>
BOOST_QVM_INLINE_TRIVIAL
operator R() const
{
R r;
assign(r,*this);
return r;
}
};
}
template <int I,class OriginalMatrix>
struct
mat_traits< qvm_detail::del_row_<I,OriginalMatrix> >
{
typedef qvm_detail::del_row_<I,OriginalMatrix> this_matrix;
typedef typename mat_traits<OriginalMatrix>::scalar_type scalar_type;
static int const rows=mat_traits<OriginalMatrix>::rows-1;
static int const cols=mat_traits<OriginalMatrix>::cols;
template <int Row,int Col>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element( this_matrix const & x )
{
BOOST_QVM_STATIC_ASSERT(Row>=0);
BOOST_QVM_STATIC_ASSERT(Row<rows);
BOOST_QVM_STATIC_ASSERT(Col>=0);
BOOST_QVM_STATIC_ASSERT(Col<cols);
return mat_traits<OriginalMatrix>::template read_element<Row+(Row>=I),Col>(reinterpret_cast<OriginalMatrix const &>(x));
}
template <int Row,int Col>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element( this_matrix & x )
{
BOOST_QVM_STATIC_ASSERT(Row>=0);
BOOST_QVM_STATIC_ASSERT(Row<rows);
BOOST_QVM_STATIC_ASSERT(Col>=0);
BOOST_QVM_STATIC_ASSERT(Col<cols);
return mat_traits<OriginalMatrix>::template write_element<Row+(Row>=I),Col>(reinterpret_cast<OriginalMatrix &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element_idx( int row, int col, this_matrix const & x )
{
BOOST_QVM_ASSERT(row>=0);
BOOST_QVM_ASSERT(row<rows);
BOOST_QVM_ASSERT(col>=0);
BOOST_QVM_ASSERT(col<cols);
return mat_traits<OriginalMatrix>::read_element_idx(row+(row>=I),col,reinterpret_cast<OriginalMatrix const &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element_idx( int row, int col, this_matrix & x )
{
BOOST_QVM_ASSERT(row>=0);
BOOST_QVM_ASSERT(row<rows);
BOOST_QVM_ASSERT(col>=0);
BOOST_QVM_ASSERT(col<cols);
return mat_traits<OriginalMatrix>::write_element_idx(row+(row>=I),col,reinterpret_cast<OriginalMatrix &>(x));
}
};
template <int J,class OriginalMatrix,int R,int C>
struct
deduce_mat<qvm_detail::del_row_<J,OriginalMatrix>,R,C>
{
typedef mat<typename mat_traits<OriginalMatrix>::scalar_type,R,C> type;
};
template <int J,class OriginalMatrix,int R,int C>
struct
deduce_mat2<qvm_detail::del_row_<J,OriginalMatrix>,qvm_detail::del_row_<J,OriginalMatrix>,R,C>
{
typedef mat<typename mat_traits<OriginalMatrix>::scalar_type,R,C> type;
};
template <int Row,class A>
typename boost::enable_if_c<
is_mat<A>::value,
qvm_detail::del_row_<Row,A> const &>::type
BOOST_QVM_INLINE_TRIVIAL
del_row( A const & a )
{
return reinterpret_cast<typename qvm_detail::del_row_<Row,A> const &>(a);
}
template <int Row,class A>
typename boost::enable_if_c<
is_mat<A>::value,
qvm_detail::del_row_<Row,A> &>::type
BOOST_QVM_INLINE_TRIVIAL
del_row( A & a )
{
return reinterpret_cast<typename qvm_detail::del_row_<Row,A> &>(a);
}
////////////////////////////////////////////////
namespace
qvm_detail
{
template <int Col,class OriginalMatrix>
class
del_col_
{
del_col_( del_col_ const & );
del_col_ & operator=( del_col_ const & );
~del_col_();
public:
template <class T>
BOOST_QVM_INLINE_TRIVIAL
del_col_ &
operator=( T const & x )
{
assign(*this,x);
return *this;
}
template <class R>
BOOST_QVM_INLINE_TRIVIAL
operator R() const
{
R r;
assign(r,*this);
return r;
}
};
}
template <int J,class OriginalMatrix>
struct
mat_traits< qvm_detail::del_col_<J,OriginalMatrix> >
{
typedef qvm_detail::del_col_<J,OriginalMatrix> this_matrix;
typedef typename mat_traits<OriginalMatrix>::scalar_type scalar_type;
static int const rows=mat_traits<OriginalMatrix>::rows;
static int const cols=mat_traits<OriginalMatrix>::cols-1;
template <int Row,int Col>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element( this_matrix const & x )
{
BOOST_QVM_STATIC_ASSERT(Row>=0);
BOOST_QVM_STATIC_ASSERT(Row<rows);
BOOST_QVM_STATIC_ASSERT(Col>=0);
BOOST_QVM_STATIC_ASSERT(Col<cols);
return mat_traits<OriginalMatrix>::template read_element<Row,Col+(Col>=J)>(reinterpret_cast<OriginalMatrix const &>(x));
}
template <int Row,int Col>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element( this_matrix & x )
{
BOOST_QVM_STATIC_ASSERT(Row>=0);
BOOST_QVM_STATIC_ASSERT(Row<rows);
BOOST_QVM_STATIC_ASSERT(Col>=0);
BOOST_QVM_STATIC_ASSERT(Col<cols);
return mat_traits<OriginalMatrix>::template write_element<Row,Col+(Col>=J)>(reinterpret_cast<OriginalMatrix &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element_idx( int row, int col, this_matrix const & x )
{
BOOST_QVM_ASSERT(row>=0);
BOOST_QVM_ASSERT(row<rows);
BOOST_QVM_ASSERT(col>=0);
BOOST_QVM_ASSERT(col<cols);
return mat_traits<OriginalMatrix>::read_element_idx(row,col+(col>=J),reinterpret_cast<OriginalMatrix const &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element_idx( int row, int col, this_matrix & x )
{
BOOST_QVM_ASSERT(row>=0);
BOOST_QVM_ASSERT(row<rows);
BOOST_QVM_ASSERT(col>=0);
BOOST_QVM_ASSERT(col<cols);
return mat_traits<OriginalMatrix>::write_element_idx(row,col+(col>=J),reinterpret_cast<OriginalMatrix &>(x));
}
};
template <int J,class OriginalMatrix,int R,int C>
struct
deduce_mat<qvm_detail::del_col_<J,OriginalMatrix>,R,C>
{
typedef mat<typename mat_traits<OriginalMatrix>::scalar_type,R,C> type;
};
template <int J,class OriginalMatrix,int R,int C>
struct
deduce_mat2<qvm_detail::del_col_<J,OriginalMatrix>,qvm_detail::del_col_<J,OriginalMatrix>,R,C>
{
typedef mat<typename mat_traits<OriginalMatrix>::scalar_type,R,C> type;
};
template <int Col,class A>
typename boost::enable_if_c<
is_mat<A>::value,
qvm_detail::del_col_<Col,A> const &>::type
BOOST_QVM_INLINE_TRIVIAL
del_col( A const & a )
{
return reinterpret_cast<typename qvm_detail::del_col_<Col,A> const &>(a);
}
template <int Col,class A>
typename boost::enable_if_c<
is_mat<A>::value,
qvm_detail::del_col_<Col,A> &>::type
BOOST_QVM_INLINE_TRIVIAL
del_col( A & a )
{
return reinterpret_cast<typename qvm_detail::del_col_<Col,A> &>(a);
}
////////////////////////////////////////////////
namespace
qvm_detail
{
template <int Row,int Col,class OriginalMatrix>
class
del_row_col_
{
del_row_col_( del_row_col_ const & );
~del_row_col_();
public:
BOOST_QVM_INLINE_TRIVIAL
del_row_col_ &
operator=( del_row_col_ const & x )
{
assign(*this,x);
return *this;
}
template <class T>
BOOST_QVM_INLINE_TRIVIAL
del_row_col_ &
operator=( T const & x )
{
assign(*this,x);
return *this;
}
template <class R>
BOOST_QVM_INLINE_TRIVIAL
operator R() const
{
R r;
assign(r,*this);
return r;
}
};
}
template <int I,int J,class OriginalMatrix>
struct
mat_traits< qvm_detail::del_row_col_<I,J,OriginalMatrix> >
{
typedef qvm_detail::del_row_col_<I,J,OriginalMatrix> this_matrix;
typedef typename mat_traits<OriginalMatrix>::scalar_type scalar_type;
static int const rows=mat_traits<OriginalMatrix>::rows-1;
static int const cols=mat_traits<OriginalMatrix>::cols-1;
template <int Row,int Col>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element( this_matrix const & x )
{
BOOST_QVM_STATIC_ASSERT(Row>=0);
BOOST_QVM_STATIC_ASSERT(Row<rows);
BOOST_QVM_STATIC_ASSERT(Col>=0);
BOOST_QVM_STATIC_ASSERT(Col<cols);
return mat_traits<OriginalMatrix>::template read_element<Row+(Row>=I),Col+(Col>=J)>(reinterpret_cast<OriginalMatrix const &>(x));
}
template <int Row,int Col>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element( this_matrix & x )
{
BOOST_QVM_STATIC_ASSERT(Row>=0);
BOOST_QVM_STATIC_ASSERT(Row<rows);
BOOST_QVM_STATIC_ASSERT(Col>=0);
BOOST_QVM_STATIC_ASSERT(Col<cols);
return mat_traits<OriginalMatrix>::template write_element<Row+(Row>=I),Col+(Col>=J)>(reinterpret_cast<OriginalMatrix &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element_idx( int row, int col, this_matrix const & x )
{
BOOST_QVM_ASSERT(row>=0);
BOOST_QVM_ASSERT(row<rows);
BOOST_QVM_ASSERT(col>=0);
BOOST_QVM_ASSERT(col<cols);
return mat_traits<OriginalMatrix>::read_element_idx(row+(row>=I),col+(col>=J),reinterpret_cast<OriginalMatrix const &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element_idx( int row, int col, this_matrix & x )
{
BOOST_QVM_ASSERT(row>=0);
BOOST_QVM_ASSERT(row<rows);
BOOST_QVM_ASSERT(col>=0);
BOOST_QVM_ASSERT(col<cols);
return mat_traits<OriginalMatrix>::write_element_idx(row+(row>=I),col+(col>=J),reinterpret_cast<OriginalMatrix &>(x));
}
};
template <int I,int J,class OriginalMatrix,int R,int C>
struct
deduce_mat<qvm_detail::del_row_col_<I,J,OriginalMatrix>,R,C>
{
typedef mat<typename mat_traits<OriginalMatrix>::scalar_type,R,C> type;
};
template <int I,int J,class OriginalMatrix,int R,int C>
struct
deduce_mat2<qvm_detail::del_row_col_<I,J,OriginalMatrix>,qvm_detail::del_row_col_<I,J,OriginalMatrix>,R,C>
{
typedef mat<typename mat_traits<OriginalMatrix>::scalar_type,R,C> type;
};
template <int Row,int Col,class A>
typename boost::enable_if_c<
is_mat<A>::value,
qvm_detail::del_row_col_<Row,Col,A> const &>::type
BOOST_QVM_INLINE_TRIVIAL
del_row_col( A const & a )
{
return reinterpret_cast<typename qvm_detail::del_row_col_<Row,Col,A> const &>(a);
}
template <int Row,int Col,class A>
typename boost::enable_if_c<
is_mat<A>::value,
qvm_detail::del_row_col_<Row,Col,A> &>::type
BOOST_QVM_INLINE_TRIVIAL
del_row_col( A & a )
{
return reinterpret_cast<typename qvm_detail::del_row_col_<Row,Col,A> &>(a);
}
////////////////////////////////////////////////
namespace
qvm_detail
{
template <int Row,class OriginalMatrix>
class
neg_row_
{
neg_row_( neg_row_ const & );
neg_row_ & operator=( neg_row_ const & );
~neg_row_();
public:
template <class T>
BOOST_QVM_INLINE_TRIVIAL
neg_row_ &
operator=( T const & x )
{
assign(*this,x);
return *this;
}
template <class R>
BOOST_QVM_INLINE_TRIVIAL
operator R() const
{
R r;
assign(r,*this);
return r;
}
};
}
template <int I,class OriginalMatrix>
struct
mat_traits< qvm_detail::neg_row_<I,OriginalMatrix> >
{
typedef qvm_detail::neg_row_<I,OriginalMatrix> this_matrix;
typedef typename mat_traits<OriginalMatrix>::scalar_type scalar_type;
static int const rows=mat_traits<OriginalMatrix>::rows;
static int const cols=mat_traits<OriginalMatrix>::cols;
template <int Row,int Col>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element( this_matrix const & x )
{
BOOST_QVM_STATIC_ASSERT(Row>=0);
BOOST_QVM_STATIC_ASSERT(Row<rows);
BOOST_QVM_STATIC_ASSERT(Col>=0);
BOOST_QVM_STATIC_ASSERT(Col<cols);
return Row==I ?
-mat_traits<OriginalMatrix>::template read_element<Row,Col>(reinterpret_cast<OriginalMatrix const &>(x)) :
mat_traits<OriginalMatrix>::template read_element<Row,Col>(reinterpret_cast<OriginalMatrix const &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element_idx( int row, int col, this_matrix const & x )
{
BOOST_QVM_ASSERT(row>=0);
BOOST_QVM_ASSERT(row<rows);
BOOST_QVM_ASSERT(col>=0);
BOOST_QVM_ASSERT(col<cols);
return row==I?
-mat_traits<OriginalMatrix>::read_element_idx(row,col,reinterpret_cast<OriginalMatrix const &>(x)) :
mat_traits<OriginalMatrix>::read_element_idx(row,col,reinterpret_cast<OriginalMatrix const &>(x));
}
};
template <int J,class OriginalMatrix,int R,int C>
struct
deduce_mat<qvm_detail::neg_row_<J,OriginalMatrix>,R,C>
{
typedef mat<typename mat_traits<OriginalMatrix>::scalar_type,R,C> type;
};
template <int J,class OriginalMatrix,int R,int C>
struct
deduce_mat2<qvm_detail::neg_row_<J,OriginalMatrix>,qvm_detail::neg_row_<J,OriginalMatrix>,R,C>
{
typedef mat<typename mat_traits<OriginalMatrix>::scalar_type,R,C> type;
};
template <int Row,class A>
typename boost::enable_if_c<
is_mat<A>::value,
qvm_detail::neg_row_<Row,A> const &>::type
BOOST_QVM_INLINE_TRIVIAL
neg_row( A const & a )
{
return reinterpret_cast<typename qvm_detail::neg_row_<Row,A> const &>(a);
}
////////////////////////////////////////////////
namespace
qvm_detail
{
template <int Col,class OriginalMatrix>
class
neg_col_
{
neg_col_( neg_col_ const & );
neg_col_ & operator=( neg_col_ const & );
~neg_col_();
public:
template <class T>
BOOST_QVM_INLINE_TRIVIAL
neg_col_ &
operator=( T const & x )
{
assign(*this,x);
return *this;
}
template <class R>
BOOST_QVM_INLINE_TRIVIAL
operator R() const
{
R r;
assign(r,*this);
return r;
}
};
}
template <int J,class OriginalMatrix>
struct
mat_traits< qvm_detail::neg_col_<J,OriginalMatrix> >
{
typedef qvm_detail::neg_col_<J,OriginalMatrix> this_matrix;
typedef typename mat_traits<OriginalMatrix>::scalar_type scalar_type;
static int const rows=mat_traits<OriginalMatrix>::rows;
static int const cols=mat_traits<OriginalMatrix>::cols;
template <int Row,int Col>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element( this_matrix const & x )
{
BOOST_QVM_STATIC_ASSERT(Row>=0);
BOOST_QVM_STATIC_ASSERT(Row<rows);
BOOST_QVM_STATIC_ASSERT(Col>=0);
BOOST_QVM_STATIC_ASSERT(Col<cols);
return Col==J?
-mat_traits<OriginalMatrix>::template read_element<Row,Col>(reinterpret_cast<OriginalMatrix const &>(x)) :
mat_traits<OriginalMatrix>::template read_element<Row,Col>(reinterpret_cast<OriginalMatrix const &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element_idx( int row, int col, this_matrix const & x )
{
BOOST_QVM_ASSERT(row>=0);
BOOST_QVM_ASSERT(row<rows);
BOOST_QVM_ASSERT(col>=0);
BOOST_QVM_ASSERT(col<cols);
return col==J?
-mat_traits<OriginalMatrix>::read_element_idx(row,col,reinterpret_cast<OriginalMatrix const &>(x)) :
mat_traits<OriginalMatrix>::read_element_idx(row,col,reinterpret_cast<OriginalMatrix const &>(x));
}
};
template <int J,class OriginalMatrix,int R,int C>
struct
deduce_mat<qvm_detail::neg_col_<J,OriginalMatrix>,R,C>
{
typedef mat<typename mat_traits<OriginalMatrix>::scalar_type,R,C> type;
};
template <int J,class OriginalMatrix,int R,int C>
struct
deduce_mat2<qvm_detail::neg_col_<J,OriginalMatrix>,qvm_detail::neg_col_<J,OriginalMatrix>,R,C>
{
typedef mat<typename mat_traits<OriginalMatrix>::scalar_type,R,C> type;
};
template <int Col,class A>
typename boost::enable_if_c<
is_mat<A>::value,
qvm_detail::neg_col_<Col,A> const &>::type
BOOST_QVM_INLINE_TRIVIAL
neg_col( A const & a )
{
return reinterpret_cast<typename qvm_detail::neg_col_<Col,A> const &>(a);
}
////////////////////////////////////////////////
template <class A>
typename boost::enable_if_c<
is_mat<A>::value,
qvm_detail::transposed_<A> const &>::type
BOOST_QVM_INLINE_TRIVIAL
transposed( A const & a )
{
return reinterpret_cast<typename qvm_detail::transposed_<A> const &>(a);
}
template <class A>
typename boost::enable_if_c<
is_mat<A>::value,
qvm_detail::transposed_<A> &>::type
BOOST_QVM_INLINE_TRIVIAL
transposed( A & a )
{
return reinterpret_cast<typename qvm_detail::transposed_<A> &>(a);
}
////////////////////////////////////////////////
namespace
qvm_detail
{
template <int Row1,int Row2,class OriginalMatrix>
class
swap_rows_
{
swap_rows_( swap_rows_ const & );
swap_rows_ & operator=( swap_rows_ const & );
~swap_rows_();
public:
template <class T>
BOOST_QVM_INLINE_TRIVIAL
swap_rows_ &
operator=( T const & x )
{
assign(*this,x);
return *this;
}
template <class R>
BOOST_QVM_INLINE_TRIVIAL
operator R() const
{
R r;
assign(r,*this);
return r;
}
};
}
template <int R1,int R2,class OriginalMatrix>
struct
mat_traits< qvm_detail::swap_rows_<R1,R2,OriginalMatrix> >
{
typedef qvm_detail::swap_rows_<R1,R2,OriginalMatrix> this_matrix;
typedef typename mat_traits<OriginalMatrix>::scalar_type scalar_type;
static int const rows=mat_traits<OriginalMatrix>::rows;
static int const cols=mat_traits<OriginalMatrix>::cols;
template <int Row,int Col>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element( this_matrix const & x )
{
BOOST_QVM_STATIC_ASSERT(Row>=0);
BOOST_QVM_STATIC_ASSERT(Row<rows);
BOOST_QVM_STATIC_ASSERT(Col>=0);
BOOST_QVM_STATIC_ASSERT(Col<cols);
return mat_traits<OriginalMatrix>::template read_element<(Row==R1 && R1!=R2)*R2+(Row==R2 && R1!=R2)*R1+((Row!=R1 && Row!=R2) || R1==R2)*Row,Col>(reinterpret_cast<OriginalMatrix const &>(x));
}
template <int Row,int Col>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element( this_matrix & x )
{
BOOST_QVM_STATIC_ASSERT(Row>=0);
BOOST_QVM_STATIC_ASSERT(Row<rows);
BOOST_QVM_STATIC_ASSERT(Col>=0);
BOOST_QVM_STATIC_ASSERT(Col<cols);
return mat_traits<OriginalMatrix>::template write_element<(Row==R1 && R1!=R2)*R2+(Row==R2 && R1!=R2)*R1+((Row!=R1 && Row!=R2) || R1==R2)*Row,Col>(reinterpret_cast<OriginalMatrix &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element_idx( int row, int col, this_matrix const & x )
{
BOOST_QVM_ASSERT(row>=0);
BOOST_QVM_ASSERT(row<rows);
BOOST_QVM_ASSERT(col>=0);
BOOST_QVM_ASSERT(col<cols);
return mat_traits<OriginalMatrix>::read_element_idx(row==R1?R2:row==R2?R1:row,col,reinterpret_cast<OriginalMatrix const &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element_idx( int row, int col, this_matrix & x )
{
BOOST_QVM_ASSERT(row>=0);
BOOST_QVM_ASSERT(row<rows);
BOOST_QVM_ASSERT(col>=0);
BOOST_QVM_ASSERT(col<cols);
return mat_traits<OriginalMatrix>::write_element_idx(row==R1?R2:row==R2?R1:row,col,reinterpret_cast<OriginalMatrix &>(x));
}
};
template <int R1,int R2,class OriginalMatrix,int R,int C>
struct
deduce_mat<qvm_detail::swap_rows_<R1,R2,OriginalMatrix>,R,C>
{
typedef mat<typename mat_traits<OriginalMatrix>::scalar_type,R,C> type;
};
template <int R1,int R2,class OriginalMatrix,int R,int C>
struct
deduce_mat2<qvm_detail::swap_rows_<R1,R2,OriginalMatrix>,qvm_detail::swap_rows_<R1,R2,OriginalMatrix>,R,C>
{
typedef mat<typename mat_traits<OriginalMatrix>::scalar_type,R,C> type;
};
template <int R1,int R2,class A>
typename boost::enable_if_c<
is_mat<A>::value,
qvm_detail::swap_rows_<R1,R2,A> const &>::type
BOOST_QVM_INLINE_TRIVIAL
swap_rows( A const & a )
{
return reinterpret_cast<typename qvm_detail::swap_rows_<R1,R2,A> const &>(a);
}
template <int R1,int R2,class A>
typename boost::enable_if_c<
is_mat<A>::value,
qvm_detail::swap_rows_<R1,R2,A> &>::type
BOOST_QVM_INLINE_TRIVIAL
swap_rows( A & a )
{
return reinterpret_cast<typename qvm_detail::swap_rows_<R1,R2,A> &>(a);
}
////////////////////////////////////////////////
namespace
qvm_detail
{
template <int Row1,int Row2,class OriginalMatrix>
class
swap_cols_
{
swap_cols_( swap_cols_ const & );
swap_cols_ & operator=( swap_cols_ const & );
~swap_cols_();
public:
template <class T>
BOOST_QVM_INLINE_TRIVIAL
swap_cols_ &
operator=( T const & x )
{
assign(*this,x);
return *this;
}
template <class R>
BOOST_QVM_INLINE_TRIVIAL
operator R() const
{
R r;
assign(r,*this);
return r;
}
};
}
template <int C1,int C2,class OriginalMatrix>
struct
mat_traits< qvm_detail::swap_cols_<C1,C2,OriginalMatrix> >
{
typedef qvm_detail::swap_cols_<C1,C2,OriginalMatrix> this_matrix;
typedef typename mat_traits<OriginalMatrix>::scalar_type scalar_type;
static int const rows=mat_traits<OriginalMatrix>::rows;
static int const cols=mat_traits<OriginalMatrix>::cols;
template <int Row,int Col>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element( this_matrix const & x )
{
BOOST_QVM_STATIC_ASSERT(Row>=0);
BOOST_QVM_STATIC_ASSERT(Row<rows);
BOOST_QVM_STATIC_ASSERT(Col>=0);
BOOST_QVM_STATIC_ASSERT(Col<cols);
return mat_traits<OriginalMatrix>::template read_element<Row,(Col==C1 && C1!=C2)*C2+(Col==C2 && C1!=C2)*C1+((Col!=C1 && Col!=C2) || C1==C2)*Col>(reinterpret_cast<OriginalMatrix const &>(x));
}
template <int Row,int Col>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element( this_matrix & x )
{
BOOST_QVM_STATIC_ASSERT(Row>=0);
BOOST_QVM_STATIC_ASSERT(Row<rows);
BOOST_QVM_STATIC_ASSERT(Col>=0);
BOOST_QVM_STATIC_ASSERT(Col<cols);
return mat_traits<OriginalMatrix>::template write_element<Row,(Col==C1 && C1!=C2)*C2+(Col==C2 && C1!=C2)*C1+((Col!=C1 && Col!=C2) || C1==C2)*Col>(reinterpret_cast<OriginalMatrix &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element_idx( int row, int col, this_matrix const & x )
{
BOOST_QVM_ASSERT(row>=0);
BOOST_QVM_ASSERT(row<rows);
BOOST_QVM_ASSERT(col>=0);
BOOST_QVM_ASSERT(col<cols);
return mat_traits<OriginalMatrix>::read_element_idx(row,col==C1?C2:col==C2?C1:col,reinterpret_cast<OriginalMatrix const &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element_idx( int row, int col, this_matrix & x )
{
BOOST_QVM_ASSERT(row>=0);
BOOST_QVM_ASSERT(row<rows);
BOOST_QVM_ASSERT(col>=0);
BOOST_QVM_ASSERT(col<cols);
return mat_traits<OriginalMatrix>::write_element_idx(row,col==C1?C2:col==C2?C1:col,reinterpret_cast<OriginalMatrix &>(x));
}
};
template <int C1,int C2,class OriginalMatrix,int R,int C>
struct
deduce_mat<qvm_detail::swap_cols_<C1,C2,OriginalMatrix>,R,C>
{
typedef mat<typename mat_traits<OriginalMatrix>::scalar_type,R,C> type;
};
template <int C1,int C2,class OriginalMatrix,int R,int C>
struct
deduce_mat2<qvm_detail::swap_cols_<C1,C2,OriginalMatrix>,qvm_detail::swap_cols_<C1,C2,OriginalMatrix>,R,C>
{
typedef mat<typename mat_traits<OriginalMatrix>::scalar_type,R,C> type;
};
template <int C1,int C2,class A>
typename boost::enable_if_c<
is_mat<A>::value,
qvm_detail::swap_cols_<C1,C2,A> const &>::type
BOOST_QVM_INLINE_TRIVIAL
swap_cols( A const & a )
{
return reinterpret_cast<typename qvm_detail::swap_cols_<C1,C2,A> const &>(a);
}
template <int C1,int C2,class A>
typename boost::enable_if_c<
is_mat<A>::value,
qvm_detail::swap_cols_<C1,C2,A> &>::type
BOOST_QVM_INLINE_TRIVIAL
swap_cols( A & a )
{
return reinterpret_cast<typename qvm_detail::swap_cols_<C1,C2,A> &>(a);
}
////////////////////////////////////////////////
}
}
#endif
@@ -0,0 +1,537 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_5265FC7CA1C011DE9EBDFFA956D89593
#define UUID_5265FC7CA1C011DE9EBDFFA956D89593
#include <boost/qvm/inline.hpp>
#include <boost/qvm/mat_traits.hpp>
#include <boost/qvm/deduce_vec.hpp>
#include <boost/qvm/assert.hpp>
#include <boost/qvm/enable_if.hpp>
namespace
boost
{
namespace
qvm
{
////////////////////////////////////////////////
namespace
qvm_detail
{
template <int Col,class OriginalMatrix>
class
col_
{
col_( col_ const & );
col_ & operator=( col_ const & );
~col_();
public:
template <class T>
BOOST_QVM_INLINE_TRIVIAL
col_ &
operator=( T const & x )
{
assign(*this,x);
return *this;
}
template <class R>
BOOST_QVM_INLINE_TRIVIAL
operator R() const
{
R r;
assign(r,*this);
return r;
}
};
}
template <int Col,class OriginalMatrix>
struct
vec_traits< qvm_detail::col_<Col,OriginalMatrix> >
{
typedef qvm_detail::col_<Col,OriginalMatrix> this_vector;
typedef typename mat_traits<OriginalMatrix>::scalar_type scalar_type;
static int const dim=mat_traits<OriginalMatrix>::rows;
BOOST_QVM_STATIC_ASSERT(Col>=0);
BOOST_QVM_STATIC_ASSERT(Col<mat_traits<OriginalMatrix>::cols);
template <int I>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element( this_vector const & x )
{
BOOST_QVM_STATIC_ASSERT(I>=0);
BOOST_QVM_STATIC_ASSERT(I<dim);
return mat_traits<OriginalMatrix>::template read_element<I,Col>(reinterpret_cast<OriginalMatrix const &>(x));
}
template <int I>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element( this_vector & x )
{
BOOST_QVM_STATIC_ASSERT(I>=0);
BOOST_QVM_STATIC_ASSERT(I<dim);
return mat_traits<OriginalMatrix>::template write_element<I,Col>(reinterpret_cast<OriginalMatrix &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element_idx( int i, this_vector const & x )
{
BOOST_QVM_ASSERT(i>=0);
BOOST_QVM_ASSERT(i<dim);
return mat_traits<OriginalMatrix>::read_element_idx(i,Col,reinterpret_cast<OriginalMatrix const &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element_idx( int i, this_vector & x )
{
BOOST_QVM_ASSERT(i>=0);
BOOST_QVM_ASSERT(i<dim);
return mat_traits<OriginalMatrix>::write_element_idx(i,Col,reinterpret_cast<OriginalMatrix &>(x));
}
};
template <int Col,class OriginalMatrix,int D>
struct
deduce_vec<qvm_detail::col_<Col,OriginalMatrix>,D>
{
typedef vec<typename mat_traits<OriginalMatrix>::scalar_type,D> type;
};
template <int Col,class OriginalMatrix,int D>
struct
deduce_vec2<qvm_detail::col_<Col,OriginalMatrix>,qvm_detail::col_<Col,OriginalMatrix>,D>
{
typedef vec<typename mat_traits<OriginalMatrix>::scalar_type,D> type;
};
template <int Col,class A>
typename boost::enable_if_c<
is_mat<A>::value,
qvm_detail::col_<Col,A> const &>::type
BOOST_QVM_INLINE_TRIVIAL
col( A const & a )
{
return reinterpret_cast<typename qvm_detail::col_<Col,A> const &>(a);
}
template <int Col,class A>
typename boost::enable_if_c<
is_mat<A>::value,
qvm_detail::col_<Col,A> &>::type
BOOST_QVM_INLINE_TRIVIAL
col( A & a )
{
return reinterpret_cast<typename qvm_detail::col_<Col,A> &>(a);
}
////////////////////////////////////////////////
namespace
qvm_detail
{
template <int Row,class OriginalMatrix>
class
row_
{
row_( row_ const & );
row_ & operator=( row_ const & );
~row_();
public:
template <class T>
BOOST_QVM_INLINE_TRIVIAL
row_ &
operator=( T const & x )
{
assign(*this,x);
return *this;
}
template <class R>
BOOST_QVM_INLINE_TRIVIAL
operator R() const
{
R r;
assign(r,*this);
return r;
}
};
}
template <int Row,class OriginalMatrix>
struct
vec_traits< qvm_detail::row_<Row,OriginalMatrix> >
{
typedef qvm_detail::row_<Row,OriginalMatrix> this_vector;
typedef typename mat_traits<OriginalMatrix>::scalar_type scalar_type;
static int const dim=mat_traits<OriginalMatrix>::cols;
BOOST_QVM_STATIC_ASSERT(Row>=0);
BOOST_QVM_STATIC_ASSERT(Row<mat_traits<OriginalMatrix>::rows);
template <int I>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element( this_vector const & x )
{
BOOST_QVM_STATIC_ASSERT(I>=0);
BOOST_QVM_STATIC_ASSERT(I<dim);
return mat_traits<OriginalMatrix>::template read_element<Row,I>(reinterpret_cast<OriginalMatrix const &>(x));
}
template <int I>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element( this_vector & x )
{
BOOST_QVM_STATIC_ASSERT(I>=0);
BOOST_QVM_STATIC_ASSERT(I<dim);
return mat_traits<OriginalMatrix>::template write_element<Row,I>(reinterpret_cast<OriginalMatrix &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element_idx( int i, this_vector const & x )
{
BOOST_QVM_ASSERT(i>=0);
BOOST_QVM_ASSERT(i<dim);
return mat_traits<OriginalMatrix>::read_element_idx(Row,i,reinterpret_cast<OriginalMatrix const &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element_idx( int i, this_vector & x )
{
BOOST_QVM_ASSERT(i>=0);
BOOST_QVM_ASSERT(i<dim);
return mat_traits<OriginalMatrix>::write_element_idx(Row,i,reinterpret_cast<OriginalMatrix &>(x));
}
};
template <int Row,class OriginalMatrix,int D>
struct
deduce_vec<qvm_detail::row_<Row,OriginalMatrix>,D>
{
typedef vec<typename mat_traits<OriginalMatrix>::scalar_type,D> type;
};
template <int Row,class OriginalMatrix,int D>
struct
deduce_vec2<qvm_detail::row_<Row,OriginalMatrix>,qvm_detail::row_<Row,OriginalMatrix>,D>
{
typedef vec<typename mat_traits<OriginalMatrix>::scalar_type,D> type;
};
template <int Row,class A>
typename boost::enable_if_c<
is_mat<A>::value,
qvm_detail::row_<Row,A> const &>::type
BOOST_QVM_INLINE_TRIVIAL
row( A const & a )
{
return reinterpret_cast<typename qvm_detail::row_<Row,A> const &>(a);
}
template <int Row,class A>
typename boost::enable_if_c<
is_mat<A>::value,
qvm_detail::row_<Row,A> &>::type
BOOST_QVM_INLINE_TRIVIAL
row( A & a )
{
return reinterpret_cast<typename qvm_detail::row_<Row,A> &>(a);
}
////////////////////////////////////////////////
namespace
qvm_detail
{
template <class OriginalMatrix>
class
diag_
{
diag_( diag_ const & );
diag_ & operator=( diag_ const & );
~diag_();
public:
template <class T>
BOOST_QVM_INLINE_TRIVIAL
diag_ &
operator=( T const & x )
{
assign(*this,x);
return *this;
}
template <class R>
BOOST_QVM_INLINE_TRIVIAL
operator R() const
{
R r;
assign(r,*this);
return r;
}
};
template <int X,int Y,bool Which>
struct diag_bool_dispatch;
template <int X,int Y>
struct
diag_bool_dispatch<X,Y,true>
{
static int const value=X;
};
template <int X,int Y>
struct
diag_bool_dispatch<X,Y,false>
{
static int const value=Y;
};
}
template <class OriginalMatrix>
struct
vec_traits< qvm_detail::diag_<OriginalMatrix> >
{
typedef qvm_detail::diag_<OriginalMatrix> this_vector;
typedef typename mat_traits<OriginalMatrix>::scalar_type scalar_type;
static int const dim=qvm_detail::diag_bool_dispatch<
mat_traits<OriginalMatrix>::rows,
mat_traits<OriginalMatrix>::cols,
mat_traits<OriginalMatrix>::rows<=mat_traits<OriginalMatrix>::cols>::value;
template <int I>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element( this_vector const & x )
{
BOOST_QVM_STATIC_ASSERT(I>=0);
BOOST_QVM_STATIC_ASSERT(I<dim);
return mat_traits<OriginalMatrix>::template read_element<I,I>(reinterpret_cast<OriginalMatrix const &>(x));
}
template <int I>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element( this_vector & x )
{
BOOST_QVM_STATIC_ASSERT(I>=0);
BOOST_QVM_STATIC_ASSERT(I<dim);
return mat_traits<OriginalMatrix>::template write_element<I,I>(reinterpret_cast<OriginalMatrix &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element_idx( int i, this_vector const & x )
{
BOOST_QVM_ASSERT(i>=0);
BOOST_QVM_ASSERT(i<dim);
return mat_traits<OriginalMatrix>::read_element_idx(i,i,reinterpret_cast<OriginalMatrix const &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element_idx( int i, this_vector & x )
{
BOOST_QVM_ASSERT(i>=0);
BOOST_QVM_ASSERT(i<dim);
return mat_traits<OriginalMatrix>::write_element_idx(i,i,reinterpret_cast<OriginalMatrix &>(x));
}
};
template <class OriginalMatrix,int D>
struct
deduce_vec<qvm_detail::diag_<OriginalMatrix>,D>
{
typedef vec<typename mat_traits<OriginalMatrix>::scalar_type,D> type;
};
template <class OriginalMatrix,int D>
struct
deduce_vec2<qvm_detail::diag_<OriginalMatrix>,qvm_detail::diag_<OriginalMatrix>,D>
{
typedef vec<typename mat_traits<OriginalMatrix>::scalar_type,D> type;
};
template <class A>
typename boost::enable_if_c<
is_mat<A>::value,
qvm_detail::diag_<A> const &>::type
BOOST_QVM_INLINE_TRIVIAL
diag( A const & a )
{
return reinterpret_cast<typename qvm_detail::diag_<A> const &>(a);
}
template <class A>
typename boost::enable_if_c<
is_mat<A>::value,
qvm_detail::diag_<A> &>::type
BOOST_QVM_INLINE_TRIVIAL
diag( A & a )
{
return reinterpret_cast<typename qvm_detail::diag_<A> &>(a);
}
////////////////////////////////////////////////
namespace
qvm_detail
{
template <class OriginalMatrix>
class
translation_
{
translation_( translation_ const & );
~translation_();
public:
translation_ &
operator=( translation_ const & x )
{
assign(*this,x);
return *this;
}
template <class T>
BOOST_QVM_INLINE_TRIVIAL
translation_ &
operator=( T const & x )
{
assign(*this,x);
return *this;
}
template <class R>
BOOST_QVM_INLINE_TRIVIAL
operator R() const
{
R r;
assign(r,*this);
return r;
}
};
}
template <class OriginalMatrix>
struct
vec_traits< qvm_detail::translation_<OriginalMatrix> >
{
typedef qvm_detail::translation_<OriginalMatrix> this_vector;
typedef typename mat_traits<OriginalMatrix>::scalar_type scalar_type;
static int const dim=mat_traits<OriginalMatrix>::rows-1;
BOOST_QVM_STATIC_ASSERT(mat_traits<OriginalMatrix>::rows==mat_traits<OriginalMatrix>::cols);
BOOST_QVM_STATIC_ASSERT(mat_traits<OriginalMatrix>::rows>=3);
template <int I>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element( this_vector const & x )
{
BOOST_QVM_STATIC_ASSERT(I>=0);
BOOST_QVM_STATIC_ASSERT(I<dim);
return mat_traits<OriginalMatrix>::template read_element<I,dim>(reinterpret_cast<OriginalMatrix const &>(x));
}
template <int I>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element( this_vector & x )
{
BOOST_QVM_STATIC_ASSERT(I>=0);
BOOST_QVM_STATIC_ASSERT(I<dim);
return mat_traits<OriginalMatrix>::template write_element<I,dim>(reinterpret_cast<OriginalMatrix &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element_idx( int i, this_vector const & x )
{
BOOST_QVM_ASSERT(i>=0);
BOOST_QVM_ASSERT(i<dim);
return mat_traits<OriginalMatrix>::read_element_idx(i,dim,reinterpret_cast<OriginalMatrix const &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element_idx( int i, this_vector & x )
{
BOOST_QVM_ASSERT(i>=0);
BOOST_QVM_ASSERT(i<dim);
return mat_traits<OriginalMatrix>::write_element_idx(i,dim,reinterpret_cast<OriginalMatrix &>(x));
}
};
template <class OriginalMatrix,int D>
struct
deduce_vec<qvm_detail::translation_<OriginalMatrix>,D>
{
typedef vec<typename mat_traits<OriginalMatrix>::scalar_type,D> type;
};
template <class OriginalMatrix,int D>
struct
deduce_vec2<qvm_detail::translation_<OriginalMatrix>,qvm_detail::translation_<OriginalMatrix>,D>
{
typedef vec<typename mat_traits<OriginalMatrix>::scalar_type,D> type;
};
template <class A>
typename boost::enable_if_c<
is_mat<A>::value && mat_traits<A>::rows==mat_traits<A>::cols && mat_traits<A>::rows>=3,
qvm_detail::translation_<A> const &>::type
BOOST_QVM_INLINE_TRIVIAL
translation( A const & a )
{
return reinterpret_cast<typename qvm_detail::translation_<A> const &>(a);
}
template <class A>
typename boost::enable_if_c<
is_mat<A>::value && mat_traits<A>::rows==mat_traits<A>::cols && mat_traits<A>::rows>=3,
qvm_detail::translation_<A> &>::type
BOOST_QVM_INLINE_TRIVIAL
translation( A & a )
{
return reinterpret_cast<typename qvm_detail::translation_<A> &>(a);
}
////////////////////////////////////////////////
}
}
#endif
@@ -0,0 +1,591 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_3EDF999CA1C011DEBA5C8DA956D89593
#define UUID_3EDF999CA1C011DEBA5C8DA956D89593
#include <boost/qvm/inline.hpp>
#include <boost/qvm/deduce_mat.hpp>
#include <boost/qvm/vec_traits.hpp>
#include <boost/qvm/assert.hpp>
#include <boost/qvm/enable_if.hpp>
namespace
boost
{
namespace
qvm
{
////////////////////////////////////////////////
namespace
qvm_detail
{
template <class OriginalVector>
class
col_mat_
{
col_mat_( col_mat_ const & );
col_mat_ & operator=( col_mat_ const & );
~col_mat_();
public:
template <class T>
BOOST_QVM_INLINE_TRIVIAL
col_mat_ &
operator=( T const & x )
{
assign(*this,x);
return *this;
}
template <class R>
BOOST_QVM_INLINE_TRIVIAL
operator R() const
{
R r;
assign(r,*this);
return r;
}
};
}
template <class OriginalVector>
struct
mat_traits< qvm_detail::col_mat_<OriginalVector> >
{
typedef qvm_detail::col_mat_<OriginalVector> this_matrix;
typedef typename vec_traits<OriginalVector>::scalar_type scalar_type;
static int const rows=vec_traits<OriginalVector>::dim;
static int const cols=1;
template <int Row,int Col>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element( this_matrix const & x )
{
BOOST_QVM_STATIC_ASSERT(Col==0);
BOOST_QVM_STATIC_ASSERT(Row>=0);
BOOST_QVM_STATIC_ASSERT(Row<rows);
return vec_traits<OriginalVector>::template read_element<Row>(reinterpret_cast<OriginalVector const &>(x));
}
template <int Row,int Col>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element( this_matrix & x )
{
BOOST_QVM_STATIC_ASSERT(Col==0);
BOOST_QVM_STATIC_ASSERT(Row>=0);
BOOST_QVM_STATIC_ASSERT(Row<rows);
return vec_traits<OriginalVector>::template write_element<Row>(reinterpret_cast<OriginalVector &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element_idx( int row, int col, this_matrix const & x )
{
BOOST_QVM_ASSERT(col==0);
BOOST_QVM_ASSERT(row>=0);
BOOST_QVM_ASSERT(row<rows);
return vec_traits<OriginalVector>::read_element_idx(row,reinterpret_cast<OriginalVector const &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element_idx( int row, int col, this_matrix & x )
{
BOOST_QVM_ASSERT(col==0);
BOOST_QVM_ASSERT(row>=0);
BOOST_QVM_ASSERT(row<rows);
return vec_traits<OriginalVector>::write_element_idx(row,reinterpret_cast<OriginalVector &>(x));
}
};
template <class OriginalVector,int R,int C>
struct
deduce_mat<qvm_detail::col_mat_<OriginalVector>,R,C>
{
typedef mat<typename vec_traits<OriginalVector>::scalar_type,R,C> type;
};
template <class OriginalVector,int R,int C>
struct
deduce_mat2<qvm_detail::col_mat_<OriginalVector>,qvm_detail::col_mat_<OriginalVector>,R,C>
{
typedef mat<typename vec_traits<OriginalVector>::scalar_type,R,C> type;
};
template <class A>
typename boost::enable_if_c<
is_vec<A>::value,
qvm_detail::col_mat_<A> const &>::type
BOOST_QVM_INLINE_TRIVIAL
col_mat( A const & a )
{
return reinterpret_cast<typename qvm_detail::col_mat_<A> const &>(a);
}
template <class A>
typename boost::enable_if_c<
is_vec<A>::value,
qvm_detail::col_mat_<A> &>::type
BOOST_QVM_INLINE_TRIVIAL
col_mat( A & a )
{
return reinterpret_cast<typename qvm_detail::col_mat_<A> &>(a);
}
////////////////////////////////////////////////
namespace
qvm_detail
{
template <class OriginalVector>
class
row_mat_
{
row_mat_( row_mat_ const & );
row_mat_ & operator=( row_mat_ const & );
~row_mat_();
public:
template <class T>
BOOST_QVM_INLINE_TRIVIAL
row_mat_ &
operator=( T const & x )
{
assign(*this,x);
return *this;
}
template <class R>
BOOST_QVM_INLINE_TRIVIAL
operator R() const
{
R r;
assign(r,*this);
return r;
}
};
}
template <class OriginalVector>
struct
mat_traits< qvm_detail::row_mat_<OriginalVector> >
{
typedef qvm_detail::row_mat_<OriginalVector> this_matrix;
typedef typename vec_traits<OriginalVector>::scalar_type scalar_type;
static int const rows=1;
static int const cols=vec_traits<OriginalVector>::dim;
template <int Row,int Col>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element( this_matrix const & x )
{
BOOST_QVM_STATIC_ASSERT(Row==0);
BOOST_QVM_STATIC_ASSERT(Col>=0);
BOOST_QVM_STATIC_ASSERT(Col<cols);
return vec_traits<OriginalVector>::template read_element<Col>(reinterpret_cast<OriginalVector const &>(x));
}
template <int Row,int Col>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element( this_matrix & x )
{
BOOST_QVM_STATIC_ASSERT(Row==0);
BOOST_QVM_STATIC_ASSERT(Col>=0);
BOOST_QVM_STATIC_ASSERT(Col<cols);
return vec_traits<OriginalVector>::template write_element<Col>(reinterpret_cast<OriginalVector &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element_idx( int row, int col, this_matrix const & x )
{
BOOST_QVM_ASSERT(row==0);
BOOST_QVM_ASSERT(col>=0);
BOOST_QVM_ASSERT(col<cols);
return vec_traits<OriginalVector>::read_element_idx(col,reinterpret_cast<OriginalVector const &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element_idx( int row, int col, this_matrix & x )
{
BOOST_QVM_ASSERT(row==0);
BOOST_QVM_ASSERT(col>=0);
BOOST_QVM_ASSERT(col<cols);
return vec_traits<OriginalVector>::write_element_idx(col,reinterpret_cast<OriginalVector &>(x));
}
};
template <class OriginalVector,int R,int C>
struct
deduce_mat<qvm_detail::row_mat_<OriginalVector>,R,C>
{
typedef mat<typename vec_traits<OriginalVector>::scalar_type,R,C> type;
};
template <class OriginalVector,int R,int C>
struct
deduce_mat2<qvm_detail::row_mat_<OriginalVector>,qvm_detail::row_mat_<OriginalVector>,R,C>
{
typedef mat<typename vec_traits<OriginalVector>::scalar_type,R,C> type;
};
template <class A>
typename boost::enable_if_c<
is_vec<A>::value,
qvm_detail::row_mat_<A> const &>::type
BOOST_QVM_INLINE_TRIVIAL
row_mat( A const & a )
{
return reinterpret_cast<typename qvm_detail::row_mat_<A> const &>(a);
}
template <class A>
typename boost::enable_if_c<
is_vec<A>::value,
qvm_detail::row_mat_<A> &>::type
BOOST_QVM_INLINE_TRIVIAL
row_mat( A & a )
{
return reinterpret_cast<typename qvm_detail::row_mat_<A> &>(a);
}
////////////////////////////////////////////////
namespace
qvm_detail
{
template <class OriginalVector>
class
translation_mat_
{
translation_mat_( translation_mat_ const & );
translation_mat_ & operator=( translation_mat_ const & );
~translation_mat_();
public:
template <class T>
BOOST_QVM_INLINE_TRIVIAL
translation_mat_ &
operator=( T const & x )
{
assign(*this,x);
return *this;
}
template <class R>
BOOST_QVM_INLINE_TRIVIAL
operator R() const
{
R r;
assign(r,*this);
return r;
}
};
template <class M,int Row,int Col,bool TransCol=(Col==mat_traits<M>::cols-1)>
struct read_translation_matat;
template <class OriginalVector,int Row,int Col,bool TransCol>
struct
read_translation_matat<translation_mat_<OriginalVector>,Row,Col,TransCol>
{
static
BOOST_QVM_INLINE_CRITICAL
typename mat_traits< translation_mat_<OriginalVector> >::scalar_type
f( translation_mat_<OriginalVector> const & )
{
return scalar_traits<typename mat_traits< translation_mat_<OriginalVector> >::scalar_type>::value(0);
}
};
template <class OriginalVector,int D>
struct
read_translation_matat<translation_mat_<OriginalVector>,D,D,false>
{
static
BOOST_QVM_INLINE_CRITICAL
typename mat_traits< translation_mat_<OriginalVector> >::scalar_type
f( translation_mat_<OriginalVector> const & )
{
return scalar_traits<typename mat_traits< translation_mat_<OriginalVector> >::scalar_type>::value(1);
}
};
template <class OriginalVector,int D>
struct
read_translation_matat<translation_mat_<OriginalVector>,D,D,true>
{
static
BOOST_QVM_INLINE_CRITICAL
typename mat_traits< translation_mat_<OriginalVector> >::scalar_type
f( translation_mat_<OriginalVector> const & )
{
return scalar_traits<typename mat_traits< translation_mat_<OriginalVector> >::scalar_type>::value(1);
}
};
template <class OriginalVector,int Row,int Col>
struct
read_translation_matat<translation_mat_<OriginalVector>,Row,Col,true>
{
static
BOOST_QVM_INLINE_CRITICAL
typename mat_traits< translation_mat_<OriginalVector> >::scalar_type
f( translation_mat_<OriginalVector> const & x )
{
return vec_traits<OriginalVector>::template read_element<Row>(reinterpret_cast<OriginalVector const &>(x));
}
};
}
template <class OriginalVector>
struct
mat_traits< qvm_detail::translation_mat_<OriginalVector> >
{
typedef qvm_detail::translation_mat_<OriginalVector> this_matrix;
typedef typename vec_traits<OriginalVector>::scalar_type scalar_type;
static int const rows=vec_traits<OriginalVector>::dim+1;
static int const cols=vec_traits<OriginalVector>::dim+1;
template <int Row,int Col>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element( this_matrix const & x )
{
BOOST_QVM_STATIC_ASSERT(Row>=0);
BOOST_QVM_STATIC_ASSERT(Row<rows);
BOOST_QVM_STATIC_ASSERT(Col>=0);
BOOST_QVM_STATIC_ASSERT(Col<cols);
return qvm_detail::read_translation_matat<qvm_detail::translation_mat_<OriginalVector>,Row,Col>::f(x);
}
template <int Row,int Col>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element( this_matrix & x )
{
BOOST_QVM_STATIC_ASSERT(Row>=0);
BOOST_QVM_STATIC_ASSERT(Row<rows);
BOOST_QVM_STATIC_ASSERT(Col==cols-1);
BOOST_QVM_STATIC_ASSERT(Col!=Row);
return vec_traits<OriginalVector>::template write_element<Row>(reinterpret_cast<OriginalVector &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element_idx( int row, int col, this_matrix const & x )
{
BOOST_QVM_ASSERT(row>=0);
BOOST_QVM_ASSERT(row<rows);
BOOST_QVM_ASSERT(col>=0);
BOOST_QVM_ASSERT(col<cols);
return
row==col?
scalar_traits<scalar_type>::value(1):
(col==cols-1?
vec_traits<OriginalVector>::read_element_idx(row,reinterpret_cast<OriginalVector const &>(x)):
scalar_traits<scalar_type>::value(0));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element_idx( int row, int col, this_matrix const & x )
{
BOOST_QVM_ASSERT(row>=0);
BOOST_QVM_ASSERT(row<rows);
BOOST_QVM_ASSERT(col==cols-1);
BOOST_QVM_ASSERT(col!=row);
return vec_traits<OriginalVector>::write_element_idx(row,reinterpret_cast<OriginalVector &>(x));
}
};
template <class OriginalVector,int R,int C>
struct
deduce_mat<qvm_detail::translation_mat_<OriginalVector>,R,C>
{
typedef mat<typename vec_traits<OriginalVector>::scalar_type,R,C> type;
};
template <class OriginalVector,int R,int C>
struct
deduce_mat2<qvm_detail::translation_mat_<OriginalVector>,qvm_detail::translation_mat_<OriginalVector>,R,C>
{
typedef mat<typename vec_traits<OriginalVector>::scalar_type,R,C> type;
};
template <class A>
typename boost::enable_if_c<
is_vec<A>::value,
qvm_detail::translation_mat_<A> const &>::type
BOOST_QVM_INLINE_TRIVIAL
translation_mat( A const & a )
{
return reinterpret_cast<typename qvm_detail::translation_mat_<A> const &>(a);
}
template <class A>
typename boost::enable_if_c<
is_vec<A>::value,
qvm_detail::translation_mat_<A> &>::type
BOOST_QVM_INLINE_TRIVIAL
translation_mat( A & a )
{
return reinterpret_cast<typename qvm_detail::translation_mat_<A> &>(a);
}
////////////////////////////////////////////////
namespace
qvm_detail
{
template <class OriginalVector>
class
diag_mat_
{
diag_mat_( diag_mat_ const & );
diag_mat_ & operator=( diag_mat_ const & );
~diag_mat_();
public:
template <class T>
BOOST_QVM_INLINE_TRIVIAL
diag_mat_ &
operator=( T const & x )
{
assign(*this,x);
return *this;
}
template <class R>
BOOST_QVM_INLINE_TRIVIAL
operator R() const
{
R r;
assign(r,*this);
return r;
}
};
}
template <class OriginalVector>
struct
mat_traits< qvm_detail::diag_mat_<OriginalVector> >
{
typedef qvm_detail::diag_mat_<OriginalVector> this_matrix;
typedef typename vec_traits<OriginalVector>::scalar_type scalar_type;
static int const rows=vec_traits<OriginalVector>::dim;
static int const cols=vec_traits<OriginalVector>::dim;
template <int Row,int Col>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element( this_matrix const & x )
{
BOOST_QVM_STATIC_ASSERT(Row>=0);
BOOST_QVM_STATIC_ASSERT(Row<rows);
BOOST_QVM_STATIC_ASSERT(Col>=0);
BOOST_QVM_STATIC_ASSERT(Col<cols);
return Row==Col?vec_traits<OriginalVector>::template read_element<Row>(reinterpret_cast<OriginalVector const &>(x)):scalar_traits<scalar_type>::value(0);
}
template <int Row,int Col>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element( this_matrix & x )
{
BOOST_QVM_STATIC_ASSERT(Row>=0);
BOOST_QVM_STATIC_ASSERT(Row<rows);
BOOST_QVM_STATIC_ASSERT(Row==Col);
return vec_traits<OriginalVector>::template write_element<Row>(reinterpret_cast<OriginalVector &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element_idx( int row, int col, this_matrix const & x )
{
BOOST_QVM_ASSERT(row>=0);
BOOST_QVM_ASSERT(row<rows);
BOOST_QVM_ASSERT(col>=0);
BOOST_QVM_ASSERT(col<cols);
return row==col?vec_traits<OriginalVector>::read_element_idx(row,reinterpret_cast<OriginalVector const &>(x)):scalar_traits<scalar_type>::value(0);
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element_idx( int row, int col, this_matrix & x )
{
BOOST_QVM_ASSERT(row>=0);
BOOST_QVM_ASSERT(row<rows);
BOOST_QVM_ASSERT(row==col);
return vec_traits<OriginalVector>::write_element_idx(row,reinterpret_cast<OriginalVector &>(x));
}
};
template <class OriginalVector,int R,int C>
struct
deduce_mat<qvm_detail::diag_mat_<OriginalVector>,R,C>
{
typedef mat<typename vec_traits<OriginalVector>::scalar_type,R,C> type;
};
template <class OriginalVector,int R,int C>
struct
deduce_mat2<qvm_detail::diag_mat_<OriginalVector>,qvm_detail::diag_mat_<OriginalVector>,R,C>
{
typedef mat<typename vec_traits<OriginalVector>::scalar_type,R,C> type;
};
template <class A>
typename boost::enable_if_c<
is_vec<A>::value,
qvm_detail::diag_mat_<A> const &>::type
BOOST_QVM_INLINE_TRIVIAL
diag_mat( A const & a )
{
return reinterpret_cast<typename qvm_detail::diag_mat_<A> const &>(a);
}
template <class A>
typename boost::enable_if_c<
is_vec<A>::value,
qvm_detail::diag_mat_<A> &>::type
BOOST_QVM_INLINE_TRIVIAL
diag_mat( A & a )
{
return reinterpret_cast<typename qvm_detail::diag_mat_<A> &>(a);
}
////////////////////////////////////////////////
}
}
#endif
@@ -0,0 +1,98 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_67E67D68A32F11DEA56FD18556D89593
#define UUID_67E67D68A32F11DEA56FD18556D89593
#include <boost/qvm/inline.hpp>
#include <boost/qvm/assert.hpp>
#include <boost/qvm/static_assert.hpp>
namespace
boost
{
namespace
qvm
{
template <class T,int Rows,int Cols>
struct
mat
{
T a[Rows][Cols];
template <class R>
operator R() const
{
R r;
assign(r,*this);
return r;
}
};
template <class M>
struct mat_traits;
template <class T,int Rows,int Cols>
struct
mat_traits< mat<T,Rows,Cols> >
{
typedef mat<T,Rows,Cols> this_matrix;
typedef T scalar_type;
static int const rows=Rows;
static int const cols=Cols;
template <int Row,int Col>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element( this_matrix const & x )
{
BOOST_QVM_STATIC_ASSERT(Row>=0);
BOOST_QVM_STATIC_ASSERT(Row<Rows);
BOOST_QVM_STATIC_ASSERT(Col>=0);
BOOST_QVM_STATIC_ASSERT(Col<Cols);
return x.a[Row][Col];
}
template <int Row,int Col>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element( this_matrix & x )
{
BOOST_QVM_STATIC_ASSERT(Row>=0);
BOOST_QVM_STATIC_ASSERT(Row<Rows);
BOOST_QVM_STATIC_ASSERT(Col>=0);
BOOST_QVM_STATIC_ASSERT(Col<Cols);
return x.a[Row][Col];
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element_idx( int row, int col, this_matrix const & x )
{
BOOST_QVM_ASSERT(row>=0);
BOOST_QVM_ASSERT(row<Rows);
BOOST_QVM_ASSERT(col>=0);
BOOST_QVM_ASSERT(col<Cols);
return x.a[row][col];
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element_idx( int row, int col, this_matrix & x )
{
BOOST_QVM_ASSERT(row>=0);
BOOST_QVM_ASSERT(row<Rows);
BOOST_QVM_ASSERT(col>=0);
BOOST_QVM_ASSERT(col<Cols);
return x.a[row][col];
}
};
}
}
#endif
@@ -0,0 +1,258 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_47B1D1217B411E08424FA0ADFD72085
#define UUID_47B1D1217B411E08424FA0ADFD72085
#include <boost/qvm/mat_traits.hpp>
#include <boost/qvm/inline.hpp>
#include <boost/qvm/static_assert.hpp>
#include <boost/qvm/enable_if.hpp>
namespace
boost
{
namespace
qvm
{
////////////////////////////////////////////////
template <int R,int C,class M>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_mat<M>::value,
typename mat_traits<M>::scalar_type>::type
A( M const & a )
{
BOOST_STATIC_ASSERT(R>=0);
BOOST_STATIC_ASSERT(R<mat_traits<M>::rows);
BOOST_STATIC_ASSERT(C>=0);
BOOST_STATIC_ASSERT(C<mat_traits<M>::cols);
return mat_traits<M>::template read_element<R,C>(a);
}
template <int R,int C,class M>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_mat<M>::value,
typename mat_traits<M>::scalar_type &>::type
A( M & a )
{
BOOST_STATIC_ASSERT(R>=0);
BOOST_STATIC_ASSERT(R<mat_traits<M>::rows);
BOOST_STATIC_ASSERT(C>=0);
BOOST_STATIC_ASSERT(C<mat_traits<M>::cols);
return mat_traits<M>::template write_element<R,C>(a);
}
////////////////////////////////////////////////
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A00( M const & a ) { BOOST_STATIC_ASSERT(0<mat_traits<M>::rows && 0<mat_traits<M>::cols); return mat_traits<M>::template read_element<0,0>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A01( M const & a ) { BOOST_STATIC_ASSERT(0<mat_traits<M>::rows && 1<mat_traits<M>::cols); return mat_traits<M>::template read_element<0,1>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A02( M const & a ) { BOOST_STATIC_ASSERT(0<mat_traits<M>::rows && 2<mat_traits<M>::cols); return mat_traits<M>::template read_element<0,2>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A03( M const & a ) { BOOST_STATIC_ASSERT(0<mat_traits<M>::rows && 3<mat_traits<M>::cols); return mat_traits<M>::template read_element<0,3>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A04( M const & a ) { BOOST_STATIC_ASSERT(0<mat_traits<M>::rows && 4<mat_traits<M>::cols); return mat_traits<M>::template read_element<0,4>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A05( M const & a ) { BOOST_STATIC_ASSERT(0<mat_traits<M>::rows && 5<mat_traits<M>::cols); return mat_traits<M>::template read_element<0,5>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A06( M const & a ) { BOOST_STATIC_ASSERT(0<mat_traits<M>::rows && 6<mat_traits<M>::cols); return mat_traits<M>::template read_element<0,6>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A07( M const & a ) { BOOST_STATIC_ASSERT(0<mat_traits<M>::rows && 7<mat_traits<M>::cols); return mat_traits<M>::template read_element<0,7>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A08( M const & a ) { BOOST_STATIC_ASSERT(0<mat_traits<M>::rows && 8<mat_traits<M>::cols); return mat_traits<M>::template read_element<0,8>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A09( M const & a ) { BOOST_STATIC_ASSERT(0<mat_traits<M>::rows && 9<mat_traits<M>::cols); return mat_traits<M>::template read_element<0,9>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A10( M const & a ) { BOOST_STATIC_ASSERT(1<mat_traits<M>::rows && 0<mat_traits<M>::cols); return mat_traits<M>::template read_element<1,0>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A11( M const & a ) { BOOST_STATIC_ASSERT(1<mat_traits<M>::rows && 1<mat_traits<M>::cols); return mat_traits<M>::template read_element<1,1>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A12( M const & a ) { BOOST_STATIC_ASSERT(1<mat_traits<M>::rows && 2<mat_traits<M>::cols); return mat_traits<M>::template read_element<1,2>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A13( M const & a ) { BOOST_STATIC_ASSERT(1<mat_traits<M>::rows && 3<mat_traits<M>::cols); return mat_traits<M>::template read_element<1,3>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A14( M const & a ) { BOOST_STATIC_ASSERT(1<mat_traits<M>::rows && 4<mat_traits<M>::cols); return mat_traits<M>::template read_element<1,4>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A15( M const & a ) { BOOST_STATIC_ASSERT(1<mat_traits<M>::rows && 5<mat_traits<M>::cols); return mat_traits<M>::template read_element<1,5>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A16( M const & a ) { BOOST_STATIC_ASSERT(1<mat_traits<M>::rows && 6<mat_traits<M>::cols); return mat_traits<M>::template read_element<1,6>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A17( M const & a ) { BOOST_STATIC_ASSERT(1<mat_traits<M>::rows && 7<mat_traits<M>::cols); return mat_traits<M>::template read_element<1,7>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A18( M const & a ) { BOOST_STATIC_ASSERT(1<mat_traits<M>::rows && 8<mat_traits<M>::cols); return mat_traits<M>::template read_element<1,8>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A19( M const & a ) { BOOST_STATIC_ASSERT(1<mat_traits<M>::rows && 9<mat_traits<M>::cols); return mat_traits<M>::template read_element<1,9>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A20( M const & a ) { BOOST_STATIC_ASSERT(2<mat_traits<M>::rows && 0<mat_traits<M>::cols); return mat_traits<M>::template read_element<2,0>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A21( M const & a ) { BOOST_STATIC_ASSERT(2<mat_traits<M>::rows && 1<mat_traits<M>::cols); return mat_traits<M>::template read_element<2,1>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A22( M const & a ) { BOOST_STATIC_ASSERT(2<mat_traits<M>::rows && 2<mat_traits<M>::cols); return mat_traits<M>::template read_element<2,2>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A23( M const & a ) { BOOST_STATIC_ASSERT(2<mat_traits<M>::rows && 3<mat_traits<M>::cols); return mat_traits<M>::template read_element<2,3>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A24( M const & a ) { BOOST_STATIC_ASSERT(2<mat_traits<M>::rows && 4<mat_traits<M>::cols); return mat_traits<M>::template read_element<2,4>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A25( M const & a ) { BOOST_STATIC_ASSERT(2<mat_traits<M>::rows && 5<mat_traits<M>::cols); return mat_traits<M>::template read_element<2,5>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A26( M const & a ) { BOOST_STATIC_ASSERT(2<mat_traits<M>::rows && 6<mat_traits<M>::cols); return mat_traits<M>::template read_element<2,6>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A27( M const & a ) { BOOST_STATIC_ASSERT(2<mat_traits<M>::rows && 7<mat_traits<M>::cols); return mat_traits<M>::template read_element<2,7>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A28( M const & a ) { BOOST_STATIC_ASSERT(2<mat_traits<M>::rows && 8<mat_traits<M>::cols); return mat_traits<M>::template read_element<2,8>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A29( M const & a ) { BOOST_STATIC_ASSERT(2<mat_traits<M>::rows && 9<mat_traits<M>::cols); return mat_traits<M>::template read_element<2,9>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A30( M const & a ) { BOOST_STATIC_ASSERT(3<mat_traits<M>::rows && 0<mat_traits<M>::cols); return mat_traits<M>::template read_element<3,0>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A31( M const & a ) { BOOST_STATIC_ASSERT(3<mat_traits<M>::rows && 1<mat_traits<M>::cols); return mat_traits<M>::template read_element<3,1>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A32( M const & a ) { BOOST_STATIC_ASSERT(3<mat_traits<M>::rows && 2<mat_traits<M>::cols); return mat_traits<M>::template read_element<3,2>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A33( M const & a ) { BOOST_STATIC_ASSERT(3<mat_traits<M>::rows && 3<mat_traits<M>::cols); return mat_traits<M>::template read_element<3,3>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A34( M const & a ) { BOOST_STATIC_ASSERT(3<mat_traits<M>::rows && 4<mat_traits<M>::cols); return mat_traits<M>::template read_element<3,4>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A35( M const & a ) { BOOST_STATIC_ASSERT(3<mat_traits<M>::rows && 5<mat_traits<M>::cols); return mat_traits<M>::template read_element<3,5>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A36( M const & a ) { BOOST_STATIC_ASSERT(3<mat_traits<M>::rows && 6<mat_traits<M>::cols); return mat_traits<M>::template read_element<3,6>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A37( M const & a ) { BOOST_STATIC_ASSERT(3<mat_traits<M>::rows && 7<mat_traits<M>::cols); return mat_traits<M>::template read_element<3,7>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A38( M const & a ) { BOOST_STATIC_ASSERT(3<mat_traits<M>::rows && 8<mat_traits<M>::cols); return mat_traits<M>::template read_element<3,8>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A39( M const & a ) { BOOST_STATIC_ASSERT(3<mat_traits<M>::rows && 9<mat_traits<M>::cols); return mat_traits<M>::template read_element<3,9>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A40( M const & a ) { BOOST_STATIC_ASSERT(4<mat_traits<M>::rows && 0<mat_traits<M>::cols); return mat_traits<M>::template read_element<4,0>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A41( M const & a ) { BOOST_STATIC_ASSERT(4<mat_traits<M>::rows && 1<mat_traits<M>::cols); return mat_traits<M>::template read_element<4,1>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A42( M const & a ) { BOOST_STATIC_ASSERT(4<mat_traits<M>::rows && 2<mat_traits<M>::cols); return mat_traits<M>::template read_element<4,2>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A43( M const & a ) { BOOST_STATIC_ASSERT(4<mat_traits<M>::rows && 3<mat_traits<M>::cols); return mat_traits<M>::template read_element<4,3>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A44( M const & a ) { BOOST_STATIC_ASSERT(4<mat_traits<M>::rows && 4<mat_traits<M>::cols); return mat_traits<M>::template read_element<4,4>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A45( M const & a ) { BOOST_STATIC_ASSERT(4<mat_traits<M>::rows && 5<mat_traits<M>::cols); return mat_traits<M>::template read_element<4,5>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A46( M const & a ) { BOOST_STATIC_ASSERT(4<mat_traits<M>::rows && 6<mat_traits<M>::cols); return mat_traits<M>::template read_element<4,6>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A47( M const & a ) { BOOST_STATIC_ASSERT(4<mat_traits<M>::rows && 7<mat_traits<M>::cols); return mat_traits<M>::template read_element<4,7>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A48( M const & a ) { BOOST_STATIC_ASSERT(4<mat_traits<M>::rows && 8<mat_traits<M>::cols); return mat_traits<M>::template read_element<4,8>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A49( M const & a ) { BOOST_STATIC_ASSERT(4<mat_traits<M>::rows && 9<mat_traits<M>::cols); return mat_traits<M>::template read_element<4,9>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A50( M const & a ) { BOOST_STATIC_ASSERT(5<mat_traits<M>::rows && 0<mat_traits<M>::cols); return mat_traits<M>::template read_element<5,0>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A51( M const & a ) { BOOST_STATIC_ASSERT(5<mat_traits<M>::rows && 1<mat_traits<M>::cols); return mat_traits<M>::template read_element<5,1>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A52( M const & a ) { BOOST_STATIC_ASSERT(5<mat_traits<M>::rows && 2<mat_traits<M>::cols); return mat_traits<M>::template read_element<5,2>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A53( M const & a ) { BOOST_STATIC_ASSERT(5<mat_traits<M>::rows && 3<mat_traits<M>::cols); return mat_traits<M>::template read_element<5,3>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A54( M const & a ) { BOOST_STATIC_ASSERT(5<mat_traits<M>::rows && 4<mat_traits<M>::cols); return mat_traits<M>::template read_element<5,4>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A55( M const & a ) { BOOST_STATIC_ASSERT(5<mat_traits<M>::rows && 5<mat_traits<M>::cols); return mat_traits<M>::template read_element<5,5>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A56( M const & a ) { BOOST_STATIC_ASSERT(5<mat_traits<M>::rows && 6<mat_traits<M>::cols); return mat_traits<M>::template read_element<5,6>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A57( M const & a ) { BOOST_STATIC_ASSERT(5<mat_traits<M>::rows && 7<mat_traits<M>::cols); return mat_traits<M>::template read_element<5,7>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A58( M const & a ) { BOOST_STATIC_ASSERT(5<mat_traits<M>::rows && 8<mat_traits<M>::cols); return mat_traits<M>::template read_element<5,8>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A59( M const & a ) { BOOST_STATIC_ASSERT(5<mat_traits<M>::rows && 9<mat_traits<M>::cols); return mat_traits<M>::template read_element<5,9>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A60( M const & a ) { BOOST_STATIC_ASSERT(6<mat_traits<M>::rows && 0<mat_traits<M>::cols); return mat_traits<M>::template read_element<6,0>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A61( M const & a ) { BOOST_STATIC_ASSERT(6<mat_traits<M>::rows && 1<mat_traits<M>::cols); return mat_traits<M>::template read_element<6,1>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A62( M const & a ) { BOOST_STATIC_ASSERT(6<mat_traits<M>::rows && 2<mat_traits<M>::cols); return mat_traits<M>::template read_element<6,2>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A63( M const & a ) { BOOST_STATIC_ASSERT(6<mat_traits<M>::rows && 3<mat_traits<M>::cols); return mat_traits<M>::template read_element<6,3>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A64( M const & a ) { BOOST_STATIC_ASSERT(6<mat_traits<M>::rows && 4<mat_traits<M>::cols); return mat_traits<M>::template read_element<6,4>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A65( M const & a ) { BOOST_STATIC_ASSERT(6<mat_traits<M>::rows && 5<mat_traits<M>::cols); return mat_traits<M>::template read_element<6,5>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A66( M const & a ) { BOOST_STATIC_ASSERT(6<mat_traits<M>::rows && 6<mat_traits<M>::cols); return mat_traits<M>::template read_element<6,6>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A67( M const & a ) { BOOST_STATIC_ASSERT(6<mat_traits<M>::rows && 7<mat_traits<M>::cols); return mat_traits<M>::template read_element<6,7>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A68( M const & a ) { BOOST_STATIC_ASSERT(6<mat_traits<M>::rows && 8<mat_traits<M>::cols); return mat_traits<M>::template read_element<6,8>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A69( M const & a ) { BOOST_STATIC_ASSERT(6<mat_traits<M>::rows && 9<mat_traits<M>::cols); return mat_traits<M>::template read_element<6,9>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A70( M const & a ) { BOOST_STATIC_ASSERT(7<mat_traits<M>::rows && 0<mat_traits<M>::cols); return mat_traits<M>::template read_element<7,0>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A71( M const & a ) { BOOST_STATIC_ASSERT(7<mat_traits<M>::rows && 1<mat_traits<M>::cols); return mat_traits<M>::template read_element<7,1>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A72( M const & a ) { BOOST_STATIC_ASSERT(7<mat_traits<M>::rows && 2<mat_traits<M>::cols); return mat_traits<M>::template read_element<7,2>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A73( M const & a ) { BOOST_STATIC_ASSERT(7<mat_traits<M>::rows && 3<mat_traits<M>::cols); return mat_traits<M>::template read_element<7,3>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A74( M const & a ) { BOOST_STATIC_ASSERT(7<mat_traits<M>::rows && 4<mat_traits<M>::cols); return mat_traits<M>::template read_element<7,4>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A75( M const & a ) { BOOST_STATIC_ASSERT(7<mat_traits<M>::rows && 5<mat_traits<M>::cols); return mat_traits<M>::template read_element<7,5>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A76( M const & a ) { BOOST_STATIC_ASSERT(7<mat_traits<M>::rows && 6<mat_traits<M>::cols); return mat_traits<M>::template read_element<7,6>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A77( M const & a ) { BOOST_STATIC_ASSERT(7<mat_traits<M>::rows && 7<mat_traits<M>::cols); return mat_traits<M>::template read_element<7,7>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A78( M const & a ) { BOOST_STATIC_ASSERT(7<mat_traits<M>::rows && 8<mat_traits<M>::cols); return mat_traits<M>::template read_element<7,8>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A79( M const & a ) { BOOST_STATIC_ASSERT(7<mat_traits<M>::rows && 9<mat_traits<M>::cols); return mat_traits<M>::template read_element<7,9>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A80( M const & a ) { BOOST_STATIC_ASSERT(8<mat_traits<M>::rows && 0<mat_traits<M>::cols); return mat_traits<M>::template read_element<8,0>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A81( M const & a ) { BOOST_STATIC_ASSERT(8<mat_traits<M>::rows && 1<mat_traits<M>::cols); return mat_traits<M>::template read_element<8,1>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A82( M const & a ) { BOOST_STATIC_ASSERT(8<mat_traits<M>::rows && 2<mat_traits<M>::cols); return mat_traits<M>::template read_element<8,2>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A83( M const & a ) { BOOST_STATIC_ASSERT(8<mat_traits<M>::rows && 3<mat_traits<M>::cols); return mat_traits<M>::template read_element<8,3>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A84( M const & a ) { BOOST_STATIC_ASSERT(8<mat_traits<M>::rows && 4<mat_traits<M>::cols); return mat_traits<M>::template read_element<8,4>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A85( M const & a ) { BOOST_STATIC_ASSERT(8<mat_traits<M>::rows && 5<mat_traits<M>::cols); return mat_traits<M>::template read_element<8,5>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A86( M const & a ) { BOOST_STATIC_ASSERT(8<mat_traits<M>::rows && 6<mat_traits<M>::cols); return mat_traits<M>::template read_element<8,6>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A87( M const & a ) { BOOST_STATIC_ASSERT(8<mat_traits<M>::rows && 7<mat_traits<M>::cols); return mat_traits<M>::template read_element<8,7>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A88( M const & a ) { BOOST_STATIC_ASSERT(8<mat_traits<M>::rows && 8<mat_traits<M>::cols); return mat_traits<M>::template read_element<8,8>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A89( M const & a ) { BOOST_STATIC_ASSERT(8<mat_traits<M>::rows && 9<mat_traits<M>::cols); return mat_traits<M>::template read_element<8,9>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A90( M const & a ) { BOOST_STATIC_ASSERT(9<mat_traits<M>::rows && 0<mat_traits<M>::cols); return mat_traits<M>::template read_element<9,0>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A91( M const & a ) { BOOST_STATIC_ASSERT(9<mat_traits<M>::rows && 1<mat_traits<M>::cols); return mat_traits<M>::template read_element<9,1>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A92( M const & a ) { BOOST_STATIC_ASSERT(9<mat_traits<M>::rows && 2<mat_traits<M>::cols); return mat_traits<M>::template read_element<9,2>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A93( M const & a ) { BOOST_STATIC_ASSERT(9<mat_traits<M>::rows && 3<mat_traits<M>::cols); return mat_traits<M>::template read_element<9,3>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A94( M const & a ) { BOOST_STATIC_ASSERT(9<mat_traits<M>::rows && 4<mat_traits<M>::cols); return mat_traits<M>::template read_element<9,4>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A95( M const & a ) { BOOST_STATIC_ASSERT(9<mat_traits<M>::rows && 5<mat_traits<M>::cols); return mat_traits<M>::template read_element<9,5>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A96( M const & a ) { BOOST_STATIC_ASSERT(9<mat_traits<M>::rows && 6<mat_traits<M>::cols); return mat_traits<M>::template read_element<9,6>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A97( M const & a ) { BOOST_STATIC_ASSERT(9<mat_traits<M>::rows && 7<mat_traits<M>::cols); return mat_traits<M>::template read_element<9,7>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A98( M const & a ) { BOOST_STATIC_ASSERT(9<mat_traits<M>::rows && 8<mat_traits<M>::cols); return mat_traits<M>::template read_element<9,8>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type>::type A99( M const & a ) { BOOST_STATIC_ASSERT(9<mat_traits<M>::rows && 9<mat_traits<M>::cols); return mat_traits<M>::template read_element<9,9>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A00( M & a ) { BOOST_STATIC_ASSERT(0<mat_traits<M>::rows && 0<mat_traits<M>::cols); return mat_traits<M>::template write_element<0,0>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A01( M & a ) { BOOST_STATIC_ASSERT(0<mat_traits<M>::rows && 1<mat_traits<M>::cols); return mat_traits<M>::template write_element<0,1>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A02( M & a ) { BOOST_STATIC_ASSERT(0<mat_traits<M>::rows && 2<mat_traits<M>::cols); return mat_traits<M>::template write_element<0,2>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A03( M & a ) { BOOST_STATIC_ASSERT(0<mat_traits<M>::rows && 3<mat_traits<M>::cols); return mat_traits<M>::template write_element<0,3>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A04( M & a ) { BOOST_STATIC_ASSERT(0<mat_traits<M>::rows && 4<mat_traits<M>::cols); return mat_traits<M>::template write_element<0,4>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A05( M & a ) { BOOST_STATIC_ASSERT(0<mat_traits<M>::rows && 5<mat_traits<M>::cols); return mat_traits<M>::template write_element<0,5>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A06( M & a ) { BOOST_STATIC_ASSERT(0<mat_traits<M>::rows && 6<mat_traits<M>::cols); return mat_traits<M>::template write_element<0,6>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A07( M & a ) { BOOST_STATIC_ASSERT(0<mat_traits<M>::rows && 7<mat_traits<M>::cols); return mat_traits<M>::template write_element<0,7>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A08( M & a ) { BOOST_STATIC_ASSERT(0<mat_traits<M>::rows && 8<mat_traits<M>::cols); return mat_traits<M>::template write_element<0,8>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A09( M & a ) { BOOST_STATIC_ASSERT(0<mat_traits<M>::rows && 9<mat_traits<M>::cols); return mat_traits<M>::template write_element<0,9>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A10( M & a ) { BOOST_STATIC_ASSERT(1<mat_traits<M>::rows && 0<mat_traits<M>::cols); return mat_traits<M>::template write_element<1,0>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A11( M & a ) { BOOST_STATIC_ASSERT(1<mat_traits<M>::rows && 1<mat_traits<M>::cols); return mat_traits<M>::template write_element<1,1>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A12( M & a ) { BOOST_STATIC_ASSERT(1<mat_traits<M>::rows && 2<mat_traits<M>::cols); return mat_traits<M>::template write_element<1,2>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A13( M & a ) { BOOST_STATIC_ASSERT(1<mat_traits<M>::rows && 3<mat_traits<M>::cols); return mat_traits<M>::template write_element<1,3>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A14( M & a ) { BOOST_STATIC_ASSERT(1<mat_traits<M>::rows && 4<mat_traits<M>::cols); return mat_traits<M>::template write_element<1,4>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A15( M & a ) { BOOST_STATIC_ASSERT(1<mat_traits<M>::rows && 5<mat_traits<M>::cols); return mat_traits<M>::template write_element<1,5>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A16( M & a ) { BOOST_STATIC_ASSERT(1<mat_traits<M>::rows && 6<mat_traits<M>::cols); return mat_traits<M>::template write_element<1,6>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A17( M & a ) { BOOST_STATIC_ASSERT(1<mat_traits<M>::rows && 7<mat_traits<M>::cols); return mat_traits<M>::template write_element<1,7>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A18( M & a ) { BOOST_STATIC_ASSERT(1<mat_traits<M>::rows && 8<mat_traits<M>::cols); return mat_traits<M>::template write_element<1,8>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A19( M & a ) { BOOST_STATIC_ASSERT(1<mat_traits<M>::rows && 9<mat_traits<M>::cols); return mat_traits<M>::template write_element<1,9>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A20( M & a ) { BOOST_STATIC_ASSERT(2<mat_traits<M>::rows && 0<mat_traits<M>::cols); return mat_traits<M>::template write_element<2,0>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A21( M & a ) { BOOST_STATIC_ASSERT(2<mat_traits<M>::rows && 1<mat_traits<M>::cols); return mat_traits<M>::template write_element<2,1>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A22( M & a ) { BOOST_STATIC_ASSERT(2<mat_traits<M>::rows && 2<mat_traits<M>::cols); return mat_traits<M>::template write_element<2,2>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A23( M & a ) { BOOST_STATIC_ASSERT(2<mat_traits<M>::rows && 3<mat_traits<M>::cols); return mat_traits<M>::template write_element<2,3>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A24( M & a ) { BOOST_STATIC_ASSERT(2<mat_traits<M>::rows && 4<mat_traits<M>::cols); return mat_traits<M>::template write_element<2,4>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A25( M & a ) { BOOST_STATIC_ASSERT(2<mat_traits<M>::rows && 5<mat_traits<M>::cols); return mat_traits<M>::template write_element<2,5>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A26( M & a ) { BOOST_STATIC_ASSERT(2<mat_traits<M>::rows && 6<mat_traits<M>::cols); return mat_traits<M>::template write_element<2,6>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A27( M & a ) { BOOST_STATIC_ASSERT(2<mat_traits<M>::rows && 7<mat_traits<M>::cols); return mat_traits<M>::template write_element<2,7>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A28( M & a ) { BOOST_STATIC_ASSERT(2<mat_traits<M>::rows && 8<mat_traits<M>::cols); return mat_traits<M>::template write_element<2,8>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A29( M & a ) { BOOST_STATIC_ASSERT(2<mat_traits<M>::rows && 9<mat_traits<M>::cols); return mat_traits<M>::template write_element<2,9>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A30( M & a ) { BOOST_STATIC_ASSERT(3<mat_traits<M>::rows && 0<mat_traits<M>::cols); return mat_traits<M>::template write_element<3,0>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A31( M & a ) { BOOST_STATIC_ASSERT(3<mat_traits<M>::rows && 1<mat_traits<M>::cols); return mat_traits<M>::template write_element<3,1>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A32( M & a ) { BOOST_STATIC_ASSERT(3<mat_traits<M>::rows && 2<mat_traits<M>::cols); return mat_traits<M>::template write_element<3,2>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A33( M & a ) { BOOST_STATIC_ASSERT(3<mat_traits<M>::rows && 3<mat_traits<M>::cols); return mat_traits<M>::template write_element<3,3>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A34( M & a ) { BOOST_STATIC_ASSERT(3<mat_traits<M>::rows && 4<mat_traits<M>::cols); return mat_traits<M>::template write_element<3,4>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A35( M & a ) { BOOST_STATIC_ASSERT(3<mat_traits<M>::rows && 5<mat_traits<M>::cols); return mat_traits<M>::template write_element<3,5>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A36( M & a ) { BOOST_STATIC_ASSERT(3<mat_traits<M>::rows && 6<mat_traits<M>::cols); return mat_traits<M>::template write_element<3,6>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A37( M & a ) { BOOST_STATIC_ASSERT(3<mat_traits<M>::rows && 7<mat_traits<M>::cols); return mat_traits<M>::template write_element<3,7>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A38( M & a ) { BOOST_STATIC_ASSERT(3<mat_traits<M>::rows && 8<mat_traits<M>::cols); return mat_traits<M>::template write_element<3,8>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A39( M & a ) { BOOST_STATIC_ASSERT(3<mat_traits<M>::rows && 9<mat_traits<M>::cols); return mat_traits<M>::template write_element<3,9>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A40( M & a ) { BOOST_STATIC_ASSERT(4<mat_traits<M>::rows && 0<mat_traits<M>::cols); return mat_traits<M>::template write_element<4,0>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A41( M & a ) { BOOST_STATIC_ASSERT(4<mat_traits<M>::rows && 1<mat_traits<M>::cols); return mat_traits<M>::template write_element<4,1>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A42( M & a ) { BOOST_STATIC_ASSERT(4<mat_traits<M>::rows && 2<mat_traits<M>::cols); return mat_traits<M>::template write_element<4,2>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A43( M & a ) { BOOST_STATIC_ASSERT(4<mat_traits<M>::rows && 3<mat_traits<M>::cols); return mat_traits<M>::template write_element<4,3>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A44( M & a ) { BOOST_STATIC_ASSERT(4<mat_traits<M>::rows && 4<mat_traits<M>::cols); return mat_traits<M>::template write_element<4,4>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A45( M & a ) { BOOST_STATIC_ASSERT(4<mat_traits<M>::rows && 5<mat_traits<M>::cols); return mat_traits<M>::template write_element<4,5>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A46( M & a ) { BOOST_STATIC_ASSERT(4<mat_traits<M>::rows && 6<mat_traits<M>::cols); return mat_traits<M>::template write_element<4,6>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A47( M & a ) { BOOST_STATIC_ASSERT(4<mat_traits<M>::rows && 7<mat_traits<M>::cols); return mat_traits<M>::template write_element<4,7>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A48( M & a ) { BOOST_STATIC_ASSERT(4<mat_traits<M>::rows && 8<mat_traits<M>::cols); return mat_traits<M>::template write_element<4,8>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A49( M & a ) { BOOST_STATIC_ASSERT(4<mat_traits<M>::rows && 9<mat_traits<M>::cols); return mat_traits<M>::template write_element<4,9>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A50( M & a ) { BOOST_STATIC_ASSERT(5<mat_traits<M>::rows && 0<mat_traits<M>::cols); return mat_traits<M>::template write_element<5,0>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A51( M & a ) { BOOST_STATIC_ASSERT(5<mat_traits<M>::rows && 1<mat_traits<M>::cols); return mat_traits<M>::template write_element<5,1>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A52( M & a ) { BOOST_STATIC_ASSERT(5<mat_traits<M>::rows && 2<mat_traits<M>::cols); return mat_traits<M>::template write_element<5,2>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A53( M & a ) { BOOST_STATIC_ASSERT(5<mat_traits<M>::rows && 3<mat_traits<M>::cols); return mat_traits<M>::template write_element<5,3>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A54( M & a ) { BOOST_STATIC_ASSERT(5<mat_traits<M>::rows && 4<mat_traits<M>::cols); return mat_traits<M>::template write_element<5,4>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A55( M & a ) { BOOST_STATIC_ASSERT(5<mat_traits<M>::rows && 5<mat_traits<M>::cols); return mat_traits<M>::template write_element<5,5>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A56( M & a ) { BOOST_STATIC_ASSERT(5<mat_traits<M>::rows && 6<mat_traits<M>::cols); return mat_traits<M>::template write_element<5,6>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A57( M & a ) { BOOST_STATIC_ASSERT(5<mat_traits<M>::rows && 7<mat_traits<M>::cols); return mat_traits<M>::template write_element<5,7>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A58( M & a ) { BOOST_STATIC_ASSERT(5<mat_traits<M>::rows && 8<mat_traits<M>::cols); return mat_traits<M>::template write_element<5,8>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A59( M & a ) { BOOST_STATIC_ASSERT(5<mat_traits<M>::rows && 9<mat_traits<M>::cols); return mat_traits<M>::template write_element<5,9>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A60( M & a ) { BOOST_STATIC_ASSERT(6<mat_traits<M>::rows && 0<mat_traits<M>::cols); return mat_traits<M>::template write_element<6,0>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A61( M & a ) { BOOST_STATIC_ASSERT(6<mat_traits<M>::rows && 1<mat_traits<M>::cols); return mat_traits<M>::template write_element<6,1>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A62( M & a ) { BOOST_STATIC_ASSERT(6<mat_traits<M>::rows && 2<mat_traits<M>::cols); return mat_traits<M>::template write_element<6,2>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A63( M & a ) { BOOST_STATIC_ASSERT(6<mat_traits<M>::rows && 3<mat_traits<M>::cols); return mat_traits<M>::template write_element<6,3>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A64( M & a ) { BOOST_STATIC_ASSERT(6<mat_traits<M>::rows && 4<mat_traits<M>::cols); return mat_traits<M>::template write_element<6,4>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A65( M & a ) { BOOST_STATIC_ASSERT(6<mat_traits<M>::rows && 5<mat_traits<M>::cols); return mat_traits<M>::template write_element<6,5>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A66( M & a ) { BOOST_STATIC_ASSERT(6<mat_traits<M>::rows && 6<mat_traits<M>::cols); return mat_traits<M>::template write_element<6,6>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A67( M & a ) { BOOST_STATIC_ASSERT(6<mat_traits<M>::rows && 7<mat_traits<M>::cols); return mat_traits<M>::template write_element<6,7>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A68( M & a ) { BOOST_STATIC_ASSERT(6<mat_traits<M>::rows && 8<mat_traits<M>::cols); return mat_traits<M>::template write_element<6,8>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A69( M & a ) { BOOST_STATIC_ASSERT(6<mat_traits<M>::rows && 9<mat_traits<M>::cols); return mat_traits<M>::template write_element<6,9>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A70( M & a ) { BOOST_STATIC_ASSERT(7<mat_traits<M>::rows && 0<mat_traits<M>::cols); return mat_traits<M>::template write_element<7,0>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A71( M & a ) { BOOST_STATIC_ASSERT(7<mat_traits<M>::rows && 1<mat_traits<M>::cols); return mat_traits<M>::template write_element<7,1>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A72( M & a ) { BOOST_STATIC_ASSERT(7<mat_traits<M>::rows && 2<mat_traits<M>::cols); return mat_traits<M>::template write_element<7,2>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A73( M & a ) { BOOST_STATIC_ASSERT(7<mat_traits<M>::rows && 3<mat_traits<M>::cols); return mat_traits<M>::template write_element<7,3>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A74( M & a ) { BOOST_STATIC_ASSERT(7<mat_traits<M>::rows && 4<mat_traits<M>::cols); return mat_traits<M>::template write_element<7,4>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A75( M & a ) { BOOST_STATIC_ASSERT(7<mat_traits<M>::rows && 5<mat_traits<M>::cols); return mat_traits<M>::template write_element<7,5>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A76( M & a ) { BOOST_STATIC_ASSERT(7<mat_traits<M>::rows && 6<mat_traits<M>::cols); return mat_traits<M>::template write_element<7,6>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A77( M & a ) { BOOST_STATIC_ASSERT(7<mat_traits<M>::rows && 7<mat_traits<M>::cols); return mat_traits<M>::template write_element<7,7>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A78( M & a ) { BOOST_STATIC_ASSERT(7<mat_traits<M>::rows && 8<mat_traits<M>::cols); return mat_traits<M>::template write_element<7,8>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A79( M & a ) { BOOST_STATIC_ASSERT(7<mat_traits<M>::rows && 9<mat_traits<M>::cols); return mat_traits<M>::template write_element<7,9>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A80( M & a ) { BOOST_STATIC_ASSERT(8<mat_traits<M>::rows && 0<mat_traits<M>::cols); return mat_traits<M>::template write_element<8,0>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A81( M & a ) { BOOST_STATIC_ASSERT(8<mat_traits<M>::rows && 1<mat_traits<M>::cols); return mat_traits<M>::template write_element<8,1>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A82( M & a ) { BOOST_STATIC_ASSERT(8<mat_traits<M>::rows && 2<mat_traits<M>::cols); return mat_traits<M>::template write_element<8,2>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A83( M & a ) { BOOST_STATIC_ASSERT(8<mat_traits<M>::rows && 3<mat_traits<M>::cols); return mat_traits<M>::template write_element<8,3>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A84( M & a ) { BOOST_STATIC_ASSERT(8<mat_traits<M>::rows && 4<mat_traits<M>::cols); return mat_traits<M>::template write_element<8,4>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A85( M & a ) { BOOST_STATIC_ASSERT(8<mat_traits<M>::rows && 5<mat_traits<M>::cols); return mat_traits<M>::template write_element<8,5>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A86( M & a ) { BOOST_STATIC_ASSERT(8<mat_traits<M>::rows && 6<mat_traits<M>::cols); return mat_traits<M>::template write_element<8,6>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A87( M & a ) { BOOST_STATIC_ASSERT(8<mat_traits<M>::rows && 7<mat_traits<M>::cols); return mat_traits<M>::template write_element<8,7>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A88( M & a ) { BOOST_STATIC_ASSERT(8<mat_traits<M>::rows && 8<mat_traits<M>::cols); return mat_traits<M>::template write_element<8,8>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A89( M & a ) { BOOST_STATIC_ASSERT(8<mat_traits<M>::rows && 9<mat_traits<M>::cols); return mat_traits<M>::template write_element<8,9>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A90( M & a ) { BOOST_STATIC_ASSERT(9<mat_traits<M>::rows && 0<mat_traits<M>::cols); return mat_traits<M>::template write_element<9,0>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A91( M & a ) { BOOST_STATIC_ASSERT(9<mat_traits<M>::rows && 1<mat_traits<M>::cols); return mat_traits<M>::template write_element<9,1>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A92( M & a ) { BOOST_STATIC_ASSERT(9<mat_traits<M>::rows && 2<mat_traits<M>::cols); return mat_traits<M>::template write_element<9,2>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A93( M & a ) { BOOST_STATIC_ASSERT(9<mat_traits<M>::rows && 3<mat_traits<M>::cols); return mat_traits<M>::template write_element<9,3>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A94( M & a ) { BOOST_STATIC_ASSERT(9<mat_traits<M>::rows && 4<mat_traits<M>::cols); return mat_traits<M>::template write_element<9,4>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A95( M & a ) { BOOST_STATIC_ASSERT(9<mat_traits<M>::rows && 5<mat_traits<M>::cols); return mat_traits<M>::template write_element<9,5>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A96( M & a ) { BOOST_STATIC_ASSERT(9<mat_traits<M>::rows && 6<mat_traits<M>::cols); return mat_traits<M>::template write_element<9,6>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A97( M & a ) { BOOST_STATIC_ASSERT(9<mat_traits<M>::rows && 7<mat_traits<M>::cols); return mat_traits<M>::template write_element<9,7>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A98( M & a ) { BOOST_STATIC_ASSERT(9<mat_traits<M>::rows && 8<mat_traits<M>::cols); return mat_traits<M>::template write_element<9,8>(a); }
template <class M> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_mat<M>::value,typename mat_traits<M>::scalar_type &>::type A99( M & a ) { BOOST_STATIC_ASSERT(9<mat_traits<M>::rows && 9<mat_traits<M>::cols); return mat_traits<M>::template write_element<9,9>(a); }
////////////////////////////////////////////////
}
}
#endif
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,6 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/qvm/gen/mat_operations2.hpp>
@@ -0,0 +1,6 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/qvm/gen/mat_operations3.hpp>
@@ -0,0 +1,6 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/qvm/gen/mat_operations4.hpp>
@@ -0,0 +1,33 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_8C06FE26A3E711DEA02C88BA55D89593
#define UUID_8C06FE26A3E711DEA02C88BA55D89593
namespace
boost
{
namespace
qvm
{
template <class M>
struct
mat_traits
{
static int const rows=0;
static int const cols=0;
typedef void scalar_type;
};
template <class T>
struct
is_mat
{
static bool const value=mat_traits<T>::rows>0 && mat_traits<T>::cols>0;
};
}
}
#endif
@@ -0,0 +1,118 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_FA3ED0DCA17911DEA6BBA09955D89593
#define UUID_FA3ED0DCA17911DEA6BBA09955D89593
#include <boost/qvm/inline.hpp>
#include <boost/qvm/deduce_mat.hpp>
#include <boost/qvm/detail/remove_const.hpp>
#include <boost/qvm/assert.hpp>
namespace
boost
{
namespace
qvm
{
template <class T,int R,int CR,int C>
struct
mat_traits<T[R][CR][C]>
{
static int const rows=0;
static int const cols=0;
typedef void scalar_type;
};
template <class T,int Rows,int Cols>
struct
mat_traits<T[Rows][Cols]>
{
typedef T this_matrix[Rows][Cols];
typedef typename qvm_detail::remove_const<T>::type scalar_type;
static int const rows=Rows;
static int const cols=Cols;
template <int Row,int Col>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element( this_matrix const & x )
{
BOOST_QVM_STATIC_ASSERT(Row>=0);
BOOST_QVM_STATIC_ASSERT(Row<Rows);
BOOST_QVM_STATIC_ASSERT(Col>=0);
BOOST_QVM_STATIC_ASSERT(Col<Cols);
return x[Row][Col];
}
template <int Row,int Col>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element( this_matrix & x )
{
BOOST_QVM_STATIC_ASSERT(Row>=0);
BOOST_QVM_STATIC_ASSERT(Row<Rows);
BOOST_QVM_STATIC_ASSERT(Col>=0);
BOOST_QVM_STATIC_ASSERT(Col<Cols);
return x[Row][Col];
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element_idx( int row, int col, this_matrix const & x )
{
BOOST_QVM_ASSERT(row>=0);
BOOST_QVM_ASSERT(row<Rows);
BOOST_QVM_ASSERT(col>=0);
BOOST_QVM_ASSERT(col<Cols);
return x[row][col];
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element_idx( int row, int col, this_matrix & x )
{
BOOST_QVM_ASSERT(row>=0);
BOOST_QVM_ASSERT(row<Rows);
BOOST_QVM_ASSERT(col>=0);
BOOST_QVM_ASSERT(col<Cols);
return x[row][col];
}
};
template <class T,int Rows,int Cols,int R,int C>
struct
deduce_mat<T[Rows][Cols],R,C>
{
typedef mat<T,R,C> type;
};
template <class T,int Rows,int Cols,int R,int C>
struct
deduce_mat<T const[Rows][Cols],R,C>
{
typedef mat<T,R,C> type;
};
template <class T1,class T2,int Rows,int Cols,int R,int C>
struct
deduce_mat2<T1[Rows][Cols],T2[Rows][Cols],R,C>
{
typedef mat<typename deduce_scalar<T1,T2>::type,R,C> type;
};
template <int Rows,int Cols,class T>
T (&ptr_mref( T * ptr ))[Rows][Cols]
{
return *reinterpret_cast<T (*)[Rows][Cols]>(ptr);
}
}
}
#endif
@@ -0,0 +1,95 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_FB4D5BEAC71B11E68D0EEF1707624D53
#define UUID_FB4D5BEAC71B11E68D0EEF1707624D53
#include <boost/qvm/inline.hpp>
#include <boost/qvm/assert.hpp>
namespace
boost
{
namespace
qvm
{
template <class>
struct mat_traits;
namespace
qvm_detail
{
template <int I,int N>
struct
matrix_w
{
template <class A>
static
BOOST_QVM_INLINE_CRITICAL
typename mat_traits<A>::scalar_type &
write_element_idx( int r, int c, A & a )
{
return (I/mat_traits<A>::cols)==r && (I%mat_traits<A>::cols)==c?
mat_traits<A>::template write_element<I/mat_traits<A>::cols,I%mat_traits<A>::cols>(a) :
matrix_w<I+1,N>::write_element_idx(r,c,a);
}
};
template <int N>
struct
matrix_w<N,N>
{
template <class A>
static
BOOST_QVM_INLINE_TRIVIAL
typename mat_traits<A>::scalar_type &
write_element_idx( int, int, A & a )
{
BOOST_QVM_ASSERT(0);
return mat_traits<A>::template write_element<0,0>(a);
}
};
}
template <class MatType,class ScalarType,int Rows,int Cols>
struct
mat_traits_defaults
{
typedef MatType mat_type;
typedef ScalarType scalar_type;
static int const rows=Rows;
static int const cols=Cols;
template <int Row,int Col>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element( mat_type const & x )
{
return mat_traits<mat_type>::template write_element<Row,Col>(const_cast<mat_type &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element_idx( int r, int c, mat_type const & x )
{
return mat_traits<mat_type>::write_element_idx(r,c,const_cast<mat_type &>(x));
}
protected:
static
BOOST_QVM_INLINE_TRIVIAL
scalar_type &
write_element_idx( int r, int c, mat_type & m )
{
return qvm_detail::matrix_w<0,mat_traits<mat_type>::rows*mat_traits<mat_type>::cols>::write_element_idx(r,c,m);
}
};
}
}
#endif
@@ -0,0 +1,87 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_5FD6A664ACC811DEAAFF8A8055D89593
#define UUID_5FD6A664ACC811DEAAFF8A8055D89593
#include <math.h>
#include <boost/qvm/inline.hpp>
namespace
boost
{
namespace
qvm
{
template <class T> T acos( T );
template <class T> T asin( T );
template <class T> T atan( T );
template <class T> T atan2( T, T );
template <class T> T cos( T );
template <class T> T sin( T );
template <class T> T tan( T );
template <class T> T cosh( T );
template <class T> T sinh( T );
template <class T> T tanh( T );
template <class T> T exp( T );
template <class T> T log( T );
template <class T> T log10( T );
template <class T> T mod( T , T );
template <class T> T pow( T, T );
template <class T> T sqrt( T );
template <class T> T ceil( T );
template <class T> T abs( T );
template <class T> T floor( T );
template <class T> T mod( T, T );
template <class T> T ldexp( T, int );
template <class T> T sign( T );
template <> BOOST_QVM_INLINE_TRIVIAL float acos<float>( float x ) { return ::acosf(x); }
template <> BOOST_QVM_INLINE_TRIVIAL float asin<float>( float x ) { return ::asinf(x); }
template <> BOOST_QVM_INLINE_TRIVIAL float atan<float>( float x ) { return ::atanf(x); }
template <> BOOST_QVM_INLINE_TRIVIAL float atan2<float>( float x, float y ) { return ::atan2f(x,y); }
template <> BOOST_QVM_INLINE_TRIVIAL float cos<float>( float x ) { return ::cosf(x); }
template <> BOOST_QVM_INLINE_TRIVIAL float sin<float>( float x ) { return ::sinf(x); }
template <> BOOST_QVM_INLINE_TRIVIAL float tan<float>( float x ) { return ::tanf(x); }
template <> BOOST_QVM_INLINE_TRIVIAL float cosh<float>( float x ) { return ::coshf(x); }
template <> BOOST_QVM_INLINE_TRIVIAL float sinh<float>( float x ) { return ::sinhf(x); }
template <> BOOST_QVM_INLINE_TRIVIAL float tanh<float>( float x ) { return ::tanhf(x); }
template <> BOOST_QVM_INLINE_TRIVIAL float exp<float>( float x ) { return ::expf(x); }
template <> BOOST_QVM_INLINE_TRIVIAL float log<float>( float x ) { return ::logf(x); }
template <> BOOST_QVM_INLINE_TRIVIAL float log10<float>( float x ) { return ::log10f(x); }
template <> BOOST_QVM_INLINE_TRIVIAL float mod<float>( float x, float y ) { return ::fmodf(x,y); }
template <> BOOST_QVM_INLINE_TRIVIAL float pow<float>( float x, float y ) { return ::powf(x,y); }
template <> BOOST_QVM_INLINE_TRIVIAL float sqrt<float>( float x ) { return ::sqrtf(x); }
template <> BOOST_QVM_INLINE_TRIVIAL float ceil<float>( float x ) { return ::ceilf(x); }
template <> BOOST_QVM_INLINE_TRIVIAL float abs<float>( float x ) { return ::fabsf(x); }
template <> BOOST_QVM_INLINE_TRIVIAL float floor<float>( float x ) { return ::floorf(x); }
template <> BOOST_QVM_INLINE_TRIVIAL float ldexp<float>( float x, int y ) { return ::ldexpf(x,y); }
template <> BOOST_QVM_INLINE_TRIVIAL float sign<float>( float x ) { return x<0 ? -1.f : +1.f; }
template <> BOOST_QVM_INLINE_TRIVIAL double acos<double>( double x ) { return ::acos(x); }
template <> BOOST_QVM_INLINE_TRIVIAL double asin<double>( double x ) { return ::asin(x); }
template <> BOOST_QVM_INLINE_TRIVIAL double atan<double>( double x ) { return ::atan(x); }
template <> BOOST_QVM_INLINE_TRIVIAL double atan2<double>( double x, double y ) { return ::atan2(x,y); }
template <> BOOST_QVM_INLINE_TRIVIAL double cos<double>( double x ) { return ::cos(x); }
template <> BOOST_QVM_INLINE_TRIVIAL double sin<double>( double x ) { return ::sin(x); }
template <> BOOST_QVM_INLINE_TRIVIAL double tan<double>( double x ) { return ::tan(x); }
template <> BOOST_QVM_INLINE_TRIVIAL double cosh<double>( double x ) { return ::cosh(x); }
template <> BOOST_QVM_INLINE_TRIVIAL double sinh<double>( double x ) { return ::sinh(x); }
template <> BOOST_QVM_INLINE_TRIVIAL double tanh<double>( double x ) { return ::tanh(x); }
template <> BOOST_QVM_INLINE_TRIVIAL double exp<double>( double x ) { return ::exp(x); }
template <> BOOST_QVM_INLINE_TRIVIAL double log<double>( double x ) { return ::log(x); }
template <> BOOST_QVM_INLINE_TRIVIAL double log10<double>( double x ) { return ::log10(x); }
template <> BOOST_QVM_INLINE_TRIVIAL double mod<double>( double x, double y ) { return ::fmod(x,y); }
template <> BOOST_QVM_INLINE_TRIVIAL double pow<double>( double x, double y ) { return ::pow(x,y); }
template <> BOOST_QVM_INLINE_TRIVIAL double sqrt<double>( double x ) { return ::sqrt(x); }
template <> BOOST_QVM_INLINE_TRIVIAL double ceil<double>( double x ) { return ::ceil(x); }
template <> BOOST_QVM_INLINE_TRIVIAL double abs<double>( double x ) { return ::fabs(x); }
template <> BOOST_QVM_INLINE_TRIVIAL double floor<double>( double x ) { return ::floor(x); }
template <> BOOST_QVM_INLINE_TRIVIAL double ldexp<double>( double x, int y ) { return ::ldexp(x,y); }
template <> BOOST_QVM_INLINE_TRIVIAL double sign<double>( double x ) { return x<0 ? -1.0 : +1.0; }
}
}
#endif
@@ -0,0 +1,15 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_0B9D9FB6B95D11DEA8E0305E55D89593
#define UUID_0B9D9FB6B95D11DEA8E0305E55D89593
#include <boost/qvm/quat_operations.hpp>
#include <boost/qvm/vec_operations.hpp>
#include <boost/qvm/mat_operations.hpp>
#include <boost/qvm/quat_vec_operations.hpp>
#include <boost/qvm/vec_mat_operations.hpp>
#endif
@@ -0,0 +1,68 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_49C5A1042AEF11DF9603880056D89593
#define UUID_49C5A1042AEF11DF9603880056D89593
#include <boost/qvm/inline.hpp>
#include <boost/qvm/assert.hpp>
#include <boost/qvm/static_assert.hpp>
namespace
boost
{
namespace
qvm
{
template <class T>
struct
quat
{
T a[4];
template <class R>
operator R() const
{
R r;
assign(r,*this);
return r;
}
};
template <class Q>
struct quat_traits;
template <class T>
struct
quat_traits< quat<T> >
{
typedef quat<T> this_quaternion;
typedef T scalar_type;
template <int I>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element( this_quaternion const & x )
{
BOOST_QVM_STATIC_ASSERT(I>=0);
BOOST_QVM_STATIC_ASSERT(I<4);
return x.a[I];
}
template <int I>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element( this_quaternion & x )
{
BOOST_QVM_STATIC_ASSERT(I>=0);
BOOST_QVM_STATIC_ASSERT(I<4);
return x.a[I];
}
};
}
}
#endif
@@ -0,0 +1,128 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_8AC84A2217C411E0A7AF3A1BDFD72085
#define UUID_8AC84A2217C411E0A7AF3A1BDFD72085
#include <boost/qvm/inline.hpp>
#include <boost/qvm/quat_traits.hpp>
#include <boost/qvm/deduce_vec.hpp>
#include <boost/qvm/static_assert.hpp>
#include <boost/qvm/enable_if.hpp>
namespace
boost
{
namespace
qvm
{
////////////////////////////////////////////////
namespace
qvm_detail
{
template <class Q>
struct
quat_v_
{
template <class R>
operator R() const
{
R r;
assign(r,*this);
return r;
}
private:
quat_v_( quat_v_ const & );
quat_v_ const & operator=( quat_v_ const & );
~quat_v_();
};
}
template <class V>
struct vec_traits;
template <class Q>
struct
vec_traits< qvm_detail::quat_v_<Q> >
{
typedef qvm_detail::quat_v_<Q> this_vector;
typedef typename quat_traits<Q>::scalar_type scalar_type;
static int const dim=3;
template <int I>
BOOST_QVM_INLINE_CRITICAL
static
scalar_type
read_element( this_vector const & q )
{
BOOST_QVM_STATIC_ASSERT(I>=0);
BOOST_QVM_STATIC_ASSERT(I<dim);
return quat_traits<Q>::template read_element<I+1>( reinterpret_cast<Q const &>(q) );
}
template <int I>
BOOST_QVM_INLINE_CRITICAL
static
scalar_type &
write_element( this_vector & q )
{
BOOST_QVM_STATIC_ASSERT(I>=0);
BOOST_QVM_STATIC_ASSERT(I<dim);
return quat_traits<Q>::template write_element<I+1>( reinterpret_cast<Q &>(q) );
}
};
template <class Q,int D>
struct
deduce_vec<qvm_detail::quat_v_<Q>,D>
{
typedef vec<typename quat_traits<Q>::scalar_type,D> type;
};
template <class Q,int D>
struct
deduce_vec2<qvm_detail::quat_v_<Q>,qvm_detail::quat_v_<Q>,D>
{
typedef vec<typename quat_traits<Q>::scalar_type,D> type;
};
template <class Q>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_quat<Q>::value,
qvm_detail::quat_v_<Q> const &>::type
V( Q const & a )
{
return reinterpret_cast<qvm_detail::quat_v_<Q> const &>(a);
}
template <class Q>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_quat<Q>::value,
qvm_detail::quat_v_<Q> &>::type
V( Q & a )
{
return reinterpret_cast<qvm_detail::quat_v_<Q> &>(a);
}
template <class Q> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_quat<Q>::value,typename quat_traits<Q>::scalar_type>::type S( Q const & a ) { return quat_traits<Q>::template read_element<0>(a); }
template <class Q> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_quat<Q>::value,typename quat_traits<Q>::scalar_type>::type X( Q const & a ) { return quat_traits<Q>::template read_element<1>(a); }
template <class Q> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_quat<Q>::value,typename quat_traits<Q>::scalar_type>::type Y( Q const & a ) { return quat_traits<Q>::template read_element<2>(a); }
template <class Q> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_quat<Q>::value,typename quat_traits<Q>::scalar_type>::type Z( Q const & a ) { return quat_traits<Q>::template read_element<3>(a); }
template <class Q> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_quat<Q>::value,typename quat_traits<Q>::scalar_type &>::type S( Q & a ) { return quat_traits<Q>::template write_element<0>(a); }
template <class Q> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_quat<Q>::value,typename quat_traits<Q>::scalar_type &>::type X( Q & a ) { return quat_traits<Q>::template write_element<1>(a); }
template <class Q> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_quat<Q>::value,typename quat_traits<Q>::scalar_type &>::type Y( Q & a ) { return quat_traits<Q>::template write_element<2>(a); }
template <class Q> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_quat<Q>::value,typename quat_traits<Q>::scalar_type &>::type Z( Q & a ) { return quat_traits<Q>::template write_element<3>(a); }
////////////////////////////////////////////////
}
}
#endif
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,49 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_EF321CBE275911E084A4550FDFD72085
#define UUID_EF321CBE275911E084A4550FDFD72085
namespace
boost
{
namespace
qvm
{
template <class Q>
struct
quat_traits
{
typedef void scalar_type;
};
namespace
is_quaternion_detail
{
template <class>
struct
is_void
{
static bool const value=false;
};
template <>
struct
is_void<void>
{
static bool const value=true;
};
}
template <class T>
struct
is_quat
{
static bool const value=!is_quaternion_detail::is_void<typename quat_traits<T>::scalar_type>::value;
};
}
}
#endif
@@ -0,0 +1,130 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_6D6B1EE2119A11E291554FEE6188709B
#define UUID_6D6B1EE2119A11E291554FEE6188709B
#include <boost/qvm/inline.hpp>
#include <boost/qvm/deduce_quat.hpp>
#include <boost/qvm/detail/remove_const.hpp>
#include <boost/qvm/assert.hpp>
namespace
boost
{
namespace
qvm
{
template <class T,int D>
struct
quat_traits<T[D]>
{
typedef void scalar_type;
};
template <class T,int D>
struct
quat_traits<T[D][4]>
{
typedef void scalar_type;
};
template <class T,int D>
struct
quat_traits<T[4][D]>
{
typedef void scalar_type;
};
template <class T>
struct
quat_traits<T[4][4]>
{
typedef void scalar_type;
};
template <class T,int M,int N>
struct
quat_traits<T[M][N]>
{
typedef void scalar_type;
};
template <class T>
struct
quat_traits<T[4]>
{
typedef T this_quaternion[4];
typedef typename qvm_detail::remove_const<T>::type scalar_type;
template <int I>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element( this_quaternion const & x )
{
BOOST_QVM_STATIC_ASSERT(I>=0);
BOOST_QVM_STATIC_ASSERT(I<4);
return x[I];
}
template <int I>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element( this_quaternion & x )
{
BOOST_QVM_STATIC_ASSERT(I>=0);
BOOST_QVM_STATIC_ASSERT(I<4);
return x[I];
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element_idx( int i, this_quaternion const & x )
{
BOOST_QVM_ASSERT(i>=0);
BOOST_QVM_ASSERT(i<4);
return x[i];
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element_idx( int i, this_quaternion & x )
{
BOOST_QVM_ASSERT(i>=0);
BOOST_QVM_ASSERT(i<4);
return x[i];
}
};
template <class T>
struct
deduce_quat<T[4]>
{
typedef quat<T> type;
};
template <class T>
struct
deduce_quat<T const[4]>
{
typedef quat<T> type;
};
template <class T1,class T2>
struct
deduce_quat2<T1[4],T2[4]>
{
typedef quat<typename deduce_scalar<T1,T2>::type> type;
};
template <class T>
T (&ptr_qref( T * ptr ))[4]
{
return *reinterpret_cast<T (*)[4]>(ptr);
}
}
}
#endif
@@ -0,0 +1,40 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_0595DEC2C72D11E6B6B77C2A07624D53
#define UUID_0595DEC2C72D11E6B6B77C2A07624D53
#include <boost/qvm/inline.hpp>
#include <boost/qvm/assert.hpp>
namespace
boost
{
namespace
qvm
{
template <class>
struct quat_traits;
template <class QuatType,class ScalarType>
struct
quat_traits_defaults
{
typedef QuatType quat_type;
typedef ScalarType scalar_type;
template <int I>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element( quat_type const & x )
{
return quat_traits<quat_type>::template write_element<I>(const_cast<quat_type &>(x));
}
};
}
}
#endif
@@ -0,0 +1,62 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_51968952D30A11DFAFE78CE3DFD72085
#define UUID_51968952D30A11DFAFE78CE3DFD72085
#include <boost/qvm/quat_traits.hpp>
#include <boost/qvm/deduce_vec.hpp>
#include <boost/qvm/inline.hpp>
#include <boost/qvm/enable_if.hpp>
namespace
boost
{
namespace
qvm
{
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
is_quat<A>::value &&
is_vec<B>::value && vec_traits<B>::dim==3,
deduce_vec2<A,B,3> >::type
operator*( A const & a, B const & b )
{
typedef typename deduce_vec2<A,B,3>::type R;
typedef typename quat_traits<A>::scalar_type TA;
typedef typename vec_traits<B>::scalar_type TB;
TA const aa = quat_traits<A>::template read_element<0>(a);
TA const ab = quat_traits<A>::template read_element<1>(a);
TA const ac = quat_traits<A>::template read_element<2>(a);
TA const ad = quat_traits<A>::template read_element<3>(a);
TA const t2 = aa*ab;
TA const t3 = aa*ac;
TA const t4 = aa*ad;
TA const t5 = -ab*ab;
TA const t6 = ab*ac;
TA const t7 = ab*ad;
TA const t8 = -ac*ac;
TA const t9 = ac*ad;
TA const t10 = -ad*ad;
TB const bx = vec_traits<B>::template read_element<0>(b);
TB const by = vec_traits<B>::template read_element<1>(b);
TB const bz = vec_traits<B>::template read_element<2>(b);
R r;
vec_traits<R>::template write_element<0>(r) = 2*((t8+t10)*bx + (t6-t4)*by + (t3+t7)*bz) + bx;
vec_traits<R>::template write_element<1>(r) = 2*((t4+t6)*bx + (t5+t10)*by + (t9-t2)*bz) + by;
vec_traits<R>::template write_element<2>(r) = 2*((t7-t3)*bx + (t2+t9)*by + (t5+t8)*bz) + bz;
return r;
}
namespace
sfinae
{
using ::boost::qvm::operator*;
}
}
}
#endif
@@ -0,0 +1,92 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_57E1C032B9F311DEB7D9BAFE55D89593
#define UUID_57E1C032B9F311DEB7D9BAFE55D89593
#include <boost/qvm/quat_traits.hpp>
#include <boost/qvm/vec_traits.hpp>
#include <boost/qvm/mat_traits.hpp>
#include <boost/qvm/inline.hpp>
namespace
boost
{
namespace
qvm
{
template <class Scalar>
struct
scalar_traits
{
static
BOOST_QVM_INLINE_CRITICAL
Scalar
value( int v )
{
return Scalar(v);
}
};
template <class T>
struct
is_scalar
{
static bool const value=false;
};
template <> struct is_scalar<char> { static bool const value=true; };
template <> struct is_scalar<signed char> { static bool const value=true; };
template <> struct is_scalar<unsigned char> { static bool const value=true; };
template <> struct is_scalar<signed short> { static bool const value=true; };
template <> struct is_scalar<unsigned short> { static bool const value=true; };
template <> struct is_scalar<signed int> { static bool const value=true; };
template <> struct is_scalar<unsigned int> { static bool const value=true; };
template <> struct is_scalar<signed long> { static bool const value=true; };
template <> struct is_scalar<unsigned long> { static bool const value=true; };
template <> struct is_scalar<float> { static bool const value=true; };
template <> struct is_scalar<double> { static bool const value=true; };
template <> struct is_scalar<long double> { static bool const value=true; };
namespace
qvm_detail
{
template <class A,bool M=is_mat<A>::value,bool Q=is_quat<A>::value,bool V=is_vec<A>::value>
struct
scalar_impl
{
};
template <class A>
struct
scalar_impl<A,true,false,false>
{
typedef typename mat_traits<A>::scalar_type type;
};
template <class A>
struct
scalar_impl<A,false,true,false>
{
typedef typename quat_traits<A>::scalar_type type;
};
template <class A>
struct
scalar_impl<A,false,false,true>
{
typedef typename vec_traits<A>::scalar_type type;
};
}
template <class A>
struct
scalar
{
typedef typename qvm_detail::scalar_impl<A>::type type;
};
}
}
#endif
@@ -0,0 +1,9 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_QVM_STATIC_ASSERT
#include <boost/static_assert.hpp>
#define BOOST_QVM_STATIC_ASSERT BOOST_STATIC_ASSERT
#endif
@@ -0,0 +1,13 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_3B4919D8A41411DEB0818E4C56D89593
#define UUID_3B4919D8A41411DEB0818E4C56D89593
#include <boost/qvm/swizzle2.hpp>
#include <boost/qvm/swizzle3.hpp>
#include <boost/qvm/swizzle4.hpp>
#endif
@@ -0,0 +1,6 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/qvm/gen/swizzle2.hpp>
@@ -0,0 +1,6 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/qvm/gen/swizzle3.hpp>
@@ -0,0 +1,6 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/qvm/gen/swizzle4.hpp>
@@ -0,0 +1,9 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_QVM_THROW_EXCEPTION
#include <boost/throw_exception.hpp>
#define BOOST_QVM_THROW_EXCEPTION BOOST_THROW_EXCEPTION
#endif
@@ -0,0 +1,31 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_2812944066B011E29F616DCB6188709B
#define UUID_2812944066B011E29F616DCB6188709B
#include <boost/exception/to_string.hpp>
namespace
boost
{
namespace
qvm
{
namespace
qvm_to_string_detail
{
template <class T>
std::string
to_string( T const & x )
{
using boost::to_string;
return to_string(x);
}
}
}
}
#endif
@@ -0,0 +1,89 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_44EB56F0A33711DEB31B41BB56D89593
#define UUID_44EB56F0A33711DEB31B41BB56D89593
#include <boost/qvm/inline.hpp>
#include <boost/qvm/assert.hpp>
#include <boost/qvm/static_assert.hpp>
namespace
boost
{
namespace
qvm
{
template <class T,int D>
struct
vec
{
T a[D];
template <class R>
operator R() const
{
R r;
assign(r,*this);
return r;
}
};
template <class V>
struct vec_traits;
template <class T,int Dim>
struct
vec_traits< vec<T,Dim> >
{
typedef vec<T,Dim> this_vector;
typedef T scalar_type;
static int const dim=Dim;
template <int I>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element( this_vector const & x )
{
BOOST_QVM_STATIC_ASSERT(I>=0);
BOOST_QVM_STATIC_ASSERT(I<dim);
return x.a[I];
}
template <int I>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element( this_vector & x )
{
BOOST_QVM_STATIC_ASSERT(I>=0);
BOOST_QVM_STATIC_ASSERT(I<dim);
return x.a[I];
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element_idx( int i, this_vector const & x )
{
BOOST_QVM_ASSERT(i>=0);
BOOST_QVM_ASSERT(i<dim);
return x.a[i];
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element_idx( int i, this_vector & x )
{
BOOST_QVM_ASSERT(i>=0);
BOOST_QVM_ASSERT(i<dim);
return x.a[i];
}
};
}
}
#endif
@@ -0,0 +1,82 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_10F2D1EA17B511E0BA29FE0BDFD72085
#define UUID_10F2D1EA17B511E0BA29FE0BDFD72085
#include <boost/qvm/vec_traits.hpp>
#include <boost/qvm/inline.hpp>
#include <boost/qvm/static_assert.hpp>
#include <boost/qvm/enable_if.hpp>
namespace
boost
{
namespace
qvm
{
////////////////////////////////////////////////
template <int I,class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value,
typename vec_traits<V>::scalar_type>::type
A( V const & a )
{
BOOST_STATIC_ASSERT(I>=0);
BOOST_STATIC_ASSERT(I<vec_traits<V>::dim);
return vec_traits<V>::template read_element<I>(a);
}
template <int I,class V>
BOOST_QVM_INLINE_TRIVIAL
typename enable_if_c<
is_vec<V>::value,
typename vec_traits<V>::scalar_type &>::type
A( V & a )
{
BOOST_STATIC_ASSERT(I>=0);
BOOST_STATIC_ASSERT(I<vec_traits<V>::dim);
return vec_traits<V>::template write_element<I>(a);
}
template <class V> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_vec<V>::value,typename vec_traits<V>::scalar_type>::type X( V const & a ) { BOOST_STATIC_ASSERT(0<vec_traits<V>::dim); return vec_traits<V>::template read_element<0>(a); }
template <class V> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_vec<V>::value,typename vec_traits<V>::scalar_type>::type Y( V const & a ) { BOOST_STATIC_ASSERT(1<vec_traits<V>::dim); return vec_traits<V>::template read_element<1>(a); }
template <class V> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_vec<V>::value,typename vec_traits<V>::scalar_type>::type Z( V const & a ) { BOOST_STATIC_ASSERT(2<vec_traits<V>::dim); return vec_traits<V>::template read_element<2>(a); }
template <class V> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_vec<V>::value,typename vec_traits<V>::scalar_type>::type W( V const & a ) { BOOST_STATIC_ASSERT(3<vec_traits<V>::dim); return vec_traits<V>::template read_element<3>(a); }
template <class V> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_vec<V>::value,typename vec_traits<V>::scalar_type &>::type X( V & a ) { BOOST_STATIC_ASSERT(0<vec_traits<V>::dim); return vec_traits<V>::template write_element<0>(a); }
template <class V> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_vec<V>::value,typename vec_traits<V>::scalar_type &>::type Y( V & a ) { BOOST_STATIC_ASSERT(1<vec_traits<V>::dim); return vec_traits<V>::template write_element<1>(a); }
template <class V> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_vec<V>::value,typename vec_traits<V>::scalar_type &>::type Z( V & a ) { BOOST_STATIC_ASSERT(2<vec_traits<V>::dim); return vec_traits<V>::template write_element<2>(a); }
template <class V> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_vec<V>::value,typename vec_traits<V>::scalar_type &>::type W( V & a ) { BOOST_STATIC_ASSERT(3<vec_traits<V>::dim); return vec_traits<V>::template write_element<3>(a); }
template <class V> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_vec<V>::value,typename vec_traits<V>::scalar_type>::type A0( V const & a ) { BOOST_STATIC_ASSERT(0<vec_traits<V>::dim); return vec_traits<V>::template read_element<0>(a); }
template <class V> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_vec<V>::value,typename vec_traits<V>::scalar_type>::type A1( V const & a ) { BOOST_STATIC_ASSERT(1<vec_traits<V>::dim); return vec_traits<V>::template read_element<1>(a); }
template <class V> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_vec<V>::value,typename vec_traits<V>::scalar_type>::type A2( V const & a ) { BOOST_STATIC_ASSERT(2<vec_traits<V>::dim); return vec_traits<V>::template read_element<2>(a); }
template <class V> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_vec<V>::value,typename vec_traits<V>::scalar_type>::type A3( V const & a ) { BOOST_STATIC_ASSERT(3<vec_traits<V>::dim); return vec_traits<V>::template read_element<3>(a); }
template <class V> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_vec<V>::value,typename vec_traits<V>::scalar_type>::type A4( V const & a ) { BOOST_STATIC_ASSERT(4<vec_traits<V>::dim); return vec_traits<V>::template read_element<4>(a); }
template <class V> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_vec<V>::value,typename vec_traits<V>::scalar_type>::type A5( V const & a ) { BOOST_STATIC_ASSERT(5<vec_traits<V>::dim); return vec_traits<V>::template read_element<5>(a); }
template <class V> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_vec<V>::value,typename vec_traits<V>::scalar_type>::type A6( V const & a ) { BOOST_STATIC_ASSERT(6<vec_traits<V>::dim); return vec_traits<V>::template read_element<6>(a); }
template <class V> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_vec<V>::value,typename vec_traits<V>::scalar_type>::type A7( V const & a ) { BOOST_STATIC_ASSERT(7<vec_traits<V>::dim); return vec_traits<V>::template read_element<7>(a); }
template <class V> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_vec<V>::value,typename vec_traits<V>::scalar_type>::type A8( V const & a ) { BOOST_STATIC_ASSERT(8<vec_traits<V>::dim); return vec_traits<V>::template read_element<8>(a); }
template <class V> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_vec<V>::value,typename vec_traits<V>::scalar_type>::type A9( V const & a ) { BOOST_STATIC_ASSERT(9<vec_traits<V>::dim); return vec_traits<V>::template read_element<9>(a); }
template <class V> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_vec<V>::value,typename vec_traits<V>::scalar_type &>::type A0( V & a ) { BOOST_STATIC_ASSERT(0<vec_traits<V>::dim); return vec_traits<V>::template write_element<0>(a); }
template <class V> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_vec<V>::value,typename vec_traits<V>::scalar_type &>::type A1( V & a ) { BOOST_STATIC_ASSERT(1<vec_traits<V>::dim); return vec_traits<V>::template write_element<1>(a); }
template <class V> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_vec<V>::value,typename vec_traits<V>::scalar_type &>::type A2( V & a ) { BOOST_STATIC_ASSERT(2<vec_traits<V>::dim); return vec_traits<V>::template write_element<2>(a); }
template <class V> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_vec<V>::value,typename vec_traits<V>::scalar_type &>::type A3( V & a ) { BOOST_STATIC_ASSERT(3<vec_traits<V>::dim); return vec_traits<V>::template write_element<3>(a); }
template <class V> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_vec<V>::value,typename vec_traits<V>::scalar_type &>::type A4( V & a ) { BOOST_STATIC_ASSERT(4<vec_traits<V>::dim); return vec_traits<V>::template write_element<4>(a); }
template <class V> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_vec<V>::value,typename vec_traits<V>::scalar_type &>::type A5( V & a ) { BOOST_STATIC_ASSERT(5<vec_traits<V>::dim); return vec_traits<V>::template write_element<5>(a); }
template <class V> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_vec<V>::value,typename vec_traits<V>::scalar_type &>::type A6( V & a ) { BOOST_STATIC_ASSERT(6<vec_traits<V>::dim); return vec_traits<V>::template write_element<6>(a); }
template <class V> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_vec<V>::value,typename vec_traits<V>::scalar_type &>::type A7( V & a ) { BOOST_STATIC_ASSERT(7<vec_traits<V>::dim); return vec_traits<V>::template write_element<7>(a); }
template <class V> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_vec<V>::value,typename vec_traits<V>::scalar_type &>::type A8( V & a ) { BOOST_STATIC_ASSERT(8<vec_traits<V>::dim); return vec_traits<V>::template write_element<8>(a); }
template <class V> BOOST_QVM_INLINE_TRIVIAL typename enable_if_c<is_vec<V>::value,typename vec_traits<V>::scalar_type &>::type A9( V & a ) { BOOST_STATIC_ASSERT(9<vec_traits<V>::dim); return vec_traits<V>::template write_element<9>(a); }
////////////////////////////////////////////////
}
}
#endif
@@ -0,0 +1,168 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_A61EC088D31511DFA59D2B03E0D72085
#define UUID_A61EC088D31511DFA59D2B03E0D72085
#include <boost/qvm/vec_mat_operations2.hpp>
#include <boost/qvm/vec_mat_operations3.hpp>
#include <boost/qvm/vec_mat_operations4.hpp>
namespace
boost
{
namespace
qvm
{
////////////////////////////////////////////////
namespace
qvm_detail
{
template <int M,int N>
struct
mul_mv_defined
{
static bool const value=false;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
is_mat<A>::value && is_vec<B>::value &&
mat_traits<A>::cols==vec_traits<B>::dim &&
!qvm_detail::mul_mv_defined<mat_traits<A>::rows,mat_traits<A>::cols>::value,
deduce_vec2<A,B,mat_traits<A>::rows> >::type
operator*( A const & a, B const & b )
{
typedef typename deduce_vec2<A,B,mat_traits<A>::rows>::type R;
R r;
for( int i=0; i<mat_traits<A>::rows; ++i )
{
typedef typename vec_traits<R>::scalar_type Tr;
Tr x(scalar_traits<Tr>::value(0));
for( int j=0; j<mat_traits<A>::cols; ++j )
x += mat_traits<A>::read_element_idx(i,j,a)*vec_traits<B>::read_element_idx(j,b);
vec_traits<R>::write_element_idx(i,r) = x;
}
return r;
}
namespace
qvm_detail
{
template <int M,int N>
struct
mul_vm_defined
{
static bool const value=false;
};
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
is_vec<A>::value && is_mat<B>::value &&
vec_traits<A>::dim==mat_traits<B>::rows &&
!qvm_detail::mul_vm_defined<mat_traits<B>::rows,mat_traits<B>::cols>::value,
deduce_vec2<A,B,mat_traits<B>::cols> >::type
operator*( A const & a, B const & b )
{
typedef typename deduce_vec2<A,B,mat_traits<B>::cols>::type R;
R r;
for( int i=0; i<mat_traits<B>::cols; ++i )
{
typedef typename vec_traits<R>::scalar_type Tr;
Tr x(scalar_traits<Tr>::value(0));
for( int j=0; j<mat_traits<B>::rows; ++j )
x += vec_traits<A>::read_element_idx(j,a)*mat_traits<B>::read_element_idx(j,i,b);
vec_traits<R>::write_element_idx(i,r) = x;
}
return r;
}
////////////////////////////////////////////////
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
mat_traits<A>::rows==4 && mat_traits<A>::cols==4 &&
vec_traits<B>::dim==3,
deduce_vec2<A,B,3> >::type
transform_point( A const & a, B const & b )
{
typedef typename mat_traits<A>::scalar_type Ta;
typedef typename vec_traits<B>::scalar_type Tb;
Ta const a00 = mat_traits<A>::template read_element<0,0>(a);
Ta const a01 = mat_traits<A>::template read_element<0,1>(a);
Ta const a02 = mat_traits<A>::template read_element<0,2>(a);
Ta const a03 = mat_traits<A>::template read_element<0,3>(a);
Ta const a10 = mat_traits<A>::template read_element<1,0>(a);
Ta const a11 = mat_traits<A>::template read_element<1,1>(a);
Ta const a12 = mat_traits<A>::template read_element<1,2>(a);
Ta const a13 = mat_traits<A>::template read_element<1,3>(a);
Ta const a20 = mat_traits<A>::template read_element<2,0>(a);
Ta const a21 = mat_traits<A>::template read_element<2,1>(a);
Ta const a22 = mat_traits<A>::template read_element<2,2>(a);
Ta const a23 = mat_traits<A>::template read_element<2,3>(a);
Tb const b0 = vec_traits<B>::template read_element<0>(b);
Tb const b1 = vec_traits<B>::template read_element<1>(b);
Tb const b2 = vec_traits<B>::template read_element<2>(b);
typedef typename deduce_vec2<A,B,3>::type R;
BOOST_QVM_STATIC_ASSERT(vec_traits<R>::dim==3);
R r;
vec_traits<R>::template write_element<0>(r)=a00*b0+a01*b1+a02*b2+a03;
vec_traits<R>::template write_element<1>(r)=a10*b0+a11*b1+a12*b2+a13;
vec_traits<R>::template write_element<2>(r)=a20*b0+a21*b1+a22*b2+a23;
return r;
}
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
mat_traits<A>::rows==4 && mat_traits<A>::cols==4 &&
vec_traits<B>::dim==3,
deduce_vec2<A,B,3> >::type
transform_vector( A const & a, B const & b )
{
typedef typename mat_traits<A>::scalar_type Ta;
typedef typename vec_traits<B>::scalar_type Tb;
Ta const a00 = mat_traits<A>::template read_element<0,0>(a);
Ta const a01 = mat_traits<A>::template read_element<0,1>(a);
Ta const a02 = mat_traits<A>::template read_element<0,2>(a);
Ta const a10 = mat_traits<A>::template read_element<1,0>(a);
Ta const a11 = mat_traits<A>::template read_element<1,1>(a);
Ta const a12 = mat_traits<A>::template read_element<1,2>(a);
Ta const a20 = mat_traits<A>::template read_element<2,0>(a);
Ta const a21 = mat_traits<A>::template read_element<2,1>(a);
Ta const a22 = mat_traits<A>::template read_element<2,2>(a);
Tb const b0 = vec_traits<B>::template read_element<0>(b);
Tb const b1 = vec_traits<B>::template read_element<1>(b);
Tb const b2 = vec_traits<B>::template read_element<2>(b);
typedef typename deduce_vec2<A,B,3>::type R;
BOOST_QVM_STATIC_ASSERT(vec_traits<R>::dim==3);
R r;
vec_traits<R>::template write_element<0>(r)=a00*b0+a01*b1+a02*b2;
vec_traits<R>::template write_element<1>(r)=a10*b0+a11*b1+a12*b2;
vec_traits<R>::template write_element<2>(r)=a20*b0+a21*b1+a22*b2;
return r;
}
////////////////////////////////////////////////
namespace
sfinae
{
using ::boost::qvm::operator*;
using ::boost::qvm::transform_point;
using ::boost::qvm::transform_vector;
}
////////////////////////////////////////////////
}
}
#endif
@@ -0,0 +1,6 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/qvm/gen/vec_mat_operations2.hpp>
@@ -0,0 +1,6 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/qvm/gen/vec_mat_operations3.hpp>
@@ -0,0 +1,6 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/qvm/gen/vec_mat_operations4.hpp>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,6 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/qvm/gen/vec_operations2.hpp>
@@ -0,0 +1,6 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/qvm/gen/vec_operations3.hpp>
@@ -0,0 +1,6 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/qvm/gen/vec_operations4.hpp>
@@ -0,0 +1,32 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_01224884FC4111DF9570F7E4DED72085
#define UUID_01224884FC4111DF9570F7E4DED72085
namespace
boost
{
namespace
qvm
{
template <class V>
struct
vec_traits
{
static int const dim=0;
typedef void scalar_type;
};
template <class T>
struct
is_vec
{
static bool const value=vec_traits<T>::dim>0;
};
}
}
#endif
@@ -0,0 +1,108 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_DEC6035EA1C211DEA5E8ECB856D89593
#define UUID_DEC6035EA1C211DEA5E8ECB856D89593
#include <boost/qvm/inline.hpp>
#include <boost/qvm/deduce_vec.hpp>
#include <boost/qvm/detail/remove_const.hpp>
#include <boost/qvm/assert.hpp>
namespace
boost
{
namespace
qvm
{
template <class T,int M,int N>
struct
vec_traits<T[M][N]>
{
static int const dim=0;
typedef void scalar_type;
};
template <class T,int Dim>
struct
vec_traits<T[Dim]>
{
typedef T this_vector[Dim];
typedef typename qvm_detail::remove_const<T>::type scalar_type;
static int const dim=Dim;
template <int I>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element( this_vector const & x )
{
BOOST_QVM_STATIC_ASSERT(I>=0);
BOOST_QVM_STATIC_ASSERT(I<Dim);
return x[I];
}
template <int I>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element( this_vector & x )
{
BOOST_QVM_STATIC_ASSERT(I>=0);
BOOST_QVM_STATIC_ASSERT(I<Dim);
return x[I];
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element_idx( int i, this_vector const & x )
{
BOOST_QVM_ASSERT(i>=0);
BOOST_QVM_ASSERT(i<Dim);
return x[i];
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type &
write_element_idx( int i, this_vector & x )
{
BOOST_QVM_ASSERT(i>=0);
BOOST_QVM_ASSERT(i<Dim);
return x[i];
}
};
template <class T,int Dim,int D>
struct
deduce_vec<T[Dim],D>
{
typedef vec<T,D> type;
};
template <class T,int Dim,int D>
struct
deduce_vec<T const[Dim],D>
{
typedef vec<T,D> type;
};
template <class T1,class T2,int Dim,int D>
struct
deduce_vec2<T1[Dim],T2[Dim],D>
{
typedef vec<typename deduce_scalar<T1,T2>::type,D> type;
};
template <int Dim,class T>
T (&ptr_vref( T * ptr ))[Dim]
{
return *reinterpret_cast<T (*)[Dim]>(ptr);
}
}
}
#endif
@@ -0,0 +1,94 @@
//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_DFFD61ACC72311E6955FFF1F07624D53
#define UUID_DFFD61ACC72311E6955FFF1F07624D53
#include <boost/qvm/inline.hpp>
#include <boost/qvm/assert.hpp>
namespace
boost
{
namespace
qvm
{
template <class>
struct vec_traits;
namespace
qvm_detail
{
template <int I,int N>
struct
vector_w
{
template <class A>
static
BOOST_QVM_INLINE_CRITICAL
typename vec_traits<A>::scalar_type &
write_element_idx( int i, A & a )
{
return I==i?
vec_traits<A>::template write_element<I>(a) :
vector_w<I+1,N>::write_element_idx(i,a);
}
};
template <int N>
struct
vector_w<N,N>
{
template <class A>
static
BOOST_QVM_INLINE_TRIVIAL
typename vec_traits<A>::scalar_type &
write_element_idx( int, A & a )
{
BOOST_QVM_ASSERT(0);
return vec_traits<A>::template write_element<0>(a);
}
};
}
template <class VecType,class ScalarType,int Dim>
struct
vec_traits_defaults
{
typedef VecType vec_type;
typedef ScalarType scalar_type;
static int const dim=Dim;
template <int I>
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element( vec_type const & x )
{
return vec_traits<vec_type>::template write_element<I>(const_cast<vec_type &>(x));
}
static
BOOST_QVM_INLINE_CRITICAL
scalar_type
read_element_idx( int i, vec_type const & x )
{
return vec_traits<vec_type>::write_element_idx(i,const_cast<vec_type &>(x));
}
protected:
static
BOOST_QVM_INLINE_TRIVIAL
scalar_type &
write_element_idx( int i, vec_type & m )
{
return qvm_detail::vector_w<0,vec_traits<vec_type>::dim>::write_element_idx(i,m);
}
};
}
}
#endif