]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/qvm/test/identity_mat_test.cpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / libs / qvm / test / identity_mat_test.cpp
CommitLineData
92f5a8d4
TL
1//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
2
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)
5
6#include <boost/qvm/mat_operations.hpp>
7#include "test_qvm_matrix.hpp"
8
9namespace
10 {
11 template <int Dim>
12 void
13 test()
14 {
15 using namespace boost::qvm;
16 test_qvm::matrix<M1,Dim,Dim> m=identity_mat<float,Dim>();
17 for( int i=0; i!=Dim; ++i )
18 for( int j=0; j!=Dim; ++j )
19 BOOST_TEST(m.a[i][j]==float(i==j));
20 test_qvm::matrix<M2,Dim,Dim> n(42,1);
21 set_identity(n);
22 for( int i=0; i!=Dim; ++i )
23 for( int j=0; j!=Dim; ++j )
24 BOOST_TEST(n.a[i][j]==float(i==j));
25 }
26 }
27
28int
29main()
30 {
31 test<2>();
32 test<3>();
33 test<4>();
34 test<5>();
35 return boost::report_errors();
36 }