/usr/include/boost/qvm
NameSizeModeActions
detail/-0755rm
gen/-0755rm
all.hpp11540644editdlrm
assert.hpp3190644editdlrm
deduce_mat.hpp26670644editdlrm
deduce_quat.hpp16340644editdlrm
deduce_scalar.hpp102900644editdlrm
deduce_vec.hpp23040644editdlrm
enable_if.hpp5840644editdlrm
error.hpp9560644editdlrm
inline.hpp9760644editdlrm
map.hpp4430644editdlrm
map_mat_mat.hpp324260644editdlrm
map_mat_vec.hpp179060644editdlrm
map_vec_mat.hpp209950644editdlrm
mat.hpp28580644editdlrm
math.hpp80310644editdlrm
mat_access.hpp570070644editdlrm
mat_operations.hpp840530644editdlrm
mat_operations2.hpp2660644editdlrm
mat_operations3.hpp2660644editdlrm
mat_operations4.hpp2660644editdlrm
mat_traits.hpp7750644editdlrm
mat_traits_array.hpp35620644editdlrm
mat_traits_defaults.hpp29140644editdlrm
operations.hpp5420644editdlrm
quat.hpp16860644editdlrm
quat_access.hpp49890644editdlrm
quat_operations.hpp535600644editdlrm
quat_traits.hpp11130644editdlrm
quat_traits_array.hpp33030644editdlrm
quat_traits_defaults.hpp10260644editdlrm
quat_vec_operations.hpp22880644editdlrm
scalar_traits.hpp29580644editdlrm
static_assert.hpp3470644editdlrm
swizzle.hpp4340644editdlrm
swizzle2.hpp2590644editdlrm
swizzle3.hpp2590644editdlrm
swizzle4.hpp2590644editdlrm
throw_exception.hpp3550644editdlrm
to_string.hpp7240644editdlrm
vec.hpp23110644editdlrm
vec_access.hpp83770644editdlrm
vec_mat_operations.hpp70190644editdlrm
vec_mat_operations2.hpp2700644editdlrm
vec_mat_operations3.hpp2700644editdlrm
vec_mat_operations4.hpp2700644editdlrm
vec_operations.hpp303680644editdlrm
vec_operations2.hpp2660644editdlrm
vec_operations3.hpp2660644editdlrm
vec_operations4.hpp2660644editdlrm
vec_register.hpp4490644editdlrm
vec_register2.hpp13580644editdlrm
vec_register3.hpp16200644editdlrm
vec_register4.hpp19180644editdlrm
vec_traits.hpp7110644editdlrm
vec_traits_array.hpp28750644editdlrm
vec_traits_defaults.hpp26900644editdlrm
Edit: /usr/include/boost/qvm/map_mat_mat.hpp (32426B)
//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_20D98340A3EB11DEB2180CD156D89593 #define BOOST_QVM_20D98340A3EB11DEB2180CD156D89593 #include #include #include #include #include namespace boost { namespace qvm { //////////////////////////////////////////////// namespace qvm_detail { template class del_row_ { del_row_( del_row_ const & ); del_row_ & operator=( del_row_ const & ); ~del_row_(); public: template BOOST_QVM_INLINE_TRIVIAL del_row_ & operator=( T const & x ) { assign(*this,x); return *this; } template BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; } template struct mat_traits< qvm_detail::del_row_ > { typedef qvm_detail::del_row_ this_matrix; typedef typename mat_traits::scalar_type scalar_type; static int const rows=mat_traits::rows-1; static int const cols=mat_traits::cols; template static BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template read_element=I),Col>(reinterpret_cast(x)); } template static BOOST_QVM_INLINE_CRITICAL scalar_type & write_element( this_matrix & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template write_element=I),Col>(reinterpret_cast(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=0); BOOST_QVM_ASSERT(col::read_element_idx(row+(row>=I),col,reinterpret_cast(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=0); BOOST_QVM_ASSERT(col::write_element_idx(row+(row>=I),col,reinterpret_cast(x)); } }; template struct deduce_mat,R,C> { typedef mat::scalar_type,R,C> type; }; template struct deduce_mat2,qvm_detail::del_row_,R,C> { typedef mat::scalar_type,R,C> type; }; template typename boost::enable_if_c< is_mat::value, qvm_detail::del_row_ const &>::type BOOST_QVM_INLINE_TRIVIAL del_row( A const & a ) { return reinterpret_cast const &>(a); } template typename boost::enable_if_c< is_mat::value, qvm_detail::del_row_ &>::type BOOST_QVM_INLINE_TRIVIAL del_row( A & a ) { return reinterpret_cast &>(a); } //////////////////////////////////////////////// namespace qvm_detail { template class del_col_ { del_col_( del_col_ const & ); del_col_ & operator=( del_col_ const & ); ~del_col_(); public: template BOOST_QVM_INLINE_TRIVIAL del_col_ & operator=( T const & x ) { assign(*this,x); return *this; } template BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; } template struct mat_traits< qvm_detail::del_col_ > { typedef qvm_detail::del_col_ this_matrix; typedef typename mat_traits::scalar_type scalar_type; static int const rows=mat_traits::rows; static int const cols=mat_traits::cols-1; template static BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template read_element=J)>(reinterpret_cast(x)); } template static BOOST_QVM_INLINE_CRITICAL scalar_type & write_element( this_matrix & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template write_element=J)>(reinterpret_cast(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=0); BOOST_QVM_ASSERT(col::read_element_idx(row,col+(col>=J),reinterpret_cast(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=0); BOOST_QVM_ASSERT(col::write_element_idx(row,col+(col>=J),reinterpret_cast(x)); } }; template struct deduce_mat,R,C> { typedef mat::scalar_type,R,C> type; }; template struct deduce_mat2,qvm_detail::del_col_,R,C> { typedef mat::scalar_type,R,C> type; }; template typename boost::enable_if_c< is_mat::value, qvm_detail::del_col_ const &>::type BOOST_QVM_INLINE_TRIVIAL del_col( A const & a ) { return reinterpret_cast const &>(a); } template typename boost::enable_if_c< is_mat::value, qvm_detail::del_col_ &>::type BOOST_QVM_INLINE_TRIVIAL del_col( A & a ) { return reinterpret_cast &>(a); } //////////////////////////////////////////////// namespace qvm_detail { template 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 BOOST_QVM_INLINE_TRIVIAL del_row_col_ & operator=( T const & x ) { assign(*this,x); return *this; } template BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; } template struct mat_traits< qvm_detail::del_row_col_ > { typedef qvm_detail::del_row_col_ this_matrix; typedef typename mat_traits::scalar_type scalar_type; static int const rows=mat_traits::rows-1; static int const cols=mat_traits::cols-1; template static BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template read_element=I),Col+(Col>=J)>(reinterpret_cast(x)); } template static BOOST_QVM_INLINE_CRITICAL scalar_type & write_element( this_matrix & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template write_element=I),Col+(Col>=J)>(reinterpret_cast(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=0); BOOST_QVM_ASSERT(col::read_element_idx(row+(row>=I),col+(col>=J),reinterpret_cast(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=0); BOOST_QVM_ASSERT(col::write_element_idx(row+(row>=I),col+(col>=J),reinterpret_cast(x)); } }; template struct deduce_mat,R,C> { typedef mat::scalar_type,R,C> type; }; template struct deduce_mat2,qvm_detail::del_row_col_,R,C> { typedef mat::scalar_type,R,C> type; }; template typename boost::enable_if_c< is_mat::value, qvm_detail::del_row_col_ const &>::type BOOST_QVM_INLINE_TRIVIAL del_row_col( A const & a ) { return reinterpret_cast const &>(a); } template typename boost::enable_if_c< is_mat::value, qvm_detail::del_row_col_ &>::type BOOST_QVM_INLINE_TRIVIAL del_row_col( A & a ) { return reinterpret_cast &>(a); } //////////////////////////////////////////////// namespace qvm_detail { template class neg_row_ { neg_row_( neg_row_ const & ); neg_row_ & operator=( neg_row_ const & ); ~neg_row_(); public: template BOOST_QVM_INLINE_TRIVIAL neg_row_ & operator=( T const & x ) { assign(*this,x); return *this; } template BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; } template struct mat_traits< qvm_detail::neg_row_ > { typedef qvm_detail::neg_row_ this_matrix; typedef typename mat_traits::scalar_type scalar_type; static int const rows=mat_traits::rows; static int const cols=mat_traits::cols; template static BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template read_element(reinterpret_cast(x)) : mat_traits::template read_element(reinterpret_cast(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=0); BOOST_QVM_ASSERT(col::read_element_idx(row,col,reinterpret_cast(x)) : mat_traits::read_element_idx(row,col,reinterpret_cast(x)); } }; template struct deduce_mat,R,C> { typedef mat::scalar_type,R,C> type; }; template struct deduce_mat2,qvm_detail::neg_row_,R,C> { typedef mat::scalar_type,R,C> type; }; template typename boost::enable_if_c< is_mat::value, qvm_detail::neg_row_ const &>::type BOOST_QVM_INLINE_TRIVIAL neg_row( A const & a ) { return reinterpret_cast const &>(a); } //////////////////////////////////////////////// namespace qvm_detail { template class neg_col_ { neg_col_( neg_col_ const & ); neg_col_ & operator=( neg_col_ const & ); ~neg_col_(); public: template BOOST_QVM_INLINE_TRIVIAL neg_col_ & operator=( T const & x ) { assign(*this,x); return *this; } template BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; } template struct mat_traits< qvm_detail::neg_col_ > { typedef qvm_detail::neg_col_ this_matrix; typedef typename mat_traits::scalar_type scalar_type; static int const rows=mat_traits::rows; static int const cols=mat_traits::cols; template static BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template read_element(reinterpret_cast(x)) : mat_traits::template read_element(reinterpret_cast(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=0); BOOST_QVM_ASSERT(col::read_element_idx(row,col,reinterpret_cast(x)) : mat_traits::read_element_idx(row,col,reinterpret_cast(x)); } }; template struct deduce_mat,R,C> { typedef mat::scalar_type,R,C> type; }; template struct deduce_mat2,qvm_detail::neg_col_,R,C> { typedef mat::scalar_type,R,C> type; }; template typename boost::enable_if_c< is_mat::value, qvm_detail::neg_col_ const &>::type BOOST_QVM_INLINE_TRIVIAL neg_col( A const & a ) { return reinterpret_cast const &>(a); } //////////////////////////////////////////////// template typename boost::enable_if_c< is_mat::value, qvm_detail::transposed_ const &>::type BOOST_QVM_INLINE_TRIVIAL transposed( A const & a ) { return reinterpret_cast const &>(a); } template typename boost::enable_if_c< is_mat::value, qvm_detail::transposed_ &>::type BOOST_QVM_INLINE_TRIVIAL transposed( A & a ) { return reinterpret_cast &>(a); } //////////////////////////////////////////////// namespace qvm_detail { template class swap_rows_ { swap_rows_( swap_rows_ const & ); swap_rows_ & operator=( swap_rows_ const & ); ~swap_rows_(); public: template BOOST_QVM_INLINE_TRIVIAL swap_rows_ & operator=( T const & x ) { assign(*this,x); return *this; } template BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; } template struct mat_traits< qvm_detail::swap_rows_ > { typedef qvm_detail::swap_rows_ this_matrix; typedef typename mat_traits::scalar_type scalar_type; static int const rows=mat_traits::rows; static int const cols=mat_traits::cols; template static BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template read_element<(Row==R1 && R1!=R2)*R2+(Row==R2 && R1!=R2)*R1+((Row!=R1 && Row!=R2) || R1==R2)*Row,Col>(reinterpret_cast(x)); } template static BOOST_QVM_INLINE_CRITICAL scalar_type & write_element( this_matrix & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template write_element<(Row==R1 && R1!=R2)*R2+(Row==R2 && R1!=R2)*R1+((Row!=R1 && Row!=R2) || R1==R2)*Row,Col>(reinterpret_cast(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=0); BOOST_QVM_ASSERT(col::read_element_idx(row==R1?R2:row==R2?R1:row,col,reinterpret_cast(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=0); BOOST_QVM_ASSERT(col::write_element_idx(row==R1?R2:row==R2?R1:row,col,reinterpret_cast(x)); } }; template struct deduce_mat,R,C> { typedef mat::scalar_type,R,C> type; }; template struct deduce_mat2,qvm_detail::swap_rows_,R,C> { typedef mat::scalar_type,R,C> type; }; template typename boost::enable_if_c< is_mat::value, qvm_detail::swap_rows_ const &>::type BOOST_QVM_INLINE_TRIVIAL swap_rows( A const & a ) { return reinterpret_cast const &>(a); } template typename boost::enable_if_c< is_mat::value, qvm_detail::swap_rows_ &>::type BOOST_QVM_INLINE_TRIVIAL swap_rows( A & a ) { return reinterpret_cast &>(a); } //////////////////////////////////////////////// namespace qvm_detail { template class swap_cols_ { swap_cols_( swap_cols_ const & ); swap_cols_ & operator=( swap_cols_ const & ); ~swap_cols_(); public: template BOOST_QVM_INLINE_TRIVIAL swap_cols_ & operator=( T const & x ) { assign(*this,x); return *this; } template BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; } template struct mat_traits< qvm_detail::swap_cols_ > { typedef qvm_detail::swap_cols_ this_matrix; typedef typename mat_traits::scalar_type scalar_type; static int const rows=mat_traits::rows; static int const cols=mat_traits::cols; template static BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template read_element(reinterpret_cast(x)); } template static BOOST_QVM_INLINE_CRITICAL scalar_type & write_element( this_matrix & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template write_element(reinterpret_cast(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=0); BOOST_QVM_ASSERT(col::read_element_idx(row,col==C1?C2:col==C2?C1:col,reinterpret_cast(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=0); BOOST_QVM_ASSERT(col::write_element_idx(row,col==C1?C2:col==C2?C1:col,reinterpret_cast(x)); } }; template struct deduce_mat,R,C> { typedef mat::scalar_type,R,C> type; }; template struct deduce_mat2,qvm_detail::swap_cols_,R,C> { typedef mat::scalar_type,R,C> type; }; template typename boost::enable_if_c< is_mat::value, qvm_detail::swap_cols_ const &>::type BOOST_QVM_INLINE_TRIVIAL swap_cols( A const & a ) { return reinterpret_cast const &>(a); } template typename boost::enable_if_c< is_mat::value, qvm_detail::swap_cols_ &>::type BOOST_QVM_INLINE_TRIVIAL swap_cols( A & a ) { return reinterpret_cast &>(a); } //////////////////////////////////////////////// } } #endif