/usr/include/vmmlib/matrix_traits.hpp is in libvmmlib-dev 1.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | //Copyright (c) 2010 Daniel Pfeifer
#ifndef __VMML_MATRIX_TRAITS_HPP__
#define __VMML_MATRIX_TRAITS_HPP__
#include <vmmlib/matrix.hpp>
#include <boost/la/matrix_traits.hpp>
namespace boost
{
namespace la
{
template<size_t M, size_t N, typename T>
struct matrix_traits<vmml::matrix<M, N, T> >
{
typedef vmml::matrix<M, N, T> matrix_type;
static const int rows = M;
static const int cols = N;
typedef T scalar_type;
template<int Row, int Col>
static scalar_type r(const matrix_type& m)
{
BOOST_STATIC_ASSERT(Row >= 0);
BOOST_STATIC_ASSERT(Row < rows);
BOOST_STATIC_ASSERT(Col >= 0);
BOOST_STATIC_ASSERT(Col < cols);
return m.at(Col, Row);
}
template<int Row, int Col>
static scalar_type& w(matrix_type& m)
{
BOOST_STATIC_ASSERT(Row >= 0);
BOOST_STATIC_ASSERT(Row < rows);
BOOST_STATIC_ASSERT(Col >= 0);
BOOST_STATIC_ASSERT(Col < cols);
return m.at(Col, Row);
}
static scalar_type ir(int row, int col, const matrix_type& m)
{
BOOST_ASSERT(row >= 0);
BOOST_ASSERT(row < rows);
BOOST_ASSERT(col >= 0);
BOOST_ASSERT(col < cols);
return m.at(col, row);
}
static scalar_type& iw(int row, int col, matrix_type& m)
{
BOOST_ASSERT(row >= 0);
BOOST_ASSERT(row < rows);
BOOST_ASSERT(col >= 0);
BOOST_ASSERT(col < cols);
return m.at(col, row);
}
};
} // namespace la
} // namespace boost
#endif /* VMML_MATRIX_TRAITS_HPP */
|