1 //Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
3 //Distributed under the Boost Software License, Version 1.0. (See accompanying
4 //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 #ifndef UUID_67E67D68A32F11DEA56FD18556D89593
7 #define UUID_67E67D68A32F11DEA56FD18556D89593
9 #include <boost/qvm/detail/mat_assign.hpp>
10 #include <boost/qvm/assert.hpp>
11 #include <boost/qvm/static_assert.hpp>
19 template <class T,int Rows,int Cols>
36 template <class T,int Rows,int Cols>
38 mat_traits< mat<T,Rows,Cols> >
40 typedef mat<T,Rows,Cols> this_matrix;
41 typedef T scalar_type;
42 static int const rows=Rows;
43 static int const cols=Cols;
45 template <int Row,int Col>
47 BOOST_QVM_INLINE_CRITICAL
49 read_element( this_matrix const & x )
51 BOOST_QVM_STATIC_ASSERT(Row>=0);
52 BOOST_QVM_STATIC_ASSERT(Row<Rows);
53 BOOST_QVM_STATIC_ASSERT(Col>=0);
54 BOOST_QVM_STATIC_ASSERT(Col<Cols);
58 template <int Row,int Col>
60 BOOST_QVM_INLINE_CRITICAL
62 write_element( this_matrix & x )
64 BOOST_QVM_STATIC_ASSERT(Row>=0);
65 BOOST_QVM_STATIC_ASSERT(Row<Rows);
66 BOOST_QVM_STATIC_ASSERT(Col>=0);
67 BOOST_QVM_STATIC_ASSERT(Col<Cols);
72 BOOST_QVM_INLINE_CRITICAL
74 read_element_idx( int row, int col, this_matrix const & x )
76 BOOST_QVM_ASSERT(row>=0);
77 BOOST_QVM_ASSERT(row<Rows);
78 BOOST_QVM_ASSERT(col>=0);
79 BOOST_QVM_ASSERT(col<Cols);
84 BOOST_QVM_INLINE_CRITICAL
86 write_element_idx( int row, int col, this_matrix & x )
88 BOOST_QVM_ASSERT(row>=0);
89 BOOST_QVM_ASSERT(row<Rows);
90 BOOST_QVM_ASSERT(col>=0);
91 BOOST_QVM_ASSERT(col<Cols);