| 1 | //Copyright (c) 2008-2017 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 | #ifndef BOOST_QVM_B3124DC843BB8BA61F35A7D938251F
|
| 7 | #define BOOST_QVM_B3124DC843BB8BA61F35A7D938251F
|
| 8 |
|
| 9 | //This file was generated by a program. Do not edit manually.
|
| 10 |
|
| 11 | #include <boost/qvm/assert.hpp>
|
| 12 | #include <boost/qvm/deduce_mat.hpp>
|
| 13 | #include <boost/qvm/deduce_vec.hpp>
|
| 14 | #include <boost/qvm/error.hpp>
|
| 15 | #include <boost/qvm/gen/mat_assign4.hpp>
|
| 16 | #include <boost/qvm/quat_traits.hpp>
|
| 17 | #include <boost/qvm/scalar_traits.hpp>
|
| 18 | #include <boost/qvm/throw_exception.hpp>
|
| 19 |
|
| 20 | namespace
|
| 21 | boost
|
| 22 | {
|
| 23 | namespace
|
| 24 | qvm
|
| 25 | {
|
| 26 | template <class A,class B>
|
| 27 | BOOST_QVM_INLINE_OPERATIONS
|
| 28 | typename lazy_enable_if_c<
|
| 29 | mat_traits<A>::rows==4 && mat_traits<B>::rows==4 &&
|
| 30 | mat_traits<A>::cols==4 && mat_traits<B>::cols==4,
|
| 31 | deduce_mat2<A,B,4,4> >::type
|
| 32 | operator+( A const & a, B const & b )
|
| 33 | {
|
| 34 | typedef typename deduce_mat2<A,B,4,4>::type R;
|
| 35 | BOOST_QVM_STATIC_ASSERT(mat_traits<R>::rows==4);
|
| 36 | BOOST_QVM_STATIC_ASSERT(mat_traits<R>::cols==4);
|
| 37 | R r;
|
| 38 | mat_traits<R>::template write_element<0,0>(r)=mat_traits<A>::template read_element<0,0>(a)+mat_traits<B>::template read_element<0,0>(b);
|
| 39 | mat_traits<R>::template write_element<0,1>(r)=mat_traits<A>::template read_element<0,1>(a)+mat_traits<B>::template read_element<0,1>(b);
|
| 40 | mat_traits<R>::template write_element<0,2>(r)=mat_traits<A>::template read_element<0,2>(a)+mat_traits<B>::template read_element<0,2>(b);
|
| 41 | mat_traits<R>::template write_element<0,3>(r)=mat_traits<A>::template read_element<0,3>(a)+mat_traits<B>::template read_element<0,3>(b);
|
| 42 | mat_traits<R>::template write_element<1,0>(r)=mat_traits<A>::template read_element<1,0>(a)+mat_traits<B>::template read_element<1,0>(b);
|
| 43 | mat_traits<R>::template write_element<1,1>(r)=mat_traits<A>::template read_element<1,1>(a)+mat_traits<B>::template read_element<1,1>(b);
|
| 44 | mat_traits<R>::template write_element<1,2>(r)=mat_traits<A>::template read_element<1,2>(a)+mat_traits<B>::template read_element<1,2>(b);
|
| 45 | mat_traits<R>::template write_element<1,3>(r)=mat_traits<A>::template read_element<1,3>(a)+mat_traits<B>::template read_element<1,3>(b);
|
| 46 | mat_traits<R>::template write_element<2,0>(r)=mat_traits<A>::template read_element<2,0>(a)+mat_traits<B>::template read_element<2,0>(b);
|
| 47 | mat_traits<R>::template write_element<2,1>(r)=mat_traits<A>::template read_element<2,1>(a)+mat_traits<B>::template read_element<2,1>(b);
|
| 48 | mat_traits<R>::template write_element<2,2>(r)=mat_traits<A>::template read_element<2,2>(a)+mat_traits<B>::template read_element<2,2>(b);
|
| 49 | mat_traits<R>::template write_element<2,3>(r)=mat_traits<A>::template read_element<2,3>(a)+mat_traits<B>::template read_element<2,3>(b);
|
| 50 | mat_traits<R>::template write_element<3,0>(r)=mat_traits<A>::template read_element<3,0>(a)+mat_traits<B>::template read_element<3,0>(b);
|
| 51 | mat_traits<R>::template write_element<3,1>(r)=mat_traits<A>::template read_element<3,1>(a)+mat_traits<B>::template read_element<3,1>(b);
|
| 52 | mat_traits<R>::template write_element<3,2>(r)=mat_traits<A>::template read_element<3,2>(a)+mat_traits<B>::template read_element<3,2>(b);
|
| 53 | mat_traits<R>::template write_element<3,3>(r)=mat_traits<A>::template read_element<3,3>(a)+mat_traits<B>::template read_element<3,3>(b);
|
| 54 | return r;
|
| 55 | }
|
| 56 |
|
| 57 | namespace
|
| 58 | sfinae
|
| 59 | {
|
| 60 | using ::boost::qvm::operator+;
|
| 61 | }
|
| 62 |
|
| 63 | namespace
|
| 64 | qvm_detail
|
| 65 | {
|
| 66 | template <int R,int C>
|
| 67 | struct plus_mm_defined;
|
| 68 |
|
| 69 | template <>
|
| 70 | struct
|
| 71 | plus_mm_defined<4,4>
|
| 72 | {
|
| 73 | static bool const value=true;
|
| 74 | };
|
| 75 | }
|
| 76 |
|
| 77 | template <class A,class B>
|
| 78 | BOOST_QVM_INLINE_OPERATIONS
|
| 79 | typename lazy_enable_if_c<
|
| 80 | mat_traits<A>::rows==4 && mat_traits<B>::rows==4 &&
|
| 81 | mat_traits<A>::cols==1 && mat_traits<B>::cols==1,
|
| 82 | deduce_mat2<A,B,4,1> >::type
|
| 83 | operator+( A const & a, B const & b )
|
| 84 | {
|
| 85 | typedef typename deduce_mat2<A,B,4,1>::type R;
|
| 86 | BOOST_QVM_STATIC_ASSERT(mat_traits<R>::rows==4);
|
| 87 | BOOST_QVM_STATIC_ASSERT(mat_traits<R>::cols==1);
|
| 88 | R r;
|
| 89 | mat_traits<R>::template write_element<0,0>(r)=mat_traits<A>::template read_element<0,0>(a)+mat_traits<B>::template read_element<0,0>(b);
|
| 90 | mat_traits<R>::template write_element<1,0>(r)=mat_traits<A>::template read_element<1,0>(a)+mat_traits<B>::template read_element<1,0>(b);
|
| 91 | mat_traits<R>::template write_element<2,0>(r)=mat_traits<A>::template read_element<2,0>(a)+mat_traits<B>::template read_element<2,0>(b);
|
| 92 | mat_traits<R>::template write_element<3,0>(r)=mat_traits<A>::template read_element<3,0>(a)+mat_traits<B>::template read_element<3,0>(b);
|
| 93 | return r;
|
| 94 | }
|
| 95 |
|
| 96 | namespace
|
| 97 | sfinae
|
| 98 | {
|
| 99 | using ::boost::qvm::operator+;
|
| 100 | }
|
| 101 |
|
| 102 | namespace
|
| 103 | qvm_detail
|
| 104 | {
|
| 105 | template <int R,int C>
|
| 106 | struct plus_mm_defined;
|
| 107 |
|
| 108 | template <>
|
| 109 | struct
|
| 110 | plus_mm_defined<4,1>
|
| 111 | {
|
| 112 | static bool const value=true;
|
| 113 | };
|
| 114 | }
|
| 115 |
|
| 116 | template <class A,class B>
|
| 117 | BOOST_QVM_INLINE_OPERATIONS
|
| 118 | typename lazy_enable_if_c<
|
| 119 | mat_traits<A>::rows==1 && mat_traits<B>::rows==1 &&
|
| 120 | mat_traits<A>::cols==4 && mat_traits<B>::cols==4,
|
| 121 | deduce_mat2<A,B,1,4> >::type
|
| 122 | operator+( A const & a, B const & b )
|
| 123 | {
|
| 124 | typedef typename deduce_mat2<A,B,1,4>::type R;
|
| 125 | BOOST_QVM_STATIC_ASSERT(mat_traits<R>::rows==1);
|
| 126 | BOOST_QVM_STATIC_ASSERT(mat_traits<R>::cols==4);
|
| 127 | R r;
|
| 128 | mat_traits<R>::template write_element<0,0>(r)=mat_traits<A>::template read_element<0,0>(a)+mat_traits<B>::template read_element<0,0>(b);
|
| 129 | mat_traits<R>::template write_element<0,1>(r)=mat_traits<A>::template read_element<0,1>(a)+mat_traits<B>::template read_element<0,1>(b);
|
| 130 | mat_traits<R>::template write_element<0,2>(r)=mat_traits<A>::template read_element<0,2>(a)+mat_traits<B>::template read_element<0,2>(b);
|
| 131 | mat_traits<R>::template write_element<0,3>(r)=mat_traits<A>::template read_element<0,3>(a)+mat_traits<B>::template read_element<0,3>(b);
|
| 132 | return r;
|
| 133 | }
|
| 134 |
|
| 135 | namespace
|
| 136 | sfinae
|
| 137 | {
|
| 138 | using ::boost::qvm::operator+;
|
| 139 | }
|
| 140 |
|
| 141 | namespace
|
| 142 | qvm_detail
|
| 143 | {
|
| 144 | template <int R,int C>
|
| 145 | struct plus_mm_defined;
|
| 146 |
|
| 147 | template <>
|
| 148 | struct
|
| 149 | plus_mm_defined<1,4>
|
| 150 | {
|
| 151 | static bool const value=true;
|
| 152 | };
|
| 153 | }
|
| 154 |
|
| 155 | template <class A,class B>
|
| 156 | BOOST_QVM_INLINE_OPERATIONS
|
| 157 | typename lazy_enable_if_c<
|
| 158 | mat_traits<A>::rows==4 && mat_traits<B>::rows==4 &&
|
| 159 | mat_traits<A>::cols==4 && mat_traits<B>::cols==4,
|
| 160 | deduce_mat2<A,B,4,4> >::type
|
| 161 | operator-( A const & a, B const & b )
|
| 162 | {
|
| 163 | typedef typename deduce_mat2<A,B,4,4>::type R;
|
| 164 | BOOST_QVM_STATIC_ASSERT(mat_traits<R>::rows==4);
|
| 165 | BOOST_QVM_STATIC_ASSERT(mat_traits<R>::cols==4);
|
| 166 | R r;
|
| 167 | mat_traits<R>::template write_element<0,0>(r)=mat_traits<A>::template read_element<0,0>(a)-mat_traits<B>::template read_element<0,0>(b);
|
| 168 | mat_traits<R>::template write_element<0,1>(r)=mat_traits<A>::template read_element<0,1>(a)-mat_traits<B>::template read_element<0,1>(b);
|
| 169 | mat_traits<R>::template write_element<0,2>(r)=mat_traits<A>::template read_element<0,2>(a)-mat_traits<B>::template read_element<0,2>(b);
|
| 170 | mat_traits<R>::template write_element<0,3>(r)=mat_traits<A>::template read_element<0,3>(a)-mat_traits<B>::template read_element<0,3>(b);
|
| 171 | mat_traits<R>::template write_element<1,0>(r)=mat_traits<A>::template read_element<1,0>(a)-mat_traits<B>::template read_element<1,0>(b);
|
| 172 | mat_traits<R>::template write_element<1,1>(r)=mat_traits<A>::template read_element<1,1>(a)-mat_traits<B>::template read_element<1,1>(b);
|
| 173 | mat_traits<R>::template write_element<1,2>(r)=mat_traits<A>::template read_element<1,2>(a)-mat_traits<B>::template read_element<1,2>(b);
|
| 174 | mat_traits<R>::template write_element<1,3>(r)=mat_traits<A>::template read_element<1,3>(a)-mat_traits<B>::template read_element<1,3>(b);
|
| 175 | mat_traits<R>::template write_element<2,0>(r)=mat_traits<A>::template read_element<2,0>(a)-mat_traits<B>::template read_element<2,0>(b);
|
| 176 | mat_traits<R>::template write_element<2,1>(r)=mat_traits<A>::template read_element<2,1>(a)-mat_traits<B>::template read_element<2,1>(b);
|
| 177 | mat_traits<R>::template write_element<2,2>(r)=mat_traits<A>::template read_element<2,2>(a)-mat_traits<B>::template read_element<2,2>(b);
|
| 178 | mat_traits<R>::template write_element<2,3>(r)=mat_traits<A>::template read_element<2,3>(a)-mat_traits<B>::template read_element<2,3>(b);
|
| 179 | mat_traits<R>::template write_element<3,0>(r)=mat_traits<A>::template read_element<3,0>(a)-mat_traits<B>::template read_element<3,0>(b);
|
| 180 | mat_traits<R>::template write_element<3,1>(r)=mat_traits<A>::template read_element<3,1>(a)-mat_traits<B>::template read_element<3,1>(b);
|
| 181 | mat_traits<R>::template write_element<3,2>(r)=mat_traits<A>::template read_element<3,2>(a)-mat_traits<B>::template read_element<3,2>(b);
|
| 182 | mat_traits<R>::template write_element<3,3>(r)=mat_traits<A>::template read_element<3,3>(a)-mat_traits<B>::template read_element<3,3>(b);
|
| 183 | return r;
|
| 184 | }
|
| 185 |
|
| 186 | namespace
|
| 187 | sfinae
|
| 188 | {
|
| 189 | using ::boost::qvm::operator-;
|
| 190 | }
|
| 191 |
|
| 192 | namespace
|
| 193 | qvm_detail
|
| 194 | {
|
| 195 | template <int R,int C>
|
| 196 | struct minus_mm_defined;
|
| 197 |
|
| 198 | template <>
|
| 199 | struct
|
| 200 | minus_mm_defined<4,4>
|
| 201 | {
|
| 202 | static bool const value=true;
|
| 203 | };
|
| 204 | }
|
| 205 |
|
| 206 | template <class A,class B>
|
| 207 | BOOST_QVM_INLINE_OPERATIONS
|
| 208 | typename lazy_enable_if_c<
|
| 209 | mat_traits<A>::rows==4 && mat_traits<B>::rows==4 &&
|
| 210 | mat_traits<A>::cols==1 && mat_traits<B>::cols==1,
|
| 211 | deduce_mat2<A,B,4,1> >::type
|
| 212 | operator-( A const & a, B const & b )
|
| 213 | {
|
| 214 | typedef typename deduce_mat2<A,B,4,1>::type R;
|
| 215 | BOOST_QVM_STATIC_ASSERT(mat_traits<R>::rows==4);
|
| 216 | BOOST_QVM_STATIC_ASSERT(mat_traits<R>::cols==1);
|
| 217 | R r;
|
| 218 | mat_traits<R>::template write_element<0,0>(r)=mat_traits<A>::template read_element<0,0>(a)-mat_traits<B>::template read_element<0,0>(b);
|
| 219 | mat_traits<R>::template write_element<1,0>(r)=mat_traits<A>::template read_element<1,0>(a)-mat_traits<B>::template read_element<1,0>(b);
|
| 220 | mat_traits<R>::template write_element<2,0>(r)=mat_traits<A>::template read_element<2,0>(a)-mat_traits<B>::template read_element<2,0>(b);
|
| 221 | mat_traits<R>::template write_element<3,0>(r)=mat_traits<A>::template read_element<3,0>(a)-mat_traits<B>::template read_element<3,0>(b);
|
| 222 | return r;
|
| 223 | }
|
| 224 |
|
| 225 | namespace
|
| 226 | sfinae
|
| 227 | {
|
| 228 | using ::boost::qvm::operator-;
|
| 229 | }
|
| 230 |
|
| 231 | namespace
|
| 232 | qvm_detail
|
| 233 | {
|
| 234 | template <int R,int C>
|
| 235 | struct minus_mm_defined;
|
| 236 |
|
| 237 | template <>
|
| 238 | struct
|
| 239 | minus_mm_defined<4,1>
|
| 240 | {
|
| 241 | static bool const value=true;
|
| 242 | };
|
| 243 | }
|
| 244 |
|
| 245 | template <class A,class B>
|
| 246 | BOOST_QVM_INLINE_OPERATIONS
|
| 247 | typename lazy_enable_if_c<
|
| 248 | mat_traits<A>::rows==1 && mat_traits<B>::rows==1 &&
|
| 249 | mat_traits<A>::cols==4 && mat_traits<B>::cols==4,
|
| 250 | deduce_mat2<A,B,1,4> >::type
|
| 251 | operator-( A const & a, B const & b )
|
| 252 | {
|
| 253 | typedef typename deduce_mat2<A,B,1,4>::type R;
|
| 254 | BOOST_QVM_STATIC_ASSERT(mat_traits<R>::rows==1);
|
| 255 | BOOST_QVM_STATIC_ASSERT(mat_traits<R>::cols==4);
|
| 256 | R r;
|
| 257 | mat_traits<R>::template write_element<0,0>(r)=mat_traits<A>::template read_element<0,0>(a)-mat_traits<B>::template read_element<0,0>(b);
|
| 258 | mat_traits<R>::template write_element<0,1>(r)=mat_traits<A>::template read_element<0,1>(a)-mat_traits<B>::template read_element<0,1>(b);
|
| 259 | mat_traits<R>::template write_element<0,2>(r)=mat_traits<A>::template read_element<0,2>(a)-mat_traits<B>::template read_element<0,2>(b);
|
| 260 | mat_traits<R>::template write_element<0,3>(r)=mat_traits<A>::template read_element<0,3>(a)-mat_traits<B>::template read_element<0,3>(b);
|
| 261 | return r;
|
| 262 | }
|
| 263 |
|
| 264 | namespace
|
| 265 | sfinae
|
| 266 | {
|
| 267 | using ::boost::qvm::operator-;
|
| 268 | }
|
| 269 |
|
| 270 | namespace
|
| 271 | qvm_detail
|
| 272 | {
|
| 273 | template <int R,int C>
|
| 274 | struct minus_mm_defined;
|
| 275 |
|
| 276 | template <>
|
| 277 | struct
|
| 278 | minus_mm_defined<1,4>
|
| 279 | {
|
| 280 | static bool const value=true;
|
| 281 | };
|
| 282 | }
|
| 283 |
|
| 284 | template <class A,class B>
|
| 285 | BOOST_QVM_INLINE_OPERATIONS
|
| 286 | typename enable_if_c<
|
| 287 | mat_traits<A>::rows==4 && mat_traits<B>::rows==4 &&
|
| 288 | mat_traits<A>::cols==4 && mat_traits<B>::cols==4,
|
| 289 | A &>::type
|
| 290 | operator+=( A & a, B const & b )
|
| 291 | {
|
| 292 | mat_traits<A>::template write_element<0,0>(a)+=mat_traits<B>::template read_element<0,0>(b);
|
| 293 | mat_traits<A>::template write_element<0,1>(a)+=mat_traits<B>::template read_element<0,1>(b);
|
| 294 | mat_traits<A>::template write_element<0,2>(a)+=mat_traits<B>::template read_element<0,2>(b);
|
| 295 | mat_traits<A>::template write_element<0,3>(a)+=mat_traits<B>::template read_element<0,3>(b);
|
| 296 | mat_traits<A>::template write_element<1,0>(a)+=mat_traits<B>::template read_element<1,0>(b);
|
| 297 | mat_traits<A>::template write_element<1,1>(a)+=mat_traits<B>::template read_element<1,1>(b);
|
| 298 | mat_traits<A>::template write_element<1,2>(a)+=mat_traits<B>::template read_element<1,2>(b);
|
| 299 | mat_traits<A>::template write_element<1,3>(a)+=mat_traits<B>::template read_element<1,3>(b);
|
| 300 | mat_traits<A>::template write_element<2,0>(a)+=mat_traits<B>::template read_element<2,0>(b);
|
| 301 | mat_traits<A>::template write_element<2,1>(a)+=mat_traits<B>::template read_element<2,1>(b);
|
| 302 | mat_traits<A>::template write_element<2,2>(a)+=mat_traits<B>::template read_element<2,2>(b);
|
| 303 | mat_traits<A>::template write_element<2,3>(a)+=mat_traits<B>::template read_element<2,3>(b);
|
| 304 | mat_traits<A>::template write_element<3,0>(a)+=mat_traits<B>::template read_element<3,0>(b);
|
| 305 | mat_traits<A>::template write_element<3,1>(a)+=mat_traits<B>::template read_element<3,1>(b);
|
| 306 | mat_traits<A>::template write_element<3,2>(a)+=mat_traits<B>::template read_element<3,2>(b);
|
| 307 | mat_traits<A>::template write_element<3,3>(a)+=mat_traits<B>::template read_element<3,3>(b);
|
| 308 | return a;
|
| 309 | }
|
| 310 |
|
| 311 | namespace
|
| 312 | sfinae
|
| 313 | {
|
| 314 | using ::boost::qvm::operator+=;
|
| 315 | }
|
| 316 |
|
| 317 | namespace
|
| 318 | qvm_detail
|
| 319 | {
|
| 320 | template <int R,int C>
|
| 321 | struct plus_eq_mm_defined;
|
| 322 |
|
| 323 | template <>
|
| 324 | struct
|
| 325 | plus_eq_mm_defined<4,4>
|
| 326 | {
|
| 327 | static bool const value=true;
|
| 328 | };
|
| 329 | }
|
| 330 |
|
| 331 | template <class A,class B>
|
| 332 | BOOST_QVM_INLINE_OPERATIONS
|
| 333 | typename enable_if_c<
|
| 334 | mat_traits<A>::rows==4 && mat_traits<B>::rows==4 &&
|
| 335 | mat_traits<A>::cols==1 && mat_traits<B>::cols==1,
|
| 336 | A &>::type
|
| 337 | operator+=( A & a, B const & b )
|
| 338 | {
|
| 339 | mat_traits<A>::template write_element<0,0>(a)+=mat_traits<B>::template read_element<0,0>(b);
|
| 340 | mat_traits<A>::template write_element<1,0>(a)+=mat_traits<B>::template read_element<1,0>(b);
|
| 341 | mat_traits<A>::template write_element<2,0>(a)+=mat_traits<B>::template read_element<2,0>(b);
|
| 342 | mat_traits<A>::template write_element<3,0>(a)+=mat_traits<B>::template read_element<3,0>(b);
|
| 343 | return a;
|
| 344 | }
|
| 345 |
|
| 346 | namespace
|
| 347 | sfinae
|
| 348 | {
|
| 349 | using ::boost::qvm::operator+=;
|
| 350 | }
|
| 351 |
|
| 352 | namespace
|
| 353 | qvm_detail
|
| 354 | {
|
| 355 | template <int R,int C>
|
| 356 | struct plus_eq_mm_defined;
|
| 357 |
|
| 358 | template <>
|
| 359 | struct
|
| 360 | plus_eq_mm_defined<4,1>
|
| 361 | {
|
| 362 | static bool const value=true;
|
| 363 | };
|
| 364 | }
|
| 365 |
|
| 366 | template <class A,class B>
|
| 367 | BOOST_QVM_INLINE_OPERATIONS
|
| 368 | typename enable_if_c<
|
| 369 | mat_traits<A>::rows==1 && mat_traits<B>::rows==1 &&
|
| 370 | mat_traits<A>::cols==4 && mat_traits<B>::cols==4,
|
| 371 | A &>::type
|
| 372 | operator+=( A & a, B const & b )
|
| 373 | {
|
| 374 | mat_traits<A>::template write_element<0,0>(a)+=mat_traits<B>::template read_element<0,0>(b);
|
| 375 | mat_traits<A>::template write_element<0,1>(a)+=mat_traits<B>::template read_element<0,1>(b);
|
| 376 | mat_traits<A>::template write_element<0,2>(a)+=mat_traits<B>::template read_element<0,2>(b);
|
| 377 | mat_traits<A>::template write_element<0,3>(a)+=mat_traits<B>::template read_element<0,3>(b);
|
| 378 | return a;
|
| 379 | }
|
| 380 |
|
| 381 | namespace
|
| 382 | sfinae
|
| 383 | {
|
| 384 | using ::boost::qvm::operator+=;
|
| 385 | }
|
| 386 |
|
| 387 | namespace
|
| 388 | qvm_detail
|
| 389 | {
|
| 390 | template <int R,int C>
|
| 391 | struct plus_eq_mm_defined;
|
| 392 |
|
| 393 | template <>
|
| 394 | struct
|
| 395 | plus_eq_mm_defined<1,4>
|
| 396 | {
|
| 397 | static bool const value=true;
|
| 398 | };
|
| 399 | }
|
| 400 |
|
| 401 | template <class A,class B>
|
| 402 | BOOST_QVM_INLINE_OPERATIONS
|
| 403 | typename enable_if_c<
|
| 404 | mat_traits<A>::rows==4 && mat_traits<B>::rows==4 &&
|
| 405 | mat_traits<A>::cols==4 && mat_traits<B>::cols==4,
|
| 406 | A &>::type
|
| 407 | operator-=( A & a, B const & b )
|
| 408 | {
|
| 409 | mat_traits<A>::template write_element<0,0>(a)-=mat_traits<B>::template read_element<0,0>(b);
|
| 410 | mat_traits<A>::template write_element<0,1>(a)-=mat_traits<B>::template read_element<0,1>(b);
|
| 411 | mat_traits<A>::template write_element<0,2>(a)-=mat_traits<B>::template read_element<0,2>(b);
|
| 412 | mat_traits<A>::template write_element<0,3>(a)-=mat_traits<B>::template read_element<0,3>(b);
|
| 413 | mat_traits<A>::template write_element<1,0>(a)-=mat_traits<B>::template read_element<1,0>(b);
|
| 414 | mat_traits<A>::template write_element<1,1>(a)-=mat_traits<B>::template read_element<1,1>(b);
|
| 415 | mat_traits<A>::template write_element<1,2>(a)-=mat_traits<B>::template read_element<1,2>(b);
|
| 416 | mat_traits<A>::template write_element<1,3>(a)-=mat_traits<B>::template read_element<1,3>(b);
|
| 417 | mat_traits<A>::template write_element<2,0>(a)-=mat_traits<B>::template read_element<2,0>(b);
|
| 418 | mat_traits<A>::template write_element<2,1>(a)-=mat_traits<B>::template read_element<2,1>(b);
|
| 419 | mat_traits<A>::template write_element<2,2>(a)-=mat_traits<B>::template read_element<2,2>(b);
|
| 420 | mat_traits<A>::template write_element<2,3>(a)-=mat_traits<B>::template read_element<2,3>(b);
|
| 421 | mat_traits<A>::template write_element<3,0>(a)-=mat_traits<B>::template read_element<3,0>(b);
|
| 422 | mat_traits<A>::template write_element<3,1>(a)-=mat_traits<B>::template read_element<3,1>(b);
|
| 423 | mat_traits<A>::template write_element<3,2>(a)-=mat_traits<B>::template read_element<3,2>(b);
|
| 424 | mat_traits<A>::template write_element<3,3>(a)-=mat_traits<B>::template read_element<3,3>(b);
|
| 425 | return a;
|
| 426 | }
|
| 427 |
|
| 428 | namespace
|
| 429 | sfinae
|
| 430 | {
|
| 431 | using ::boost::qvm::operator-=;
|
| 432 | }
|
| 433 |
|
| 434 | namespace
|
| 435 | qvm_detail
|
| 436 | {
|
| 437 | template <int R,int C>
|
| 438 | struct minus_eq_mm_defined;
|
| 439 |
|
| 440 | template <>
|
| 441 | struct
|
| 442 | minus_eq_mm_defined<4,4>
|
| 443 | {
|
| 444 | static bool const value=true;
|
| 445 | };
|
| 446 | }
|
| 447 |
|
| 448 | template <class A,class B>
|
| 449 | BOOST_QVM_INLINE_OPERATIONS
|
| 450 | typename enable_if_c<
|
| 451 | mat_traits<A>::rows==4 && mat_traits<B>::rows==4 &&
|
| 452 | mat_traits<A>::cols==1 && mat_traits<B>::cols==1,
|
| 453 | A &>::type
|
| 454 | operator-=( A & a, B const & b )
|
| 455 | {
|
| 456 | mat_traits<A>::template write_element<0,0>(a)-=mat_traits<B>::template read_element<0,0>(b);
|
| 457 | mat_traits<A>::template write_element<1,0>(a)-=mat_traits<B>::template read_element<1,0>(b);
|
| 458 | mat_traits<A>::template write_element<2,0>(a)-=mat_traits<B>::template read_element<2,0>(b);
|
| 459 | mat_traits<A>::template write_element<3,0>(a)-=mat_traits<B>::template read_element<3,0>(b);
|
| 460 | return a;
|
| 461 | }
|
| 462 |
|
| 463 | namespace
|
| 464 | sfinae
|
| 465 | {
|
| 466 | using ::boost::qvm::operator-=;
|
| 467 | }
|
| 468 |
|
| 469 | namespace
|
| 470 | qvm_detail
|
| 471 | {
|
| 472 | template <int R,int C>
|
| 473 | struct minus_eq_mm_defined;
|
| 474 |
|
| 475 | template <>
|
| 476 | struct
|
| 477 | minus_eq_mm_defined<4,1>
|
| 478 | {
|
| 479 | static bool const value=true;
|
| 480 | };
|
| 481 | }
|
| 482 |
|
| 483 | template <class A,class B>
|
| 484 | BOOST_QVM_INLINE_OPERATIONS
|
| 485 | typename enable_if_c<
|
| 486 | mat_traits<A>::rows==1 && mat_traits<B>::rows==1 &&
|
| 487 | mat_traits<A>::cols==4 && mat_traits<B>::cols==4,
|
| 488 | A &>::type
|
| 489 | operator-=( A & a, B const & b )
|
| 490 | {
|
| 491 | mat_traits<A>::template write_element<0,0>(a)-=mat_traits<B>::template read_element<0,0>(b);
|
| 492 | mat_traits<A>::template write_element<0,1>(a)-=mat_traits<B>::template read_element<0,1>(b);
|
| 493 | mat_traits<A>::template write_element<0,2>(a)-=mat_traits<B>::template read_element<0,2>(b);
|
| 494 | mat_traits<A>::template write_element<0,3>(a)-=mat_traits<B>::template read_element<0,3>(b);
|
| 495 | return a;
|
| 496 | }
|
| 497 |
|
| 498 | namespace
|
| 499 | sfinae
|
| 500 | {
|
| 501 | using ::boost::qvm::operator-=;
|
| 502 | }
|
| 503 |
|
| 504 | namespace
|
| 505 | qvm_detail
|
| 506 | {
|
| 507 | template <int R,int C>
|
| 508 | struct minus_eq_mm_defined;
|
| 509 |
|
| 510 | template <>
|
| 511 | struct
|
| 512 | minus_eq_mm_defined<1,4>
|
| 513 | {
|
| 514 | static bool const value=true;
|
| 515 | };
|
| 516 | }
|
| 517 |
|
| 518 | template <class A,class B>
|
| 519 | BOOST_QVM_INLINE_OPERATIONS
|
| 520 | typename lazy_enable_if_c<
|
| 521 | mat_traits<A>::rows==4 && mat_traits<A>::cols==4 && is_scalar<B>::value,
|
| 522 | deduce_mat<A> >::type
|
| 523 | operator*( A const & a, B b )
|
| 524 | {
|
| 525 | typedef typename deduce_mat<A>::type R;
|
| 526 | R r;
|
| 527 | mat_traits<R>::template write_element<0,0>(r)=mat_traits<A>::template read_element<0,0>(a)*b;
|
| 528 | mat_traits<R>::template write_element<0,1>(r)=mat_traits<A>::template read_element<0,1>(a)*b;
|
| 529 | mat_traits<R>::template write_element<0,2>(r)=mat_traits<A>::template read_element<0,2>(a)*b;
|
| 530 | mat_traits<R>::template write_element<0,3>(r)=mat_traits<A>::template read_element<0,3>(a)*b;
|
| 531 | mat_traits<R>::template write_element<1,0>(r)=mat_traits<A>::template read_element<1,0>(a)*b;
|
| 532 | mat_traits<R>::template write_element<1,1>(r)=mat_traits<A>::template read_element<1,1>(a)*b;
|
| 533 | mat_traits<R>::template write_element<1,2>(r)=mat_traits<A>::template read_element<1,2>(a)*b;
|
| 534 | mat_traits<R>::template write_element<1,3>(r)=mat_traits<A>::template read_element<1,3>(a)*b;
|
| 535 | mat_traits<R>::template write_element<2,0>(r)=mat_traits<A>::template read_element<2,0>(a)*b;
|
| 536 | mat_traits<R>::template write_element<2,1>(r)=mat_traits<A>::template read_element<2,1>(a)*b;
|
| 537 | mat_traits<R>::template write_element<2,2>(r)=mat_traits<A>::template read_element<2,2>(a)*b;
|
| 538 | mat_traits<R>::template write_element<2,3>(r)=mat_traits<A>::template read_element<2,3>(a)*b;
|
| 539 | mat_traits<R>::template write_element<3,0>(r)=mat_traits<A>::template read_element<3,0>(a)*b;
|
| 540 | mat_traits<R>::template write_element<3,1>(r)=mat_traits<A>::template read_element<3,1>(a)*b;
|
| 541 | mat_traits<R>::template write_element<3,2>(r)=mat_traits<A>::template read_element<3,2>(a)*b;
|
| 542 | mat_traits<R>::template write_element<3,3>(r)=mat_traits<A>::template read_element<3,3>(a)*b;
|
| 543 | return r;
|
| 544 | }
|
| 545 |
|
| 546 | namespace
|
| 547 | sfinae
|
| 548 | {
|
| 549 | using ::boost::qvm::operator*;
|
| 550 | }
|
| 551 |
|
| 552 | namespace
|
| 553 | qvm_detail
|
| 554 | {
|
| 555 | template <int R,int C>
|
| 556 | struct mul_ms_defined;
|
| 557 |
|
| 558 | template <>
|
| 559 | struct
|
| 560 | mul_ms_defined<4,4>
|
| 561 | {
|
| 562 | static bool const value=true;
|
| 563 | };
|
| 564 | }
|
| 565 |
|
| 566 | template <class A,class B>
|
| 567 | BOOST_QVM_INLINE_OPERATIONS
|
| 568 | typename lazy_enable_if_c<
|
| 569 | is_scalar<A>::value && mat_traits<B>::rows==4 && mat_traits<B>::cols==4,
|
| 570 | deduce_mat<B> >::type
|
| 571 | operator*( A a, B const & b )
|
| 572 | {
|
| 573 | typedef typename deduce_mat<B>::type R;
|
| 574 | R r;
|
| 575 | mat_traits<R>::template write_element<0,0>(r)=a*mat_traits<B>::template read_element<0,0>(b);
|
| 576 | mat_traits<R>::template write_element<0,1>(r)=a*mat_traits<B>::template read_element<0,1>(b);
|
| 577 | mat_traits<R>::template write_element<0,2>(r)=a*mat_traits<B>::template read_element<0,2>(b);
|
| 578 | mat_traits<R>::template write_element<0,3>(r)=a*mat_traits<B>::template read_element<0,3>(b);
|
| 579 | mat_traits<R>::template write_element<1,0>(r)=a*mat_traits<B>::template read_element<1,0>(b);
|
| 580 | mat_traits<R>::template write_element<1,1>(r)=a*mat_traits<B>::template read_element<1,1>(b);
|
| 581 | mat_traits<R>::template write_element<1,2>(r)=a*mat_traits<B>::template read_element<1,2>(b);
|
| 582 | mat_traits<R>::template write_element<1,3>(r)=a*mat_traits<B>::template read_element<1,3>(b);
|
| 583 | mat_traits<R>::template write_element<2,0>(r)=a*mat_traits<B>::template read_element<2,0>(b);
|
| 584 | mat_traits<R>::template write_element<2,1>(r)=a*mat_traits<B>::template read_element<2,1>(b);
|
| 585 | mat_traits<R>::template write_element<2,2>(r)=a*mat_traits<B>::template read_element<2,2>(b);
|
| 586 | mat_traits<R>::template write_element<2,3>(r)=a*mat_traits<B>::template read_element<2,3>(b);
|
| 587 | mat_traits<R>::template write_element<3,0>(r)=a*mat_traits<B>::template read_element<3,0>(b);
|
| 588 | mat_traits<R>::template write_element<3,1>(r)=a*mat_traits<B>::template read_element<3,1>(b);
|
| 589 | mat_traits<R>::template write_element<3,2>(r)=a*mat_traits<B>::template read_element<3,2>(b);
|
| 590 | mat_traits<R>::template write_element<3,3>(r)=a*mat_traits<B>::template read_element<3,3>(b);
|
| 591 | return r;
|
| 592 | }
|
| 593 |
|
| 594 | namespace
|
| 595 | sfinae
|
| 596 | {
|
| 597 | using ::boost::qvm::operator*;
|
| 598 | }
|
| 599 |
|
| 600 | namespace
|
| 601 | qvm_detail
|
| 602 | {
|
| 603 | template <int R,int C>
|
| 604 | struct mul_sm_defined;
|
| 605 |
|
| 606 | template <>
|
| 607 | struct
|
| 608 | mul_sm_defined<4,4>
|
| 609 | {
|
| 610 | static bool const value=true;
|
| 611 | };
|
| 612 | }
|
| 613 |
|
| 614 | template <class A,class B>
|
| 615 | BOOST_QVM_INLINE_OPERATIONS
|
| 616 | typename lazy_enable_if_c<
|
| 617 | mat_traits<A>::rows==4 && mat_traits<A>::cols==1 && is_scalar<B>::value,
|
| 618 | deduce_mat<A> >::type
|
| 619 | operator*( A const & a, B b )
|
| 620 | {
|
| 621 | typedef typename deduce_mat<A>::type R;
|
| 622 | R r;
|
| 623 | mat_traits<R>::template write_element<0,0>(r)=mat_traits<A>::template read_element<0,0>(a)*b;
|
| 624 | mat_traits<R>::template write_element<1,0>(r)=mat_traits<A>::template read_element<1,0>(a)*b;
|
| 625 | mat_traits<R>::template write_element<2,0>(r)=mat_traits<A>::template read_element<2,0>(a)*b;
|
| 626 | mat_traits<R>::template write_element<3,0>(r)=mat_traits<A>::template read_element<3,0>(a)*b;
|
| 627 | return r;
|
| 628 | }
|
| 629 |
|
| 630 | namespace
|
| 631 | sfinae
|
| 632 | {
|
| 633 | using ::boost::qvm::operator*;
|
| 634 | }
|
| 635 |
|
| 636 | namespace
|
| 637 | qvm_detail
|
| 638 | {
|
| 639 | template <int R,int C>
|
| 640 | struct mul_ms_defined;
|
| 641 |
|
| 642 | template <>
|
| 643 | struct
|
| 644 | mul_ms_defined<4,1>
|
| 645 | {
|
| 646 | static bool const value=true;
|
| 647 | };
|
| 648 | }
|
| 649 |
|
| 650 | template <class A,class B>
|
| 651 | BOOST_QVM_INLINE_OPERATIONS
|
| 652 | typename lazy_enable_if_c<
|
| 653 | is_scalar<A>::value && mat_traits<B>::rows==4 && mat_traits<B>::cols==1,
|
| 654 | deduce_mat<B> >::type
|
| 655 | operator*( A a, B const & b )
|
| 656 | {
|
| 657 | typedef typename deduce_mat<B>::type R;
|
| 658 | R r;
|
| 659 | mat_traits<R>::template write_element<0,0>(r)=a*mat_traits<B>::template read_element<0,0>(b);
|
| 660 | mat_traits<R>::template write_element<1,0>(r)=a*mat_traits<B>::template read_element<1,0>(b);
|
| 661 | mat_traits<R>::template write_element<2,0>(r)=a*mat_traits<B>::template read_element<2,0>(b);
|
| 662 | mat_traits<R>::template write_element<3,0>(r)=a*mat_traits<B>::template read_element<3,0>(b);
|
| 663 | return r;
|
| 664 | }
|
| 665 |
|
| 666 | namespace
|
| 667 | sfinae
|
| 668 | {
|
| 669 | using ::boost::qvm::operator*;
|
| 670 | }
|
| 671 |
|
| 672 | namespace
|
| 673 | qvm_detail
|
| 674 | {
|
| 675 | template <int R,int C>
|
| 676 | struct mul_sm_defined;
|
| 677 |
|
| 678 | template <>
|
| 679 | struct
|
| 680 | mul_sm_defined<4,1>
|
| 681 | {
|
| 682 | static bool const value=true;
|
| 683 | };
|
| 684 | }
|
| 685 |
|
| 686 | template <class A,class B>
|
| 687 | BOOST_QVM_INLINE_OPERATIONS
|
| 688 | typename lazy_enable_if_c<
|
| 689 | mat_traits<A>::rows==1 && mat_traits<A>::cols==4 && is_scalar<B>::value,
|
| 690 | deduce_mat<A> >::type
|
| 691 | operator*( A const & a, B b )
|
| 692 | {
|
| 693 | typedef typename deduce_mat<A>::type R;
|
| 694 | R r;
|
| 695 | mat_traits<R>::template write_element<0,0>(r)=mat_traits<A>::template read_element<0,0>(a)*b;
|
| 696 | mat_traits<R>::template write_element<0,1>(r)=mat_traits<A>::template read_element<0,1>(a)*b;
|
| 697 | mat_traits<R>::template write_element<0,2>(r)=mat_traits<A>::template read_element<0,2>(a)*b;
|
| 698 | mat_traits<R>::template write_element<0,3>(r)=mat_traits<A>::template read_element<0,3>(a)*b;
|
| 699 | return r;
|
| 700 | }
|
| 701 |
|
| 702 | namespace
|
| 703 | sfinae
|
| 704 | {
|
| 705 | using ::boost::qvm::operator*;
|
| 706 | }
|
| 707 |
|
| 708 | namespace
|
| 709 | qvm_detail
|
| 710 | {
|
| 711 | template <int R,int C>
|
| 712 | struct mul_ms_defined;
|
| 713 |
|
| 714 | template <>
|
| 715 | struct
|
| 716 | mul_ms_defined<1,4>
|
| 717 | {
|
| 718 | static bool const value=true;
|
| 719 | };
|
| 720 | }
|
| 721 |
|
| 722 | template <class A,class B>
|
| 723 | BOOST_QVM_INLINE_OPERATIONS
|
| 724 | typename lazy_enable_if_c<
|
| 725 | is_scalar<A>::value && mat_traits<B>::rows==1 && mat_traits<B>::cols==4,
|
| 726 | deduce_mat<B> >::type
|
| 727 | operator*( A a, B const & b )
|
| 728 | {
|
| 729 | typedef typename deduce_mat<B>::type R;
|
| 730 | R r;
|
| 731 | mat_traits<R>::template write_element<0,0>(r)=a*mat_traits<B>::template read_element<0,0>(b);
|
| 732 | mat_traits<R>::template write_element<0,1>(r)=a*mat_traits<B>::template read_element<0,1>(b);
|
| 733 | mat_traits<R>::template write_element<0,2>(r)=a*mat_traits<B>::template read_element<0,2>(b);
|
| 734 | mat_traits<R>::template write_element<0,3>(r)=a*mat_traits<B>::template read_element<0,3>(b);
|
| 735 | return r;
|
| 736 | }
|
| 737 |
|
| 738 | namespace
|
| 739 | sfinae
|
| 740 | {
|
| 741 | using ::boost::qvm::operator*;
|
| 742 | }
|
| 743 |
|
| 744 | namespace
|
| 745 | qvm_detail
|
| 746 | {
|
| 747 | template <int R,int C>
|
| 748 | struct mul_sm_defined;
|
| 749 |
|
| 750 | template <>
|
| 751 | struct
|
| 752 | mul_sm_defined<1,4>
|
| 753 | {
|
| 754 | static bool const value=true;
|
| 755 | };
|
| 756 | }
|
| 757 |
|
| 758 | template <class A,class B>
|
| 759 | BOOST_QVM_INLINE_OPERATIONS
|
| 760 | typename enable_if_c<
|
| 761 | mat_traits<A>::rows==4 && mat_traits<A>::cols==4 && is_scalar<B>::value,
|
| 762 | A &>::type
|
| 763 | operator*=( A & a, B b )
|
| 764 | {
|
| 765 | mat_traits<A>::template write_element<0,0>(a)*=b;
|
| 766 | mat_traits<A>::template write_element<0,1>(a)*=b;
|
| 767 | mat_traits<A>::template write_element<0,2>(a)*=b;
|
| 768 | mat_traits<A>::template write_element<0,3>(a)*=b;
|
| 769 | mat_traits<A>::template write_element<1,0>(a)*=b;
|
| 770 | mat_traits<A>::template write_element<1,1>(a)*=b;
|
| 771 | mat_traits<A>::template write_element<1,2>(a)*=b;
|
| 772 | mat_traits<A>::template write_element<1,3>(a)*=b;
|
| 773 | mat_traits<A>::template write_element<2,0>(a)*=b;
|
| 774 | mat_traits<A>::template write_element<2,1>(a)*=b;
|
| 775 | mat_traits<A>::template write_element<2,2>(a)*=b;
|
| 776 | mat_traits<A>::template write_element<2,3>(a)*=b;
|
| 777 | mat_traits<A>::template write_element<3,0>(a)*=b;
|
| 778 | mat_traits<A>::template write_element<3,1>(a)*=b;
|
| 779 | mat_traits<A>::template write_element<3,2>(a)*=b;
|
| 780 | mat_traits<A>::template write_element<3,3>(a)*=b;
|
| 781 | return a;
|
| 782 | }
|
| 783 |
|
| 784 | namespace
|
| 785 | sfinae
|
| 786 | {
|
| 787 | using ::boost::qvm::operator*=;
|
| 788 | }
|
| 789 |
|
| 790 | namespace
|
| 791 | qvm_detail
|
| 792 | {
|
| 793 | template <int R,int C>
|
| 794 | struct mul_eq_ms_defined;
|
| 795 |
|
| 796 | template <>
|
| 797 | struct
|
| 798 | mul_eq_ms_defined<4,4>
|
| 799 | {
|
| 800 | static bool const value=true;
|
| 801 | };
|
| 802 | }
|
| 803 |
|
| 804 | template <class A,class B>
|
| 805 | BOOST_QVM_INLINE_OPERATIONS
|
| 806 | typename enable_if_c<
|
| 807 | mat_traits<A>::rows==4 && mat_traits<A>::cols==1 && is_scalar<B>::value,
|
| 808 | A &>::type
|
| 809 | operator*=( A & a, B b )
|
| 810 | {
|
| 811 | mat_traits<A>::template write_element<0,0>(a)*=b;
|
| 812 | mat_traits<A>::template write_element<1,0>(a)*=b;
|
| 813 | mat_traits<A>::template write_element<2,0>(a)*=b;
|
| 814 | mat_traits<A>::template write_element<3,0>(a)*=b;
|
| 815 | return a;
|
| 816 | }
|
| 817 |
|
| 818 | namespace
|
| 819 | sfinae
|
| 820 | {
|
| 821 | using ::boost::qvm::operator*=;
|
| 822 | }
|
| 823 |
|
| 824 | namespace
|
| 825 | qvm_detail
|
| 826 | {
|
| 827 | template <int R,int C>
|
| 828 | struct mul_eq_ms_defined;
|
| 829 |
|
| 830 | template <>
|
| 831 | struct
|
| 832 | mul_eq_ms_defined<4,1>
|
| 833 | {
|
| 834 | static bool const value=true;
|
| 835 | };
|
| 836 | }
|
| 837 |
|
| 838 | template <class A,class B>
|
| 839 | BOOST_QVM_INLINE_OPERATIONS
|
| 840 | typename enable_if_c<
|
| 841 | mat_traits<A>::rows==1 && mat_traits<A>::cols==4 && is_scalar<B>::value,
|
| 842 | A &>::type
|
| 843 | operator*=( A & a, B b )
|
| 844 | {
|
| 845 | mat_traits<A>::template write_element<0,0>(a)*=b;
|
| 846 | mat_traits<A>::template write_element<0,1>(a)*=b;
|
| 847 | mat_traits<A>::template write_element<0,2>(a)*=b;
|
| 848 | mat_traits<A>::template write_element<0,3>(a)*=b;
|
| 849 | return a;
|
| 850 | }
|
| 851 |
|
| 852 | namespace
|
| 853 | sfinae
|
| 854 | {
|
| 855 | using ::boost::qvm::operator*=;
|
| 856 | }
|
| 857 |
|
| 858 | namespace
|
| 859 | qvm_detail
|
| 860 | {
|
| 861 | template <int R,int C>
|
| 862 | struct mul_eq_ms_defined;
|
| 863 |
|
| 864 | template <>
|
| 865 | struct
|
| 866 | mul_eq_ms_defined<1,4>
|
| 867 | {
|
| 868 | static bool const value=true;
|
| 869 | };
|
| 870 | }
|
| 871 |
|
| 872 | template <class A,class B>
|
| 873 | BOOST_QVM_INLINE_OPERATIONS
|
| 874 | typename lazy_enable_if_c<
|
| 875 | mat_traits<A>::rows==4 && mat_traits<A>::cols==4 && is_scalar<B>::value,
|
| 876 | deduce_mat<A> >::type
|
| 877 | operator/( A const & a, B b )
|
| 878 | {
|
| 879 | typedef typename deduce_mat<A>::type R;
|
| 880 | R r;
|
| 881 | mat_traits<R>::template write_element<0,0>(r)=mat_traits<A>::template read_element<0,0>(a)/b;
|
| 882 | mat_traits<R>::template write_element<0,1>(r)=mat_traits<A>::template read_element<0,1>(a)/b;
|
| 883 | mat_traits<R>::template write_element<0,2>(r)=mat_traits<A>::template read_element<0,2>(a)/b;
|
| 884 | mat_traits<R>::template write_element<0,3>(r)=mat_traits<A>::template read_element<0,3>(a)/b;
|
| 885 | mat_traits<R>::template write_element<1,0>(r)=mat_traits<A>::template read_element<1,0>(a)/b;
|
| 886 | mat_traits<R>::template write_element<1,1>(r)=mat_traits<A>::template read_element<1,1>(a)/b;
|
| 887 | mat_traits<R>::template write_element<1,2>(r)=mat_traits<A>::template read_element<1,2>(a)/b;
|
| 888 | mat_traits<R>::template write_element<1,3>(r)=mat_traits<A>::template read_element<1,3>(a)/b;
|
| 889 | mat_traits<R>::template write_element<2,0>(r)=mat_traits<A>::template read_element<2,0>(a)/b;
|
| 890 | mat_traits<R>::template write_element<2,1>(r)=mat_traits<A>::template read_element<2,1>(a)/b;
|
| 891 | mat_traits<R>::template write_element<2,2>(r)=mat_traits<A>::template read_element<2,2>(a)/b;
|
| 892 | mat_traits<R>::template write_element<2,3>(r)=mat_traits<A>::template read_element<2,3>(a)/b;
|
| 893 | mat_traits<R>::template write_element<3,0>(r)=mat_traits<A>::template read_element<3,0>(a)/b;
|
| 894 | mat_traits<R>::template write_element<3,1>(r)=mat_traits<A>::template read_element<3,1>(a)/b;
|
| 895 | mat_traits<R>::template write_element<3,2>(r)=mat_traits<A>::template read_element<3,2>(a)/b;
|
| 896 | mat_traits<R>::template write_element<3,3>(r)=mat_traits<A>::template read_element<3,3>(a)/b;
|
| 897 | return r;
|
| 898 | }
|
| 899 |
|
| 900 | namespace
|
| 901 | sfinae
|
| 902 | {
|
| 903 | using ::boost::qvm::operator/;
|
| 904 | }
|
| 905 |
|
| 906 | namespace
|
| 907 | qvm_detail
|
| 908 | {
|
| 909 | template <int R,int C>
|
| 910 | struct div_ms_defined;
|
| 911 |
|
| 912 | template <>
|
| 913 | struct
|
| 914 | div_ms_defined<4,4>
|
| 915 | {
|
| 916 | static bool const value=true;
|
| 917 | };
|
| 918 | }
|
| 919 |
|
| 920 | template <class A,class B>
|
| 921 | BOOST_QVM_INLINE_OPERATIONS
|
| 922 | typename lazy_enable_if_c<
|
| 923 | is_scalar<A>::value && mat_traits<B>::rows==4 && mat_traits<B>::cols==4,
|
| 924 | deduce_mat<B> >::type
|
| 925 | operator/( A a, B const & b )
|
| 926 | {
|
| 927 | typedef typename deduce_mat<B>::type R;
|
| 928 | R r;
|
| 929 | mat_traits<R>::template write_element<0,0>(r)=a/mat_traits<B>::template read_element<0,0>(b);
|
| 930 | mat_traits<R>::template write_element<0,1>(r)=a/mat_traits<B>::template read_element<0,1>(b);
|
| 931 | mat_traits<R>::template write_element<0,2>(r)=a/mat_traits<B>::template read_element<0,2>(b);
|
| 932 | mat_traits<R>::template write_element<0,3>(r)=a/mat_traits<B>::template read_element<0,3>(b);
|
| 933 | mat_traits<R>::template write_element<1,0>(r)=a/mat_traits<B>::template read_element<1,0>(b);
|
| 934 | mat_traits<R>::template write_element<1,1>(r)=a/mat_traits<B>::template read_element<1,1>(b);
|
| 935 | mat_traits<R>::template write_element<1,2>(r)=a/mat_traits<B>::template read_element<1,2>(b);
|
| 936 | mat_traits<R>::template write_element<1,3>(r)=a/mat_traits<B>::template read_element<1,3>(b);
|
| 937 | mat_traits<R>::template write_element<2,0>(r)=a/mat_traits<B>::template read_element<2,0>(b);
|
| 938 | mat_traits<R>::template write_element<2,1>(r)=a/mat_traits<B>::template read_element<2,1>(b);
|
| 939 | mat_traits<R>::template write_element<2,2>(r)=a/mat_traits<B>::template read_element<2,2>(b);
|
| 940 | mat_traits<R>::template write_element<2,3>(r)=a/mat_traits<B>::template read_element<2,3>(b);
|
| 941 | mat_traits<R>::template write_element<3,0>(r)=a/mat_traits<B>::template read_element<3,0>(b);
|
| 942 | mat_traits<R>::template write_element<3,1>(r)=a/mat_traits<B>::template read_element<3,1>(b);
|
| 943 | mat_traits<R>::template write_element<3,2>(r)=a/mat_traits<B>::template read_element<3,2>(b);
|
| 944 | mat_traits<R>::template write_element<3,3>(r)=a/mat_traits<B>::template read_element<3,3>(b);
|
| 945 | return r;
|
| 946 | }
|
| 947 |
|
| 948 | namespace
|
| 949 | sfinae
|
| 950 | {
|
| 951 | using ::boost::qvm::operator/;
|
| 952 | }
|
| 953 |
|
| 954 | namespace
|
| 955 | qvm_detail
|
| 956 | {
|
| 957 | template <int R,int C>
|
| 958 | struct div_sm_defined;
|
| 959 |
|
| 960 | template <>
|
| 961 | struct
|
| 962 | div_sm_defined<4,4>
|
| 963 | {
|
| 964 | static bool const value=true;
|
| 965 | };
|
| 966 | }
|
| 967 |
|
| 968 | template <class A,class B>
|
| 969 | BOOST_QVM_INLINE_OPERATIONS
|
| 970 | typename lazy_enable_if_c<
|
| 971 | mat_traits<A>::rows==4 && mat_traits<A>::cols==1 && is_scalar<B>::value,
|
| 972 | deduce_mat<A> >::type
|
| 973 | operator/( A const & a, B b )
|
| 974 | {
|
| 975 | typedef typename deduce_mat<A>::type R;
|
| 976 | R r;
|
| 977 | mat_traits<R>::template write_element<0,0>(r)=mat_traits<A>::template read_element<0,0>(a)/b;
|
| 978 | mat_traits<R>::template write_element<1,0>(r)=mat_traits<A>::template read_element<1,0>(a)/b;
|
| 979 | mat_traits<R>::template write_element<2,0>(r)=mat_traits<A>::template read_element<2,0>(a)/b;
|
| 980 | mat_traits<R>::template write_element<3,0>(r)=mat_traits<A>::template read_element<3,0>(a)/b;
|
| 981 | return r;
|
| 982 | }
|
| 983 |
|
| 984 | namespace
|
| 985 | sfinae
|
| 986 | {
|
| 987 | using ::boost::qvm::operator/;
|
| 988 | }
|
| 989 |
|
| 990 | namespace
|
| 991 | qvm_detail
|
| 992 | {
|
| 993 | template <int R,int C>
|
| 994 | struct div_ms_defined;
|
| 995 |
|
| 996 | template <>
|
| 997 | struct
|
| 998 | div_ms_defined<4,1>
|
| 999 | {
|
| 1000 | static bool const value=true;
|
| 1001 | };
|
| 1002 | }
|
| 1003 |
|
| 1004 | template <class A,class B>
|
| 1005 | BOOST_QVM_INLINE_OPERATIONS
|
| 1006 | typename lazy_enable_if_c<
|
| 1007 | is_scalar<A>::value && mat_traits<B>::rows==4 && mat_traits<B>::cols==1,
|
| 1008 | deduce_mat<B> >::type
|
| 1009 | operator/( A a, B const & b )
|
| 1010 | {
|
| 1011 | typedef typename deduce_mat<B>::type R;
|
| 1012 | R r;
|
| 1013 | mat_traits<R>::template write_element<0,0>(r)=a/mat_traits<B>::template read_element<0,0>(b);
|
| 1014 | mat_traits<R>::template write_element<1,0>(r)=a/mat_traits<B>::template read_element<1,0>(b);
|
| 1015 | mat_traits<R>::template write_element<2,0>(r)=a/mat_traits<B>::template read_element<2,0>(b);
|
| 1016 | mat_traits<R>::template write_element<3,0>(r)=a/mat_traits<B>::template read_element<3,0>(b);
|
| 1017 | return r;
|
| 1018 | }
|
| 1019 |
|
| 1020 | namespace
|
| 1021 | sfinae
|
| 1022 | {
|
| 1023 | using ::boost::qvm::operator/;
|
| 1024 | }
|
| 1025 |
|
| 1026 | namespace
|
| 1027 | qvm_detail
|
| 1028 | {
|
| 1029 | template <int R,int C>
|
| 1030 | struct div_sm_defined;
|
| 1031 |
|
| 1032 | template <>
|
| 1033 | struct
|
| 1034 | div_sm_defined<4,1>
|
| 1035 | {
|
| 1036 | static bool const value=true;
|
| 1037 | };
|
| 1038 | }
|
| 1039 |
|
| 1040 | template <class A,class B>
|
| 1041 | BOOST_QVM_INLINE_OPERATIONS
|
| 1042 | typename lazy_enable_if_c<
|
| 1043 | mat_traits<A>::rows==1 && mat_traits<A>::cols==4 && is_scalar<B>::value,
|
| 1044 | deduce_mat<A> >::type
|
| 1045 | operator/( A const & a, B b )
|
| 1046 | {
|
| 1047 | typedef typename deduce_mat<A>::type R;
|
| 1048 | R r;
|
| 1049 | mat_traits<R>::template write_element<0,0>(r)=mat_traits<A>::template read_element<0,0>(a)/b;
|
| 1050 | mat_traits<R>::template write_element<0,1>(r)=mat_traits<A>::template read_element<0,1>(a)/b;
|
| 1051 | mat_traits<R>::template write_element<0,2>(r)=mat_traits<A>::template read_element<0,2>(a)/b;
|
| 1052 | mat_traits<R>::template write_element<0,3>(r)=mat_traits<A>::template read_element<0,3>(a)/b;
|
| 1053 | return r;
|
| 1054 | }
|
| 1055 |
|
| 1056 | namespace
|
| 1057 | sfinae
|
| 1058 | {
|
| 1059 | using ::boost::qvm::operator/;
|
| 1060 | }
|
| 1061 |
|
| 1062 | namespace
|
| 1063 | qvm_detail
|
| 1064 | {
|
| 1065 | template <int R,int C>
|
| 1066 | struct div_ms_defined;
|
| 1067 |
|
| 1068 | template <>
|
| 1069 | struct
|
| 1070 | div_ms_defined<1,4>
|
| 1071 | {
|
| 1072 | static bool const value=true;
|
| 1073 | };
|
| 1074 | }
|
| 1075 |
|
| 1076 | template <class A,class B>
|
| 1077 | BOOST_QVM_INLINE_OPERATIONS
|
| 1078 | typename enable_if_c<
|
| 1079 | mat_traits<A>::rows==4 && mat_traits<A>::cols==4 && is_scalar<B>::value,
|
| 1080 | A &>::type
|
| 1081 | operator/=( A & a, B b )
|
| 1082 | {
|
| 1083 | mat_traits<A>::template write_element<0,0>(a)/=b;
|
| 1084 | mat_traits<A>::template write_element<0,1>(a)/=b;
|
| 1085 | mat_traits<A>::template write_element<0,2>(a)/=b;
|
| 1086 | mat_traits<A>::template write_element<0,3>(a)/=b;
|
| 1087 | mat_traits<A>::template write_element<1,0>(a)/=b;
|
| 1088 | mat_traits<A>::template write_element<1,1>(a)/=b;
|
| 1089 | mat_traits<A>::template write_element<1,2>(a)/=b;
|
| 1090 | mat_traits<A>::template write_element<1,3>(a)/=b;
|
| 1091 | mat_traits<A>::template write_element<2,0>(a)/=b;
|
| 1092 | mat_traits<A>::template write_element<2,1>(a)/=b;
|
| 1093 | mat_traits<A>::template write_element<2,2>(a)/=b;
|
| 1094 | mat_traits<A>::template write_element<2,3>(a)/=b;
|
| 1095 | mat_traits<A>::template write_element<3,0>(a)/=b;
|
| 1096 | mat_traits<A>::template write_element<3,1>(a)/=b;
|
| 1097 | mat_traits<A>::template write_element<3,2>(a)/=b;
|
| 1098 | mat_traits<A>::template write_element<3,3>(a)/=b;
|
| 1099 | return a;
|
| 1100 | }
|
| 1101 |
|
| 1102 | namespace
|
| 1103 | sfinae
|
| 1104 | {
|
| 1105 | using ::boost::qvm::operator/=;
|
| 1106 | }
|
| 1107 |
|
| 1108 | namespace
|
| 1109 | qvm_detail
|
| 1110 | {
|
| 1111 | template <int R,int C>
|
| 1112 | struct div_eq_ms_defined;
|
| 1113 |
|
| 1114 | template <>
|
| 1115 | struct
|
| 1116 | div_eq_ms_defined<4,4>
|
| 1117 | {
|
| 1118 | static bool const value=true;
|
| 1119 | };
|
| 1120 | }
|
| 1121 |
|
| 1122 | template <class A,class B>
|
| 1123 | BOOST_QVM_INLINE_OPERATIONS
|
| 1124 | typename enable_if_c<
|
| 1125 | mat_traits<A>::rows==4 && mat_traits<A>::cols==1 && is_scalar<B>::value,
|
| 1126 | A &>::type
|
| 1127 | operator/=( A & a, B b )
|
| 1128 | {
|
| 1129 | mat_traits<A>::template write_element<0,0>(a)/=b;
|
| 1130 | mat_traits<A>::template write_element<1,0>(a)/=b;
|
| 1131 | mat_traits<A>::template write_element<2,0>(a)/=b;
|
| 1132 | mat_traits<A>::template write_element<3,0>(a)/=b;
|
| 1133 | return a;
|
| 1134 | }
|
| 1135 |
|
| 1136 | namespace
|
| 1137 | sfinae
|
| 1138 | {
|
| 1139 | using ::boost::qvm::operator/=;
|
| 1140 | }
|
| 1141 |
|
| 1142 | namespace
|
| 1143 | qvm_detail
|
| 1144 | {
|
| 1145 | template <int R,int C>
|
| 1146 | struct div_eq_ms_defined;
|
| 1147 |
|
| 1148 | template <>
|
| 1149 | struct
|
| 1150 | div_eq_ms_defined<4,1>
|
| 1151 | {
|
| 1152 | static bool const value=true;
|
| 1153 | };
|
| 1154 | }
|
| 1155 |
|
| 1156 | template <class A,class B>
|
| 1157 | BOOST_QVM_INLINE_OPERATIONS
|
| 1158 | typename enable_if_c<
|
| 1159 | mat_traits<A>::rows==1 && mat_traits<A>::cols==4 && is_scalar<B>::value,
|
| 1160 | A &>::type
|
| 1161 | operator/=( A & a, B b )
|
| 1162 | {
|
| 1163 | mat_traits<A>::template write_element<0,0>(a)/=b;
|
| 1164 | mat_traits<A>::template write_element<0,1>(a)/=b;
|
| 1165 | mat_traits<A>::template write_element<0,2>(a)/=b;
|
| 1166 | mat_traits<A>::template write_element<0,3>(a)/=b;
|
| 1167 | return a;
|
| 1168 | }
|
| 1169 |
|
| 1170 | namespace
|
| 1171 | sfinae
|
| 1172 | {
|
| 1173 | using ::boost::qvm::operator/=;
|
| 1174 | }
|
| 1175 |
|
| 1176 | namespace
|
| 1177 | qvm_detail
|
| 1178 | {
|
| 1179 | template <int R,int C>
|
| 1180 | struct div_eq_ms_defined;
|
| 1181 |
|
| 1182 | template <>
|
| 1183 | struct
|
| 1184 | div_eq_ms_defined<1,4>
|
| 1185 | {
|
| 1186 | static bool const value=true;
|
| 1187 | };
|
| 1188 | }
|
| 1189 |
|
| 1190 | template <class R,class A>
|
| 1191 | BOOST_QVM_INLINE_OPERATIONS
|
| 1192 | typename enable_if_c<
|
| 1193 | mat_traits<R>::rows==4 && mat_traits<A>::rows==4 &&
|
| 1194 | mat_traits<R>::cols==4 && mat_traits<A>::cols==4,
|
| 1195 | R>::type
|
| 1196 | convert_to( A const & a )
|
| 1197 | {
|
| 1198 | R r;
|
| 1199 | mat_traits<R>::template write_element<0,0>(r) = mat_traits<A>::template read_element<0,0>(a);
|
| 1200 | mat_traits<R>::template write_element<0,1>(r) = mat_traits<A>::template read_element<0,1>(a);
|
| 1201 | mat_traits<R>::template write_element<0,2>(r) = mat_traits<A>::template read_element<0,2>(a);
|
| 1202 | mat_traits<R>::template write_element<0,3>(r) = mat_traits<A>::template read_element<0,3>(a);
|
| 1203 | mat_traits<R>::template write_element<1,0>(r) = mat_traits<A>::template read_element<1,0>(a);
|
| 1204 | mat_traits<R>::template write_element<1,1>(r) = mat_traits<A>::template read_element<1,1>(a);
|
| 1205 | mat_traits<R>::template write_element<1,2>(r) = mat_traits<A>::template read_element<1,2>(a);
|
| 1206 | mat_traits<R>::template write_element<1,3>(r) = mat_traits<A>::template read_element<1,3>(a);
|
| 1207 | mat_traits<R>::template write_element<2,0>(r) = mat_traits<A>::template read_element<2,0>(a);
|
| 1208 | mat_traits<R>::template write_element<2,1>(r) = mat_traits<A>::template read_element<2,1>(a);
|
| 1209 | mat_traits<R>::template write_element<2,2>(r) = mat_traits<A>::template read_element<2,2>(a);
|
| 1210 | mat_traits<R>::template write_element<2,3>(r) = mat_traits<A>::template read_element<2,3>(a);
|
| 1211 | mat_traits<R>::template write_element<3,0>(r) = mat_traits<A>::template read_element<3,0>(a);
|
| 1212 | mat_traits<R>::template write_element<3,1>(r) = mat_traits<A>::template read_element<3,1>(a);
|
| 1213 | mat_traits<R>::template write_element<3,2>(r) = mat_traits<A>::template read_element<3,2>(a);
|
| 1214 | mat_traits<R>::template write_element<3,3>(r) = mat_traits<A>::template read_element<3,3>(a);
|
| 1215 | return r;
|
| 1216 | }
|
| 1217 |
|
| 1218 | template <class R,class A>
|
| 1219 | BOOST_QVM_INLINE
|
| 1220 | typename enable_if_c<
|
| 1221 | is_mat<R>::value && is_quat<A>::value &&
|
| 1222 | mat_traits<R>::rows==4 && mat_traits<R>::cols==4,
|
| 1223 | R>::type
|
| 1224 | convert_to( A const & q )
|
| 1225 | {
|
| 1226 | typedef typename mat_traits<R>::scalar_type T;
|
| 1227 | T const a=quat_traits<A>::template read_element<0>(q);
|
| 1228 | T const b=quat_traits<A>::template read_element<1>(q);
|
| 1229 | T const c=quat_traits<A>::template read_element<2>(q);
|
| 1230 | T const d=quat_traits<A>::template read_element<3>(q);
|
| 1231 | T const bb = b*b;
|
| 1232 | T const cc = c*c;
|
| 1233 | T const dd = d*d;
|
| 1234 | T const bc = b*c;
|
| 1235 | T const bd = b*d;
|
| 1236 | T const cd = c*d;
|
| 1237 | T const ab = a*b;
|
| 1238 | T const ac = a*c;
|
| 1239 | T const ad = a*d;
|
| 1240 | T const zero = scalar_traits<T>::value(0);
|
| 1241 | T const one = scalar_traits<T>::value(1);
|
| 1242 | T const two = one+one;
|
| 1243 | R r;
|
| 1244 | mat_traits<R>::template write_element<0,0>(r) = one - two*(cc+dd);
|
| 1245 | mat_traits<R>::template write_element<0,1>(r) = two*(bc-ad);
|
| 1246 | mat_traits<R>::template write_element<0,2>(r) = two*(bd+ac);
|
| 1247 | mat_traits<R>::template write_element<0,3>(r) = zero;
|
| 1248 | mat_traits<R>::template write_element<1,0>(r) = two*(bc+ad);
|
| 1249 | mat_traits<R>::template write_element<1,1>(r) = one - two*(bb+dd);
|
| 1250 | mat_traits<R>::template write_element<1,2>(r) = two*(cd-ab);
|
| 1251 | mat_traits<R>::template write_element<1,3>(r) = zero;
|
| 1252 | mat_traits<R>::template write_element<2,0>(r) = two*(bd-ac);
|
| 1253 | mat_traits<R>::template write_element<2,1>(r) = two*(cd+ab);
|
| 1254 | mat_traits<R>::template write_element<2,2>(r) = one - two*(bb+cc);
|
| 1255 | mat_traits<R>::template write_element<2,3>(r) = zero;
|
| 1256 | mat_traits<R>::template write_element<3,0>(r) = zero;
|
| 1257 | mat_traits<R>::template write_element<3,1>(r) = zero;
|
| 1258 | mat_traits<R>::template write_element<3,2>(r) = zero;
|
| 1259 | mat_traits<R>::template write_element<3,3>(r) = one;
|
| 1260 | return r;
|
| 1261 | }
|
| 1262 |
|
| 1263 | namespace
|
| 1264 | sfinae
|
| 1265 | {
|
| 1266 | using ::boost::qvm::convert_to;
|
| 1267 | }
|
| 1268 |
|
| 1269 | namespace
|
| 1270 | qvm_detail
|
| 1271 | {
|
| 1272 | template <int R,int C>
|
| 1273 | struct convert_to_m_defined;
|
| 1274 |
|
| 1275 | template <>
|
| 1276 | struct
|
| 1277 | convert_to_m_defined<4,4>
|
| 1278 | {
|
| 1279 | static bool const value=true;
|
| 1280 | };
|
| 1281 | }
|
| 1282 |
|
| 1283 | template <class R,class A>
|
| 1284 | BOOST_QVM_INLINE_OPERATIONS
|
| 1285 | typename enable_if_c<
|
| 1286 | mat_traits<R>::rows==4 && mat_traits<A>::rows==4 &&
|
| 1287 | mat_traits<R>::cols==1 && mat_traits<A>::cols==1,
|
| 1288 | R>::type
|
| 1289 | convert_to( A const & a )
|
| 1290 | {
|
| 1291 | R r;
|
| 1292 | mat_traits<R>::template write_element<0,0>(r) = mat_traits<A>::template read_element<0,0>(a);
|
| 1293 | mat_traits<R>::template write_element<1,0>(r) = mat_traits<A>::template read_element<1,0>(a);
|
| 1294 | mat_traits<R>::template write_element<2,0>(r) = mat_traits<A>::template read_element<2,0>(a);
|
| 1295 | mat_traits<R>::template write_element<3,0>(r) = mat_traits<A>::template read_element<3,0>(a);
|
| 1296 | return r;
|
| 1297 | }
|
| 1298 |
|
| 1299 | namespace
|
| 1300 | sfinae
|
| 1301 | {
|
| 1302 | using ::boost::qvm::convert_to;
|
| 1303 | }
|
| 1304 |
|
| 1305 | namespace
|
| 1306 | qvm_detail
|
| 1307 | {
|
| 1308 | template <int R,int C>
|
| 1309 | struct convert_to_m_defined;
|
| 1310 |
|
| 1311 | template <>
|
| 1312 | struct
|
| 1313 | convert_to_m_defined<4,1>
|
| 1314 | {
|
| 1315 | static bool const value=true;
|
| 1316 | };
|
| 1317 | }
|
| 1318 |
|
| 1319 | template <class R,class A>
|
| 1320 | BOOST_QVM_INLINE_OPERATIONS
|
| 1321 | typename enable_if_c<
|
| 1322 | mat_traits<R>::rows==1 && mat_traits<A>::rows==1 &&
|
| 1323 | mat_traits<R>::cols==4 && mat_traits<A>::cols==4,
|
| 1324 | R>::type
|
| 1325 | convert_to( A const & a )
|
| 1326 | {
|
| 1327 | R r;
|
| 1328 | mat_traits<R>::template write_element<0,0>(r) = mat_traits<A>::template read_element<0,0>(a);
|
| 1329 | mat_traits<R>::template write_element<0,1>(r) = mat_traits<A>::template read_element<0,1>(a);
|
| 1330 | mat_traits<R>::template write_element<0,2>(r) = mat_traits<A>::template read_element<0,2>(a);
|
| 1331 | mat_traits<R>::template write_element<0,3>(r) = mat_traits<A>::template read_element<0,3>(a);
|
| 1332 | return r;
|
| 1333 | }
|
| 1334 |
|
| 1335 | namespace
|
| 1336 | sfinae
|
| 1337 | {
|
| 1338 | using ::boost::qvm::convert_to;
|
| 1339 | }
|
| 1340 |
|
| 1341 | namespace
|
| 1342 | qvm_detail
|
| 1343 | {
|
| 1344 | template <int R,int C>
|
| 1345 | struct convert_to_m_defined;
|
| 1346 |
|
| 1347 | template <>
|
| 1348 | struct
|
| 1349 | convert_to_m_defined<1,4>
|
| 1350 | {
|
| 1351 | static bool const value=true;
|
| 1352 | };
|
| 1353 | }
|
| 1354 |
|
| 1355 | template <class A,class B>
|
| 1356 | BOOST_QVM_INLINE_OPERATIONS
|
| 1357 | typename enable_if_c<
|
| 1358 | mat_traits<A>::rows==4 && mat_traits<B>::rows==4 &&
|
| 1359 | mat_traits<A>::cols==4 && mat_traits<B>::cols==4,
|
| 1360 | bool>::type
|
| 1361 | operator==( A const & a, B const & b )
|
| 1362 | {
|
| 1363 | return
|
| 1364 | mat_traits<A>::template read_element<0,0>(a)==mat_traits<B>::template read_element<0,0>(b) &&
|
| 1365 | mat_traits<A>::template read_element<0,1>(a)==mat_traits<B>::template read_element<0,1>(b) &&
|
| 1366 | mat_traits<A>::template read_element<0,2>(a)==mat_traits<B>::template read_element<0,2>(b) &&
|
| 1367 | mat_traits<A>::template read_element<0,3>(a)==mat_traits<B>::template read_element<0,3>(b) &&
|
| 1368 | mat_traits<A>::template read_element<1,0>(a)==mat_traits<B>::template read_element<1,0>(b) &&
|
| 1369 | mat_traits<A>::template read_element<1,1>(a)==mat_traits<B>::template read_element<1,1>(b) &&
|
| 1370 | mat_traits<A>::template read_element<1,2>(a)==mat_traits<B>::template read_element<1,2>(b) &&
|
| 1371 | mat_traits<A>::template read_element<1,3>(a)==mat_traits<B>::template read_element<1,3>(b) &&
|
| 1372 | mat_traits<A>::template read_element<2,0>(a)==mat_traits<B>::template read_element<2,0>(b) &&
|
| 1373 | mat_traits<A>::template read_element<2,1>(a)==mat_traits<B>::template read_element<2,1>(b) &&
|
| 1374 | mat_traits<A>::template read_element<2,2>(a)==mat_traits<B>::template read_element<2,2>(b) &&
|
| 1375 | mat_traits<A>::template read_element<2,3>(a)==mat_traits<B>::template read_element<2,3>(b) &&
|
| 1376 | mat_traits<A>::template read_element<3,0>(a)==mat_traits<B>::template read_element<3,0>(b) &&
|
| 1377 | mat_traits<A>::template read_element<3,1>(a)==mat_traits<B>::template read_element<3,1>(b) &&
|
| 1378 | mat_traits<A>::template read_element<3,2>(a)==mat_traits<B>::template read_element<3,2>(b) &&
|
| 1379 | mat_traits<A>::template read_element<3,3>(a)==mat_traits<B>::template read_element<3,3>(b);
|
| 1380 | }
|
| 1381 |
|
| 1382 | namespace
|
| 1383 | sfinae
|
| 1384 | {
|
| 1385 | using ::boost::qvm::operator==;
|
| 1386 | }
|
| 1387 |
|
| 1388 | namespace
|
| 1389 | qvm_detail
|
| 1390 | {
|
| 1391 | template <int R,int C>
|
| 1392 | struct eq_mm_defined;
|
| 1393 |
|
| 1394 | template <>
|
| 1395 | struct
|
| 1396 | eq_mm_defined<4,4>
|
| 1397 | {
|
| 1398 | static bool const value=true;
|
| 1399 | };
|
| 1400 | }
|
| 1401 |
|
| 1402 | template <class A,class B>
|
| 1403 | BOOST_QVM_INLINE_OPERATIONS
|
| 1404 | typename enable_if_c<
|
| 1405 | mat_traits<A>::rows==4 && mat_traits<B>::rows==4 &&
|
| 1406 | mat_traits<A>::cols==1 && mat_traits<B>::cols==1,
|
| 1407 | bool>::type
|
| 1408 | operator==( A const & a, B const & b )
|
| 1409 | {
|
| 1410 | return
|
| 1411 | mat_traits<A>::template read_element<0,0>(a)==mat_traits<B>::template read_element<0,0>(b) &&
|
| 1412 | mat_traits<A>::template read_element<1,0>(a)==mat_traits<B>::template read_element<1,0>(b) &&
|
| 1413 | mat_traits<A>::template read_element<2,0>(a)==mat_traits<B>::template read_element<2,0>(b) &&
|
| 1414 | mat_traits<A>::template read_element<3,0>(a)==mat_traits<B>::template read_element<3,0>(b);
|
| 1415 | }
|
| 1416 |
|
| 1417 | namespace
|
| 1418 | sfinae
|
| 1419 | {
|
| 1420 | using ::boost::qvm::operator==;
|
| 1421 | }
|
| 1422 |
|
| 1423 | namespace
|
| 1424 | qvm_detail
|
| 1425 | {
|
| 1426 | template <int R,int C>
|
| 1427 | struct eq_mm_defined;
|
| 1428 |
|
| 1429 | template <>
|
| 1430 | struct
|
| 1431 | eq_mm_defined<4,1>
|
| 1432 | {
|
| 1433 | static bool const value=true;
|
| 1434 | };
|
| 1435 | }
|
| 1436 |
|
| 1437 | template <class A,class B>
|
| 1438 | BOOST_QVM_INLINE_OPERATIONS
|
| 1439 | typename enable_if_c<
|
| 1440 | mat_traits<A>::rows==1 && mat_traits<B>::rows==1 &&
|
| 1441 | mat_traits<A>::cols==4 && mat_traits<B>::cols==4,
|
| 1442 | bool>::type
|
| 1443 | operator==( A const & a, B const & b )
|
| 1444 | {
|
| 1445 | return
|
| 1446 | mat_traits<A>::template read_element<0,0>(a)==mat_traits<B>::template read_element<0,0>(b) &&
|
| 1447 | mat_traits<A>::template read_element<0,1>(a)==mat_traits<B>::template read_element<0,1>(b) &&
|
| 1448 | mat_traits<A>::template read_element<0,2>(a)==mat_traits<B>::template read_element<0,2>(b) &&
|
| 1449 | mat_traits<A>::template read_element<0,3>(a)==mat_traits<B>::template read_element<0,3>(b);
|
| 1450 | }
|
| 1451 |
|
| 1452 | namespace
|
| 1453 | sfinae
|
| 1454 | {
|
| 1455 | using ::boost::qvm::operator==;
|
| 1456 | }
|
| 1457 |
|
| 1458 | namespace
|
| 1459 | qvm_detail
|
| 1460 | {
|
| 1461 | template <int R,int C>
|
| 1462 | struct eq_mm_defined;
|
| 1463 |
|
| 1464 | template <>
|
| 1465 | struct
|
| 1466 | eq_mm_defined<1,4>
|
| 1467 | {
|
| 1468 | static bool const value=true;
|
| 1469 | };
|
| 1470 | }
|
| 1471 |
|
| 1472 | template <class A,class B>
|
| 1473 | BOOST_QVM_INLINE_OPERATIONS
|
| 1474 | typename enable_if_c<
|
| 1475 | mat_traits<A>::rows==4 && mat_traits<B>::rows==4 &&
|
| 1476 | mat_traits<A>::cols==4 && mat_traits<B>::cols==4,
|
| 1477 | bool>::type
|
| 1478 | operator!=( A const & a, B const & b )
|
| 1479 | {
|
| 1480 | return
|
| 1481 | !(mat_traits<A>::template read_element<0,0>(a)==mat_traits<B>::template read_element<0,0>(b)) ||
|
| 1482 | !(mat_traits<A>::template read_element<0,1>(a)==mat_traits<B>::template read_element<0,1>(b)) ||
|
| 1483 | !(mat_traits<A>::template read_element<0,2>(a)==mat_traits<B>::template read_element<0,2>(b)) ||
|
| 1484 | !(mat_traits<A>::template read_element<0,3>(a)==mat_traits<B>::template read_element<0,3>(b)) ||
|
| 1485 | !(mat_traits<A>::template read_element<1,0>(a)==mat_traits<B>::template read_element<1,0>(b)) ||
|
| 1486 | !(mat_traits<A>::template read_element<1,1>(a)==mat_traits<B>::template read_element<1,1>(b)) ||
|
| 1487 | !(mat_traits<A>::template read_element<1,2>(a)==mat_traits<B>::template read_element<1,2>(b)) ||
|
| 1488 | !(mat_traits<A>::template read_element<1,3>(a)==mat_traits<B>::template read_element<1,3>(b)) ||
|
| 1489 | !(mat_traits<A>::template read_element<2,0>(a)==mat_traits<B>::template read_element<2,0>(b)) ||
|
| 1490 | !(mat_traits<A>::template read_element<2,1>(a)==mat_traits<B>::template read_element<2,1>(b)) ||
|
| 1491 | !(mat_traits<A>::template read_element<2,2>(a)==mat_traits<B>::template read_element<2,2>(b)) ||
|
| 1492 | !(mat_traits<A>::template read_element<2,3>(a)==mat_traits<B>::template read_element<2,3>(b)) ||
|
| 1493 | !(mat_traits<A>::template read_element<3,0>(a)==mat_traits<B>::template read_element<3,0>(b)) ||
|
| 1494 | !(mat_traits<A>::template read_element<3,1>(a)==mat_traits<B>::template read_element<3,1>(b)) ||
|
| 1495 | !(mat_traits<A>::template read_element<3,2>(a)==mat_traits<B>::template read_element<3,2>(b)) ||
|
| 1496 | !(mat_traits<A>::template read_element<3,3>(a)==mat_traits<B>::template read_element<3,3>(b));
|
| 1497 | }
|
| 1498 |
|
| 1499 | namespace
|
| 1500 | sfinae
|
| 1501 | {
|
| 1502 | using ::boost::qvm::operator!=;
|
| 1503 | }
|
| 1504 |
|
| 1505 | namespace
|
| 1506 | qvm_detail
|
| 1507 | {
|
| 1508 | template <int R,int C>
|
| 1509 | struct neq_mm_defined;
|
| 1510 |
|
| 1511 | template <>
|
| 1512 | struct
|
| 1513 | neq_mm_defined<4,4>
|
| 1514 | {
|
| 1515 | static bool const value=true;
|
| 1516 | };
|
| 1517 | }
|
| 1518 |
|
| 1519 | template <class A,class B>
|
| 1520 | BOOST_QVM_INLINE_OPERATIONS
|
| 1521 | typename enable_if_c<
|
| 1522 | mat_traits<A>::rows==4 && mat_traits<B>::rows==4 &&
|
| 1523 | mat_traits<A>::cols==1 && mat_traits<B>::cols==1,
|
| 1524 | bool>::type
|
| 1525 | operator!=( A const & a, B const & b )
|
| 1526 | {
|
| 1527 | return
|
| 1528 | !(mat_traits<A>::template read_element<0,0>(a)==mat_traits<B>::template read_element<0,0>(b)) ||
|
| 1529 | !(mat_traits<A>::template read_element<1,0>(a)==mat_traits<B>::template read_element<1,0>(b)) ||
|
| 1530 | !(mat_traits<A>::template read_element<2,0>(a)==mat_traits<B>::template read_element<2,0>(b)) ||
|
| 1531 | !(mat_traits<A>::template read_element<3,0>(a)==mat_traits<B>::template read_element<3,0>(b));
|
| 1532 | }
|
| 1533 |
|
| 1534 | namespace
|
| 1535 | sfinae
|
| 1536 | {
|
| 1537 | using ::boost::qvm::operator!=;
|
| 1538 | }
|
| 1539 |
|
| 1540 | namespace
|
| 1541 | qvm_detail
|
| 1542 | {
|
| 1543 | template <int R,int C>
|
| 1544 | struct neq_mm_defined;
|
| 1545 |
|
| 1546 | template <>
|
| 1547 | struct
|
| 1548 | neq_mm_defined<4,1>
|
| 1549 | {
|
| 1550 | static bool const value=true;
|
| 1551 | };
|
| 1552 | }
|
| 1553 |
|
| 1554 | template <class A,class B>
|
| 1555 | BOOST_QVM_INLINE_OPERATIONS
|
| 1556 | typename enable_if_c<
|
| 1557 | mat_traits<A>::rows==1 && mat_traits<B>::rows==1 &&
|
| 1558 | mat_traits<A>::cols==4 && mat_traits<B>::cols==4,
|
| 1559 | bool>::type
|
| 1560 | operator!=( A const & a, B const & b )
|
| 1561 | {
|
| 1562 | return
|
| 1563 | !(mat_traits<A>::template read_element<0,0>(a)==mat_traits<B>::template read_element<0,0>(b)) ||
|
| 1564 | !(mat_traits<A>::template read_element<0,1>(a)==mat_traits<B>::template read_element<0,1>(b)) ||
|
| 1565 | !(mat_traits<A>::template read_element<0,2>(a)==mat_traits<B>::template read_element<0,2>(b)) ||
|
| 1566 | !(mat_traits<A>::template read_element<0,3>(a)==mat_traits<B>::template read_element<0,3>(b));
|
| 1567 | }
|
| 1568 |
|
| 1569 | namespace
|
| 1570 | sfinae
|
| 1571 | {
|
| 1572 | using ::boost::qvm::operator!=;
|
| 1573 | }
|
| 1574 |
|
| 1575 | namespace
|
| 1576 | qvm_detail
|
| 1577 | {
|
| 1578 | template <int R,int C>
|
| 1579 | struct neq_mm_defined;
|
| 1580 |
|
| 1581 | template <>
|
| 1582 | struct
|
| 1583 | neq_mm_defined<1,4>
|
| 1584 | {
|
| 1585 | static bool const value=true;
|
| 1586 | };
|
| 1587 | }
|
| 1588 |
|
| 1589 | template <class A>
|
| 1590 | BOOST_QVM_INLINE_OPERATIONS
|
| 1591 | typename lazy_enable_if_c<
|
| 1592 | mat_traits<A>::rows==4 && mat_traits<A>::cols==4,
|
| 1593 | deduce_mat<A> >::type
|
| 1594 | operator-( A const & a )
|
| 1595 | {
|
| 1596 | typedef typename deduce_mat<A>::type R;
|
| 1597 | R r;
|
| 1598 | mat_traits<R>::template write_element<0,0>(r)=-mat_traits<A>::template read_element<0,0>(a);
|
| 1599 | mat_traits<R>::template write_element<0,1>(r)=-mat_traits<A>::template read_element<0,1>(a);
|
| 1600 | mat_traits<R>::template write_element<0,2>(r)=-mat_traits<A>::template read_element<0,2>(a);
|
| 1601 | mat_traits<R>::template write_element<0,3>(r)=-mat_traits<A>::template read_element<0,3>(a);
|
| 1602 | mat_traits<R>::template write_element<1,0>(r)=-mat_traits<A>::template read_element<1,0>(a);
|
| 1603 | mat_traits<R>::template write_element<1,1>(r)=-mat_traits<A>::template read_element<1,1>(a);
|
| 1604 | mat_traits<R>::template write_element<1,2>(r)=-mat_traits<A>::template read_element<1,2>(a);
|
| 1605 | mat_traits<R>::template write_element<1,3>(r)=-mat_traits<A>::template read_element<1,3>(a);
|
| 1606 | mat_traits<R>::template write_element<2,0>(r)=-mat_traits<A>::template read_element<2,0>(a);
|
| 1607 | mat_traits<R>::template write_element<2,1>(r)=-mat_traits<A>::template read_element<2,1>(a);
|
| 1608 | mat_traits<R>::template write_element<2,2>(r)=-mat_traits<A>::template read_element<2,2>(a);
|
| 1609 | mat_traits<R>::template write_element<2,3>(r)=-mat_traits<A>::template read_element<2,3>(a);
|
| 1610 | mat_traits<R>::template write_element<3,0>(r)=-mat_traits<A>::template read_element<3,0>(a);
|
| 1611 | mat_traits<R>::template write_element<3,1>(r)=-mat_traits<A>::template read_element<3,1>(a);
|
| 1612 | mat_traits<R>::template write_element<3,2>(r)=-mat_traits<A>::template read_element<3,2>(a);
|
| 1613 | mat_traits<R>::template write_element<3,3>(r)=-mat_traits<A>::template read_element<3,3>(a);
|
| 1614 | return r;
|
| 1615 | }
|
| 1616 |
|
| 1617 | namespace
|
| 1618 | sfinae
|
| 1619 | {
|
| 1620 | using ::boost::qvm::operator-;
|
| 1621 | }
|
| 1622 |
|
| 1623 | namespace
|
| 1624 | qvm_detail
|
| 1625 | {
|
| 1626 | template <int R,int C>
|
| 1627 | struct minus_m_defined;
|
| 1628 |
|
| 1629 | template <>
|
| 1630 | struct
|
| 1631 | minus_m_defined<4,4>
|
| 1632 | {
|
| 1633 | static bool const value=true;
|
| 1634 | };
|
| 1635 | }
|
| 1636 |
|
| 1637 | template <class A>
|
| 1638 | BOOST_QVM_INLINE_OPERATIONS
|
| 1639 | typename lazy_enable_if_c<
|
| 1640 | mat_traits<A>::rows==4 && mat_traits<A>::cols==1,
|
| 1641 | deduce_mat<A> >::type
|
| 1642 | operator-( A const & a )
|
| 1643 | {
|
| 1644 | typedef typename deduce_mat<A>::type R;
|
| 1645 | R r;
|
| 1646 | mat_traits<R>::template write_element<0,0>(r)=-mat_traits<A>::template read_element<0,0>(a);
|
| 1647 | mat_traits<R>::template write_element<1,0>(r)=-mat_traits<A>::template read_element<1,0>(a);
|
| 1648 | mat_traits<R>::template write_element<2,0>(r)=-mat_traits<A>::template read_element<2,0>(a);
|
| 1649 | mat_traits<R>::template write_element<3,0>(r)=-mat_traits<A>::template read_element<3,0>(a);
|
| 1650 | return r;
|
| 1651 | }
|
| 1652 |
|
| 1653 | namespace
|
| 1654 | sfinae
|
| 1655 | {
|
| 1656 | using ::boost::qvm::operator-;
|
| 1657 | }
|
| 1658 |
|
| 1659 | namespace
|
| 1660 | qvm_detail
|
| 1661 | {
|
| 1662 | template <int R,int C>
|
| 1663 | struct minus_m_defined;
|
| 1664 |
|
| 1665 | template <>
|
| 1666 | struct
|
| 1667 | minus_m_defined<4,1>
|
| 1668 | {
|
| 1669 | static bool const value=true;
|
| 1670 | };
|
| 1671 | }
|
| 1672 |
|
| 1673 | template <class A>
|
| 1674 | BOOST_QVM_INLINE_OPERATIONS
|
| 1675 | typename lazy_enable_if_c<
|
| 1676 | mat_traits<A>::rows==1 && mat_traits<A>::cols==4,
|
| 1677 | deduce_mat<A> >::type
|
| 1678 | operator-( A const & a )
|
| 1679 | {
|
| 1680 | typedef typename deduce_mat<A>::type R;
|
| 1681 | R r;
|
| 1682 | mat_traits<R>::template write_element<0,0>(r)=-mat_traits<A>::template read_element<0,0>(a);
|
| 1683 | mat_traits<R>::template write_element<0,1>(r)=-mat_traits<A>::template read_element<0,1>(a);
|
| 1684 | mat_traits<R>::template write_element<0,2>(r)=-mat_traits<A>::template read_element<0,2>(a);
|
| 1685 | mat_traits<R>::template write_element<0,3>(r)=-mat_traits<A>::template read_element<0,3>(a);
|
| 1686 | return r;
|
| 1687 | }
|
| 1688 |
|
| 1689 | namespace
|
| 1690 | sfinae
|
| 1691 | {
|
| 1692 | using ::boost::qvm::operator-;
|
| 1693 | }
|
| 1694 |
|
| 1695 | namespace
|
| 1696 | qvm_detail
|
| 1697 | {
|
| 1698 | template <int R,int C>
|
| 1699 | struct minus_m_defined;
|
| 1700 |
|
| 1701 | template <>
|
| 1702 | struct
|
| 1703 | minus_m_defined<1,4>
|
| 1704 | {
|
| 1705 | static bool const value=true;
|
| 1706 | };
|
| 1707 | }
|
| 1708 |
|
| 1709 | template <class A>
|
| 1710 | BOOST_QVM_INLINE_OPERATIONS
|
| 1711 | typename enable_if_c<
|
| 1712 | mat_traits<A>::rows==4 && mat_traits<A>::cols==4,
|
| 1713 | typename mat_traits<A>::scalar_type>::type
|
| 1714 | determinant( A const & a )
|
| 1715 | {
|
| 1716 | typedef typename mat_traits<A>::scalar_type T;
|
| 1717 | T const a00=mat_traits<A>::template read_element<0,0>(a);
|
| 1718 | T const a01=mat_traits<A>::template read_element<0,1>(a);
|
| 1719 | T const a02=mat_traits<A>::template read_element<0,2>(a);
|
| 1720 | T const a03=mat_traits<A>::template read_element<0,3>(a);
|
| 1721 | T const a10=mat_traits<A>::template read_element<1,0>(a);
|
| 1722 | T const a11=mat_traits<A>::template read_element<1,1>(a);
|
| 1723 | T const a12=mat_traits<A>::template read_element<1,2>(a);
|
| 1724 | T const a13=mat_traits<A>::template read_element<1,3>(a);
|
| 1725 | T const a20=mat_traits<A>::template read_element<2,0>(a);
|
| 1726 | T const a21=mat_traits<A>::template read_element<2,1>(a);
|
| 1727 | T const a22=mat_traits<A>::template read_element<2,2>(a);
|
| 1728 | T const a23=mat_traits<A>::template read_element<2,3>(a);
|
| 1729 | T const a30=mat_traits<A>::template read_element<3,0>(a);
|
| 1730 | T const a31=mat_traits<A>::template read_element<3,1>(a);
|
| 1731 | T const a32=mat_traits<A>::template read_element<3,2>(a);
|
| 1732 | T const a33=mat_traits<A>::template read_element<3,3>(a);
|
| 1733 | T det=(a00*(a11*(a22*a33-a23*a32)-a12*(a21*a33-a23*a31)+a13*(a21*a32-a22*a31))-a01*(a10*(a22*a33-a23*a32)-a12*(a20*a33-a23*a30)+a13*(a20*a32-a22*a30))+a02*(a10*(a21*a33-a23*a31)-a11*(a20*a33-a23*a30)+a13*(a20*a31-a21*a30))-a03*(a10*(a21*a32-a22*a31)-a11*(a20*a32-a22*a30)+a12*(a20*a31-a21*a30)));
|
| 1734 | return det;
|
| 1735 | }
|
| 1736 |
|
| 1737 | namespace
|
| 1738 | sfinae
|
| 1739 | {
|
| 1740 | using ::boost::qvm::determinant;
|
| 1741 | }
|
| 1742 |
|
| 1743 | namespace
|
| 1744 | qvm_detail
|
| 1745 | {
|
| 1746 | template <int D>
|
| 1747 | struct determinant_defined;
|
| 1748 |
|
| 1749 | template <>
|
| 1750 | struct
|
| 1751 | determinant_defined<4>
|
| 1752 | {
|
| 1753 | static bool const value=true;
|
| 1754 | };
|
| 1755 | }
|
| 1756 |
|
| 1757 | template <class A,class B>
|
| 1758 | BOOST_QVM_INLINE_OPERATIONS
|
| 1759 | typename lazy_enable_if_c<
|
| 1760 | mat_traits<A>::rows==4 && mat_traits<A>::cols==4 && is_scalar<B>::value,
|
| 1761 | deduce_mat<A> >::type
|
| 1762 | inverse( A const & a, B det )
|
| 1763 | {
|
| 1764 | typedef typename mat_traits<A>::scalar_type T;
|
| 1765 | BOOST_QVM_ASSERT(det!=scalar_traits<B>::value(0));
|
| 1766 | T const a00=mat_traits<A>::template read_element<0,0>(a);
|
| 1767 | T const a01=mat_traits<A>::template read_element<0,1>(a);
|
| 1768 | T const a02=mat_traits<A>::template read_element<0,2>(a);
|
| 1769 | T const a03=mat_traits<A>::template read_element<0,3>(a);
|
| 1770 | T const a10=mat_traits<A>::template read_element<1,0>(a);
|
| 1771 | T const a11=mat_traits<A>::template read_element<1,1>(a);
|
| 1772 | T const a12=mat_traits<A>::template read_element<1,2>(a);
|
| 1773 | T const a13=mat_traits<A>::template read_element<1,3>(a);
|
| 1774 | T const a20=mat_traits<A>::template read_element<2,0>(a);
|
| 1775 | T const a21=mat_traits<A>::template read_element<2,1>(a);
|
| 1776 | T const a22=mat_traits<A>::template read_element<2,2>(a);
|
| 1777 | T const a23=mat_traits<A>::template read_element<2,3>(a);
|
| 1778 | T const a30=mat_traits<A>::template read_element<3,0>(a);
|
| 1779 | T const a31=mat_traits<A>::template read_element<3,1>(a);
|
| 1780 | T const a32=mat_traits<A>::template read_element<3,2>(a);
|
| 1781 | T const a33=mat_traits<A>::template read_element<3,3>(a);
|
| 1782 | T const f=scalar_traits<T>::value(1)/det;
|
| 1783 | typedef typename deduce_mat<A>::type R;
|
| 1784 | R r;
|
| 1785 | mat_traits<R>::template write_element<0,0>(r)= f*(a11*(a22*a33-a23*a32)-a12*(a21*a33-a23*a31)+a13*(a21*a32-a22*a31));
|
| 1786 | mat_traits<R>::template write_element<0,1>(r)=-f*(a01*(a22*a33-a23*a32)-a02*(a21*a33-a23*a31)+a03*(a21*a32-a22*a31));
|
| 1787 | mat_traits<R>::template write_element<0,2>(r)= f*(a01*(a12*a33-a13*a32)-a02*(a11*a33-a13*a31)+a03*(a11*a32-a12*a31));
|
| 1788 | mat_traits<R>::template write_element<0,3>(r)=-f*(a01*(a12*a23-a13*a22)-a02*(a11*a23-a13*a21)+a03*(a11*a22-a12*a21));
|
| 1789 | mat_traits<R>::template write_element<1,0>(r)=-f*(a10*(a22*a33-a23*a32)-a12*(a20*a33-a23*a30)+a13*(a20*a32-a22*a30));
|
| 1790 | mat_traits<R>::template write_element<1,1>(r)= f*(a00*(a22*a33-a23*a32)-a02*(a20*a33-a23*a30)+a03*(a20*a32-a22*a30));
|
| 1791 | mat_traits<R>::template write_element<1,2>(r)=-f*(a00*(a12*a33-a13*a32)-a02*(a10*a33-a13*a30)+a03*(a10*a32-a12*a30));
|
| 1792 | mat_traits<R>::template write_element<1,3>(r)= f*(a00*(a12*a23-a13*a22)-a02*(a10*a23-a13*a20)+a03*(a10*a22-a12*a20));
|
| 1793 | mat_traits<R>::template write_element<2,0>(r)= f*(a10*(a21*a33-a23*a31)-a11*(a20*a33-a23*a30)+a13*(a20*a31-a21*a30));
|
| 1794 | mat_traits<R>::template write_element<2,1>(r)=-f*(a00*(a21*a33-a23*a31)-a01*(a20*a33-a23*a30)+a03*(a20*a31-a21*a30));
|
| 1795 | mat_traits<R>::template write_element<2,2>(r)= f*(a00*(a11*a33-a13*a31)-a01*(a10*a33-a13*a30)+a03*(a10*a31-a11*a30));
|
| 1796 | mat_traits<R>::template write_element<2,3>(r)=-f*(a00*(a11*a23-a13*a21)-a01*(a10*a23-a13*a20)+a03*(a10*a21-a11*a20));
|
| 1797 | mat_traits<R>::template write_element<3,0>(r)=-f*(a10*(a21*a32-a22*a31)-a11*(a20*a32-a22*a30)+a12*(a20*a31-a21*a30));
|
| 1798 | mat_traits<R>::template write_element<3,1>(r)= f*(a00*(a21*a32-a22*a31)-a01*(a20*a32-a22*a30)+a02*(a20*a31-a21*a30));
|
| 1799 | mat_traits<R>::template write_element<3,2>(r)=-f*(a00*(a11*a32-a12*a31)-a01*(a10*a32-a12*a30)+a02*(a10*a31-a11*a30));
|
| 1800 | mat_traits<R>::template write_element<3,3>(r)= f*(a00*(a11*a22-a12*a21)-a01*(a10*a22-a12*a20)+a02*(a10*a21-a11*a20));
|
| 1801 | return r;
|
| 1802 | }
|
| 1803 |
|
| 1804 | template <class A>
|
| 1805 | BOOST_QVM_INLINE_OPERATIONS
|
| 1806 | typename lazy_enable_if_c<
|
| 1807 | mat_traits<A>::rows==4 && mat_traits<A>::cols==4,
|
| 1808 | deduce_mat<A> >::type
|
| 1809 | inverse( A const & a )
|
| 1810 | {
|
| 1811 | typedef typename mat_traits<A>::scalar_type T;
|
| 1812 | T det=determinant(a);
|
| 1813 | if( det==scalar_traits<T>::value(0) )
|
| 1814 | BOOST_QVM_THROW_EXCEPTION(zero_determinant_error());
|
| 1815 | return inverse(a,det);
|
| 1816 | }
|
| 1817 |
|
| 1818 | namespace
|
| 1819 | sfinae
|
| 1820 | {
|
| 1821 | using ::boost::qvm::inverse;
|
| 1822 | }
|
| 1823 |
|
| 1824 | namespace
|
| 1825 | qvm_detail
|
| 1826 | {
|
| 1827 | template <int D>
|
| 1828 | struct inverse_m_defined;
|
| 1829 |
|
| 1830 | template <>
|
| 1831 | struct
|
| 1832 | inverse_m_defined<4>
|
| 1833 | {
|
| 1834 | static bool const value=true;
|
| 1835 | };
|
| 1836 | }
|
| 1837 |
|
| 1838 | template <class A,class B>
|
| 1839 | BOOST_QVM_INLINE_OPERATIONS
|
| 1840 | typename lazy_enable_if_c<
|
| 1841 | mat_traits<A>::rows==4 && mat_traits<B>::rows==4 &&
|
| 1842 | mat_traits<A>::cols==4 && mat_traits<B>::cols==4,
|
| 1843 | deduce_mat2<A,B,4,4> >::type
|
| 1844 | operator*( A const & a, B const & b )
|
| 1845 | {
|
| 1846 | typedef typename mat_traits<A>::scalar_type Ta;
|
| 1847 | typedef typename mat_traits<B>::scalar_type Tb;
|
| 1848 | Ta const a00 = mat_traits<A>::template read_element<0,0>(a);
|
| 1849 | Ta const a01 = mat_traits<A>::template read_element<0,1>(a);
|
| 1850 | Ta const a02 = mat_traits<A>::template read_element<0,2>(a);
|
| 1851 | Ta const a03 = mat_traits<A>::template read_element<0,3>(a);
|
| 1852 | Ta const a10 = mat_traits<A>::template read_element<1,0>(a);
|
| 1853 | Ta const a11 = mat_traits<A>::template read_element<1,1>(a);
|
| 1854 | Ta const a12 = mat_traits<A>::template read_element<1,2>(a);
|
| 1855 | Ta const a13 = mat_traits<A>::template read_element<1,3>(a);
|
| 1856 | Ta const a20 = mat_traits<A>::template read_element<2,0>(a);
|
| 1857 | Ta const a21 = mat_traits<A>::template read_element<2,1>(a);
|
| 1858 | Ta const a22 = mat_traits<A>::template read_element<2,2>(a);
|
| 1859 | Ta const a23 = mat_traits<A>::template read_element<2,3>(a);
|
| 1860 | Ta const a30 = mat_traits<A>::template read_element<3,0>(a);
|
| 1861 | Ta const a31 = mat_traits<A>::template read_element<3,1>(a);
|
| 1862 | Ta const a32 = mat_traits<A>::template read_element<3,2>(a);
|
| 1863 | Ta const a33 = mat_traits<A>::template read_element<3,3>(a);
|
| 1864 | Tb const b00 = mat_traits<B>::template read_element<0,0>(b);
|
| 1865 | Tb const b01 = mat_traits<B>::template read_element<0,1>(b);
|
| 1866 | Tb const b02 = mat_traits<B>::template read_element<0,2>(b);
|
| 1867 | Tb const b03 = mat_traits<B>::template read_element<0,3>(b);
|
| 1868 | Tb const b10 = mat_traits<B>::template read_element<1,0>(b);
|
| 1869 | Tb const b11 = mat_traits<B>::template read_element<1,1>(b);
|
| 1870 | Tb const b12 = mat_traits<B>::template read_element<1,2>(b);
|
| 1871 | Tb const b13 = mat_traits<B>::template read_element<1,3>(b);
|
| 1872 | Tb const b20 = mat_traits<B>::template read_element<2,0>(b);
|
| 1873 | Tb const b21 = mat_traits<B>::template read_element<2,1>(b);
|
| 1874 | Tb const b22 = mat_traits<B>::template read_element<2,2>(b);
|
| 1875 | Tb const b23 = mat_traits<B>::template read_element<2,3>(b);
|
| 1876 | Tb const b30 = mat_traits<B>::template read_element<3,0>(b);
|
| 1877 | Tb const b31 = mat_traits<B>::template read_element<3,1>(b);
|
| 1878 | Tb const b32 = mat_traits<B>::template read_element<3,2>(b);
|
| 1879 | Tb const b33 = mat_traits<B>::template read_element<3,3>(b);
|
| 1880 | typedef typename deduce_mat2<A,B,4,4>::type R;
|
| 1881 | BOOST_QVM_STATIC_ASSERT(mat_traits<R>::rows==4);
|
| 1882 | BOOST_QVM_STATIC_ASSERT(mat_traits<R>::cols==4);
|
| 1883 | R r;
|
| 1884 | mat_traits<R>::template write_element<0,0>(r)=a00*b00+a01*b10+a02*b20+a03*b30;
|
| 1885 | mat_traits<R>::template write_element<0,1>(r)=a00*b01+a01*b11+a02*b21+a03*b31;
|
| 1886 | mat_traits<R>::template write_element<0,2>(r)=a00*b02+a01*b12+a02*b22+a03*b32;
|
| 1887 | mat_traits<R>::template write_element<0,3>(r)=a00*b03+a01*b13+a02*b23+a03*b33;
|
| 1888 | mat_traits<R>::template write_element<1,0>(r)=a10*b00+a11*b10+a12*b20+a13*b30;
|
| 1889 | mat_traits<R>::template write_element<1,1>(r)=a10*b01+a11*b11+a12*b21+a13*b31;
|
| 1890 | mat_traits<R>::template write_element<1,2>(r)=a10*b02+a11*b12+a12*b22+a13*b32;
|
| 1891 | mat_traits<R>::template write_element<1,3>(r)=a10*b03+a11*b13+a12*b23+a13*b33;
|
| 1892 | mat_traits<R>::template write_element<2,0>(r)=a20*b00+a21*b10+a22*b20+a23*b30;
|
| 1893 | mat_traits<R>::template write_element<2,1>(r)=a20*b01+a21*b11+a22*b21+a23*b31;
|
| 1894 | mat_traits<R>::template write_element<2,2>(r)=a20*b02+a21*b12+a22*b22+a23*b32;
|
| 1895 | mat_traits<R>::template write_element<2,3>(r)=a20*b03+a21*b13+a22*b23+a23*b33;
|
| 1896 | mat_traits<R>::template write_element<3,0>(r)=a30*b00+a31*b10+a32*b20+a33*b30;
|
| 1897 | mat_traits<R>::template write_element<3,1>(r)=a30*b01+a31*b11+a32*b21+a33*b31;
|
| 1898 | mat_traits<R>::template write_element<3,2>(r)=a30*b02+a31*b12+a32*b22+a33*b32;
|
| 1899 | mat_traits<R>::template write_element<3,3>(r)=a30*b03+a31*b13+a32*b23+a33*b33;
|
| 1900 | return r;
|
| 1901 | }
|
| 1902 |
|
| 1903 | namespace
|
| 1904 | sfinae
|
| 1905 | {
|
| 1906 | using ::boost::qvm::operator*;
|
| 1907 | }
|
| 1908 |
|
| 1909 | namespace
|
| 1910 | qvm_detail
|
| 1911 | {
|
| 1912 | template <int R,int CR,int C>
|
| 1913 | struct mul_mm_defined;
|
| 1914 |
|
| 1915 | template <>
|
| 1916 | struct
|
| 1917 | mul_mm_defined<4,4,4>
|
| 1918 | {
|
| 1919 | static bool const value=true;
|
| 1920 | };
|
| 1921 | }
|
| 1922 |
|
| 1923 | template <class A,class B>
|
| 1924 | BOOST_QVM_INLINE_OPERATIONS
|
| 1925 | typename enable_if_c<
|
| 1926 | mat_traits<A>::rows==4 && mat_traits<B>::rows==4 &&
|
| 1927 | mat_traits<A>::cols==4 && mat_traits<B>::cols==4,
|
| 1928 | A &>::type
|
| 1929 | operator*=( A & a, B const & b )
|
| 1930 | {
|
| 1931 | typedef typename mat_traits<A>::scalar_type Ta;
|
| 1932 | typedef typename mat_traits<B>::scalar_type Tb;
|
| 1933 | Ta const a00 = mat_traits<A>::template read_element<0,0>(a);
|
| 1934 | Ta const a01 = mat_traits<A>::template read_element<0,1>(a);
|
| 1935 | Ta const a02 = mat_traits<A>::template read_element<0,2>(a);
|
| 1936 | Ta const a03 = mat_traits<A>::template read_element<0,3>(a);
|
| 1937 | Ta const a10 = mat_traits<A>::template read_element<1,0>(a);
|
| 1938 | Ta const a11 = mat_traits<A>::template read_element<1,1>(a);
|
| 1939 | Ta const a12 = mat_traits<A>::template read_element<1,2>(a);
|
| 1940 | Ta const a13 = mat_traits<A>::template read_element<1,3>(a);
|
| 1941 | Ta const a20 = mat_traits<A>::template read_element<2,0>(a);
|
| 1942 | Ta const a21 = mat_traits<A>::template read_element<2,1>(a);
|
| 1943 | Ta const a22 = mat_traits<A>::template read_element<2,2>(a);
|
| 1944 | Ta const a23 = mat_traits<A>::template read_element<2,3>(a);
|
| 1945 | Ta const a30 = mat_traits<A>::template read_element<3,0>(a);
|
| 1946 | Ta const a31 = mat_traits<A>::template read_element<3,1>(a);
|
| 1947 | Ta const a32 = mat_traits<A>::template read_element<3,2>(a);
|
| 1948 | Ta const a33 = mat_traits<A>::template read_element<3,3>(a);
|
| 1949 | Tb const b00 = mat_traits<B>::template read_element<0,0>(b);
|
| 1950 | Tb const b01 = mat_traits<B>::template read_element<0,1>(b);
|
| 1951 | Tb const b02 = mat_traits<B>::template read_element<0,2>(b);
|
| 1952 | Tb const b03 = mat_traits<B>::template read_element<0,3>(b);
|
| 1953 | Tb const b10 = mat_traits<B>::template read_element<1,0>(b);
|
| 1954 | Tb const b11 = mat_traits<B>::template read_element<1,1>(b);
|
| 1955 | Tb const b12 = mat_traits<B>::template read_element<1,2>(b);
|
| 1956 | Tb const b13 = mat_traits<B>::template read_element<1,3>(b);
|
| 1957 | Tb const b20 = mat_traits<B>::template read_element<2,0>(b);
|
| 1958 | Tb const b21 = mat_traits<B>::template read_element<2,1>(b);
|
| 1959 | Tb const b22 = mat_traits<B>::template read_element<2,2>(b);
|
| 1960 | Tb const b23 = mat_traits<B>::template read_element<2,3>(b);
|
| 1961 | Tb const b30 = mat_traits<B>::template read_element<3,0>(b);
|
| 1962 | Tb const b31 = mat_traits<B>::template read_element<3,1>(b);
|
| 1963 | Tb const b32 = mat_traits<B>::template read_element<3,2>(b);
|
| 1964 | Tb const b33 = mat_traits<B>::template read_element<3,3>(b);
|
| 1965 | mat_traits<A>::template write_element<0,0>(a)=a00*b00+a01*b10+a02*b20+a03*b30;
|
| 1966 | mat_traits<A>::template write_element<0,1>(a)=a00*b01+a01*b11+a02*b21+a03*b31;
|
| 1967 | mat_traits<A>::template write_element<0,2>(a)=a00*b02+a01*b12+a02*b22+a03*b32;
|
| 1968 | mat_traits<A>::template write_element<0,3>(a)=a00*b03+a01*b13+a02*b23+a03*b33;
|
| 1969 | mat_traits<A>::template write_element<1,0>(a)=a10*b00+a11*b10+a12*b20+a13*b30;
|
| 1970 | mat_traits<A>::template write_element<1,1>(a)=a10*b01+a11*b11+a12*b21+a13*b31;
|
| 1971 | mat_traits<A>::template write_element<1,2>(a)=a10*b02+a11*b12+a12*b22+a13*b32;
|
| 1972 | mat_traits<A>::template write_element<1,3>(a)=a10*b03+a11*b13+a12*b23+a13*b33;
|
| 1973 | mat_traits<A>::template write_element<2,0>(a)=a20*b00+a21*b10+a22*b20+a23*b30;
|
| 1974 | mat_traits<A>::template write_element<2,1>(a)=a20*b01+a21*b11+a22*b21+a23*b31;
|
| 1975 | mat_traits<A>::template write_element<2,2>(a)=a20*b02+a21*b12+a22*b22+a23*b32;
|
| 1976 | mat_traits<A>::template write_element<2,3>(a)=a20*b03+a21*b13+a22*b23+a23*b33;
|
| 1977 | mat_traits<A>::template write_element<3,0>(a)=a30*b00+a31*b10+a32*b20+a33*b30;
|
| 1978 | mat_traits<A>::template write_element<3,1>(a)=a30*b01+a31*b11+a32*b21+a33*b31;
|
| 1979 | mat_traits<A>::template write_element<3,2>(a)=a30*b02+a31*b12+a32*b22+a33*b32;
|
| 1980 | mat_traits<A>::template write_element<3,3>(a)=a30*b03+a31*b13+a32*b23+a33*b33;
|
| 1981 | return a;
|
| 1982 | }
|
| 1983 |
|
| 1984 | namespace
|
| 1985 | sfinae
|
| 1986 | {
|
| 1987 | using ::boost::qvm::operator*=;
|
| 1988 | }
|
| 1989 |
|
| 1990 | namespace
|
| 1991 | qvm_detail
|
| 1992 | {
|
| 1993 | template <int D>
|
| 1994 | struct mul_eq_mm_defined;
|
| 1995 |
|
| 1996 | template <>
|
| 1997 | struct
|
| 1998 | mul_eq_mm_defined<4>
|
| 1999 | {
|
| 2000 | static bool const value=true;
|
| 2001 | };
|
| 2002 | }
|
| 2003 |
|
| 2004 | template <class A,class B>
|
| 2005 | BOOST_QVM_INLINE_OPERATIONS
|
| 2006 | typename lazy_enable_if_c<
|
| 2007 | mat_traits<A>::rows==4 && mat_traits<B>::rows==4 &&
|
| 2008 | mat_traits<A>::cols==4 && mat_traits<B>::cols==1,
|
| 2009 | deduce_mat2<A,B,4,1> >::type
|
| 2010 | operator*( A const & a, B const & b )
|
| 2011 | {
|
| 2012 | typedef typename mat_traits<A>::scalar_type Ta;
|
| 2013 | typedef typename mat_traits<B>::scalar_type Tb;
|
| 2014 | Ta const a00 = mat_traits<A>::template read_element<0,0>(a);
|
| 2015 | Ta const a01 = mat_traits<A>::template read_element<0,1>(a);
|
| 2016 | Ta const a02 = mat_traits<A>::template read_element<0,2>(a);
|
| 2017 | Ta const a03 = mat_traits<A>::template read_element<0,3>(a);
|
| 2018 | Ta const a10 = mat_traits<A>::template read_element<1,0>(a);
|
| 2019 | Ta const a11 = mat_traits<A>::template read_element<1,1>(a);
|
| 2020 | Ta const a12 = mat_traits<A>::template read_element<1,2>(a);
|
| 2021 | Ta const a13 = mat_traits<A>::template read_element<1,3>(a);
|
| 2022 | Ta const a20 = mat_traits<A>::template read_element<2,0>(a);
|
| 2023 | Ta const a21 = mat_traits<A>::template read_element<2,1>(a);
|
| 2024 | Ta const a22 = mat_traits<A>::template read_element<2,2>(a);
|
| 2025 | Ta const a23 = mat_traits<A>::template read_element<2,3>(a);
|
| 2026 | Ta const a30 = mat_traits<A>::template read_element<3,0>(a);
|
| 2027 | Ta const a31 = mat_traits<A>::template read_element<3,1>(a);
|
| 2028 | Ta const a32 = mat_traits<A>::template read_element<3,2>(a);
|
| 2029 | Ta const a33 = mat_traits<A>::template read_element<3,3>(a);
|
| 2030 | Tb const b00 = mat_traits<B>::template read_element<0,0>(b);
|
| 2031 | Tb const b10 = mat_traits<B>::template read_element<1,0>(b);
|
| 2032 | Tb const b20 = mat_traits<B>::template read_element<2,0>(b);
|
| 2033 | Tb const b30 = mat_traits<B>::template read_element<3,0>(b);
|
| 2034 | typedef typename deduce_mat2<A,B,4,1>::type R;
|
| 2035 | BOOST_QVM_STATIC_ASSERT(mat_traits<R>::rows==4);
|
| 2036 | BOOST_QVM_STATIC_ASSERT(mat_traits<R>::cols==1);
|
| 2037 | R r;
|
| 2038 | mat_traits<R>::template write_element<0,0>(r)=a00*b00+a01*b10+a02*b20+a03*b30;
|
| 2039 | mat_traits<R>::template write_element<1,0>(r)=a10*b00+a11*b10+a12*b20+a13*b30;
|
| 2040 | mat_traits<R>::template write_element<2,0>(r)=a20*b00+a21*b10+a22*b20+a23*b30;
|
| 2041 | mat_traits<R>::template write_element<3,0>(r)=a30*b00+a31*b10+a32*b20+a33*b30;
|
| 2042 | return r;
|
| 2043 | }
|
| 2044 |
|
| 2045 | namespace
|
| 2046 | sfinae
|
| 2047 | {
|
| 2048 | using ::boost::qvm::operator*;
|
| 2049 | }
|
| 2050 |
|
| 2051 | namespace
|
| 2052 | qvm_detail
|
| 2053 | {
|
| 2054 | template <int R,int CR,int C>
|
| 2055 | struct mul_mm_defined;
|
| 2056 |
|
| 2057 | template <>
|
| 2058 | struct
|
| 2059 | mul_mm_defined<4,4,1>
|
| 2060 | {
|
| 2061 | static bool const value=true;
|
| 2062 | };
|
| 2063 | }
|
| 2064 |
|
| 2065 | template <class A,class B>
|
| 2066 | BOOST_QVM_INLINE_OPERATIONS
|
| 2067 | typename lazy_enable_if_c<
|
| 2068 | mat_traits<A>::rows==1 && mat_traits<B>::rows==4 &&
|
| 2069 | mat_traits<A>::cols==4 && mat_traits<B>::cols==4,
|
| 2070 | deduce_mat2<A,B,1,4> >::type
|
| 2071 | operator*( A const & a, B const & b )
|
| 2072 | {
|
| 2073 | typedef typename mat_traits<A>::scalar_type Ta;
|
| 2074 | typedef typename mat_traits<B>::scalar_type Tb;
|
| 2075 | Ta const a00 = mat_traits<A>::template read_element<0,0>(a);
|
| 2076 | Ta const a01 = mat_traits<A>::template read_element<0,1>(a);
|
| 2077 | Ta const a02 = mat_traits<A>::template read_element<0,2>(a);
|
| 2078 | Ta const a03 = mat_traits<A>::template read_element<0,3>(a);
|
| 2079 | Tb const b00 = mat_traits<B>::template read_element<0,0>(b);
|
| 2080 | Tb const b01 = mat_traits<B>::template read_element<0,1>(b);
|
| 2081 | Tb const b02 = mat_traits<B>::template read_element<0,2>(b);
|
| 2082 | Tb const b03 = mat_traits<B>::template read_element<0,3>(b);
|
| 2083 | Tb const b10 = mat_traits<B>::template read_element<1,0>(b);
|
| 2084 | Tb const b11 = mat_traits<B>::template read_element<1,1>(b);
|
| 2085 | Tb const b12 = mat_traits<B>::template read_element<1,2>(b);
|
| 2086 | Tb const b13 = mat_traits<B>::template read_element<1,3>(b);
|
| 2087 | Tb const b20 = mat_traits<B>::template read_element<2,0>(b);
|
| 2088 | Tb const b21 = mat_traits<B>::template read_element<2,1>(b);
|
| 2089 | Tb const b22 = mat_traits<B>::template read_element<2,2>(b);
|
| 2090 | Tb const b23 = mat_traits<B>::template read_element<2,3>(b);
|
| 2091 | Tb const b30 = mat_traits<B>::template read_element<3,0>(b);
|
| 2092 | Tb const b31 = mat_traits<B>::template read_element<3,1>(b);
|
| 2093 | Tb const b32 = mat_traits<B>::template read_element<3,2>(b);
|
| 2094 | Tb const b33 = mat_traits<B>::template read_element<3,3>(b);
|
| 2095 | typedef typename deduce_mat2<A,B,1,4>::type R;
|
| 2096 | BOOST_QVM_STATIC_ASSERT(mat_traits<R>::rows==1);
|
| 2097 | BOOST_QVM_STATIC_ASSERT(mat_traits<R>::cols==4);
|
| 2098 | R r;
|
| 2099 | mat_traits<R>::template write_element<0,0>(r)=a00*b00+a01*b10+a02*b20+a03*b30;
|
| 2100 | mat_traits<R>::template write_element<0,1>(r)=a00*b01+a01*b11+a02*b21+a03*b31;
|
| 2101 | mat_traits<R>::template write_element<0,2>(r)=a00*b02+a01*b12+a02*b22+a03*b32;
|
| 2102 | mat_traits<R>::template write_element<0,3>(r)=a00*b03+a01*b13+a02*b23+a03*b33;
|
| 2103 | return r;
|
| 2104 | }
|
| 2105 |
|
| 2106 | namespace
|
| 2107 | sfinae
|
| 2108 | {
|
| 2109 | using ::boost::qvm::operator*;
|
| 2110 | }
|
| 2111 |
|
| 2112 | namespace
|
| 2113 | qvm_detail
|
| 2114 | {
|
| 2115 | template <int R,int CR,int C>
|
| 2116 | struct mul_mm_defined;
|
| 2117 |
|
| 2118 | template <>
|
| 2119 | struct
|
| 2120 | mul_mm_defined<1,4,4>
|
| 2121 | {
|
| 2122 | static bool const value=true;
|
| 2123 | };
|
| 2124 | }
|
| 2125 |
|
| 2126 | }
|
| 2127 | }
|
| 2128 |
|
| 2129 | #endif
|
| 2130 | |