#ifndef BOOST_QVM_DETAIL_TRANSP_IMPL_HPP_INCLUDED #define BOOST_QVM_DETAIL_TRANSP_IMPL_HPP_INCLUDED /// Copyright (c) 2008-2021 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 #include #include namespace boost { namespace qvm { namespace qvm_detail { template class transposed_ { transposed_( transposed_ const & ); transposed_ & operator=( transposed_ const & ); ~transposed_(); public: template BOOST_QVM_INLINE_TRIVIAL transposed_ & 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::transposed_ > { typedef typename mat_traits::scalar_type scalar_type; typedef qvm_detail::transposed_ this_matrix; static int const rows=mat_traits::cols; static int const cols=mat_traits::rows; 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(col,row,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(col,row,reinterpret_cast(x)); } }; template struct deduce_mat,R,C> { typedef mat::scalar_type,R,C> type; }; template struct deduce_mat2,qvm_detail::transposed_,R,C> { typedef mat::scalar_type,R,C> type; }; } } #endif