2013-09-22 16:58:21 +08:00
|
|
|
//! Matrices with dimensions known at compile-time.
|
|
|
|
|
2014-11-01 00:40:47 +08:00
|
|
|
#![allow(missing_docs)] // we allow missing to avoid having to document the mij components.
|
2013-07-24 22:50:40 +08:00
|
|
|
|
2014-05-12 07:31:22 +08:00
|
|
|
use std::mem;
|
2014-01-10 03:48:30 +08:00
|
|
|
use traits::operations::ApproxEq;
|
2014-03-22 04:57:58 +08:00
|
|
|
use std::slice::{Items, MutItems};
|
2014-08-16 18:16:26 +08:00
|
|
|
use structs::vec::{Vec1, Vec2, Vec3, Vec4, Vec5, Vec6,
|
|
|
|
Vec1MulRhs, Vec4MulRhs, Vec5MulRhs, Vec6MulRhs};
|
2014-10-10 17:23:52 +08:00
|
|
|
use structs::pnt::{Pnt1, Pnt4, Pnt5, Pnt6, Pnt1MulRhs, Pnt4MulRhs, Pnt5MulRhs, Pnt6MulRhs};
|
2014-08-16 18:16:26 +08:00
|
|
|
use structs::dvec::{DVec1, DVec2, DVec3, DVec4, DVec5, DVec6};
|
2013-07-22 16:26:20 +08:00
|
|
|
|
2014-05-12 01:46:04 +08:00
|
|
|
use traits::structure::{Cast, Row, Col, Iterable, IterableMut, Dim, Indexable,
|
2014-11-16 21:04:15 +08:00
|
|
|
Eye, ColSlice, RowSlice, Diag, Shape, BaseFloat, BaseNum, Zero, One};
|
2014-10-27 00:24:33 +08:00
|
|
|
use traits::operations::{Absolute, Transpose, Inv, Outer, EigenQR};
|
2014-10-10 17:23:52 +08:00
|
|
|
use traits::geometry::{ToHomogeneous, FromHomogeneous, Orig};
|
2014-10-27 00:24:33 +08:00
|
|
|
use linalg;
|
2013-09-07 14:23:09 +08:00
|
|
|
|
2013-07-22 16:26:20 +08:00
|
|
|
|
2013-08-23 21:59:26 +08:00
|
|
|
/// Special identity matrix. All its operation are no-ops.
|
2014-06-04 04:37:46 +08:00
|
|
|
#[deriving(Eq, PartialEq, Decodable, Clone, Rand, Show)]
|
2013-11-29 03:14:25 +08:00
|
|
|
pub struct Identity;
|
2013-08-23 21:59:26 +08:00
|
|
|
|
|
|
|
impl Identity {
|
|
|
|
/// Creates a new identity matrix.
|
|
|
|
#[inline]
|
|
|
|
pub fn new() -> Identity {
|
2013-11-29 03:14:25 +08:00
|
|
|
Identity
|
2013-08-23 21:59:26 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-24 22:50:40 +08:00
|
|
|
/// Square matrix of dimension 1.
|
2014-11-16 21:04:15 +08:00
|
|
|
#[deriving(Eq, PartialEq, Encodable, Decodable, Clone, Hash, Rand, Show)]
|
2013-08-05 16:13:44 +08:00
|
|
|
pub struct Mat1<N> {
|
2014-04-02 04:58:06 +08:00
|
|
|
pub m11: N
|
2013-07-24 22:50:40 +08:00
|
|
|
}
|
2013-07-22 16:26:20 +08:00
|
|
|
|
2014-05-12 01:46:04 +08:00
|
|
|
eye_impl!(Mat1, 1, m11)
|
|
|
|
|
2013-09-14 23:08:48 +08:00
|
|
|
double_dispatch_binop_decl_trait!(Mat1, Mat1MulRhs)
|
2013-09-15 03:11:43 +08:00
|
|
|
double_dispatch_binop_decl_trait!(Mat1, Mat1DivRhs)
|
|
|
|
double_dispatch_binop_decl_trait!(Mat1, Mat1AddRhs)
|
|
|
|
double_dispatch_binop_decl_trait!(Mat1, Mat1SubRhs)
|
2013-10-10 04:59:44 +08:00
|
|
|
double_dispatch_cast_decl_trait!(Mat1, Mat1Cast)
|
2013-09-15 03:11:43 +08:00
|
|
|
mul_redispatch_impl!(Mat1, Mat1MulRhs)
|
|
|
|
div_redispatch_impl!(Mat1, Mat1DivRhs)
|
|
|
|
add_redispatch_impl!(Mat1, Mat1AddRhs)
|
|
|
|
sub_redispatch_impl!(Mat1, Mat1SubRhs)
|
2013-10-10 04:59:44 +08:00
|
|
|
cast_redispatch_impl!(Mat1, Mat1Cast)
|
2013-07-23 05:42:35 +08:00
|
|
|
mat_impl!(Mat1, m11)
|
2014-11-21 18:21:02 +08:00
|
|
|
as_array_impl!(Mat1, 1)
|
2013-10-10 04:59:44 +08:00
|
|
|
mat_cast_impl!(Mat1, Mat1Cast, m11)
|
2013-09-15 03:11:43 +08:00
|
|
|
add_impl!(Mat1, Mat1AddRhs, m11)
|
|
|
|
sub_impl!(Mat1, Mat1SubRhs, m11)
|
|
|
|
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat1, f64, Mat1MulRhs, m11)
|
|
|
|
mat_mul_scalar_impl!(Mat1, f32, Mat1MulRhs, m11)
|
|
|
|
mat_mul_scalar_impl!(Mat1, i64, Mat1MulRhs, m11)
|
|
|
|
mat_mul_scalar_impl!(Mat1, i32, Mat1MulRhs, m11)
|
|
|
|
mat_mul_scalar_impl!(Mat1, i16, Mat1MulRhs, m11)
|
|
|
|
mat_mul_scalar_impl!(Mat1, i8, Mat1MulRhs, m11)
|
|
|
|
mat_mul_scalar_impl!(Mat1, u64, Mat1MulRhs, m11)
|
|
|
|
mat_mul_scalar_impl!(Mat1, u32, Mat1MulRhs, m11)
|
|
|
|
mat_mul_scalar_impl!(Mat1, u16, Mat1MulRhs, m11)
|
|
|
|
mat_mul_scalar_impl!(Mat1, u8, Mat1MulRhs, m11)
|
|
|
|
mat_mul_scalar_impl!(Mat1, uint, Mat1MulRhs, m11)
|
|
|
|
mat_mul_scalar_impl!(Mat1, int, Mat1MulRhs, m11)
|
|
|
|
|
|
|
|
mat_div_scalar_impl!(Mat1, f64, Mat1DivRhs, m11)
|
|
|
|
mat_div_scalar_impl!(Mat1, f32, Mat1DivRhs, m11)
|
|
|
|
mat_div_scalar_impl!(Mat1, i64, Mat1DivRhs, m11)
|
|
|
|
mat_div_scalar_impl!(Mat1, i32, Mat1DivRhs, m11)
|
|
|
|
mat_div_scalar_impl!(Mat1, i16, Mat1DivRhs, m11)
|
|
|
|
mat_div_scalar_impl!(Mat1, i8, Mat1DivRhs, m11)
|
|
|
|
mat_div_scalar_impl!(Mat1, u64, Mat1DivRhs, m11)
|
|
|
|
mat_div_scalar_impl!(Mat1, u32, Mat1DivRhs, m11)
|
|
|
|
mat_div_scalar_impl!(Mat1, u16, Mat1DivRhs, m11)
|
|
|
|
mat_div_scalar_impl!(Mat1, u8, Mat1DivRhs, m11)
|
|
|
|
mat_div_scalar_impl!(Mat1, uint, Mat1DivRhs, m11)
|
|
|
|
mat_div_scalar_impl!(Mat1, int, Mat1DivRhs, m11)
|
|
|
|
|
|
|
|
mat_add_scalar_impl!(Mat1, f64, Mat1AddRhs, m11)
|
|
|
|
mat_add_scalar_impl!(Mat1, f32, Mat1AddRhs, m11)
|
|
|
|
mat_add_scalar_impl!(Mat1, i64, Mat1AddRhs, m11)
|
|
|
|
mat_add_scalar_impl!(Mat1, i32, Mat1AddRhs, m11)
|
|
|
|
mat_add_scalar_impl!(Mat1, i16, Mat1AddRhs, m11)
|
|
|
|
mat_add_scalar_impl!(Mat1, i8, Mat1AddRhs, m11)
|
|
|
|
mat_add_scalar_impl!(Mat1, u64, Mat1AddRhs, m11)
|
|
|
|
mat_add_scalar_impl!(Mat1, u32, Mat1AddRhs, m11)
|
|
|
|
mat_add_scalar_impl!(Mat1, u16, Mat1AddRhs, m11)
|
|
|
|
mat_add_scalar_impl!(Mat1, u8, Mat1AddRhs, m11)
|
|
|
|
mat_add_scalar_impl!(Mat1, uint, Mat1AddRhs, m11)
|
|
|
|
mat_add_scalar_impl!(Mat1, int, Mat1AddRhs, m11)
|
|
|
|
|
|
|
|
mat_sub_scalar_impl!(Mat1, f64, Mat1SubRhs, m11)
|
|
|
|
mat_sub_scalar_impl!(Mat1, f32, Mat1SubRhs, m11)
|
|
|
|
mat_sub_scalar_impl!(Mat1, i64, Mat1SubRhs, m11)
|
|
|
|
mat_sub_scalar_impl!(Mat1, i32, Mat1SubRhs, m11)
|
|
|
|
mat_sub_scalar_impl!(Mat1, i16, Mat1SubRhs, m11)
|
|
|
|
mat_sub_scalar_impl!(Mat1, i8, Mat1SubRhs, m11)
|
|
|
|
mat_sub_scalar_impl!(Mat1, u64, Mat1SubRhs, m11)
|
|
|
|
mat_sub_scalar_impl!(Mat1, u32, Mat1SubRhs, m11)
|
|
|
|
mat_sub_scalar_impl!(Mat1, u16, Mat1SubRhs, m11)
|
|
|
|
mat_sub_scalar_impl!(Mat1, u8, Mat1SubRhs, m11)
|
|
|
|
mat_sub_scalar_impl!(Mat1, uint, Mat1SubRhs, m11)
|
|
|
|
mat_sub_scalar_impl!(Mat1, int, Mat1SubRhs, m11)
|
2013-09-15 03:11:43 +08:00
|
|
|
|
2013-09-13 16:26:19 +08:00
|
|
|
absolute_impl!(Mat1, m11)
|
2014-11-16 21:04:15 +08:00
|
|
|
zero_impl!(Mat1, m11)
|
|
|
|
one_impl!(Mat1, ::one)
|
2013-07-22 16:26:20 +08:00
|
|
|
iterable_impl!(Mat1, 1)
|
|
|
|
iterable_mut_impl!(Mat1, 1)
|
2013-09-13 19:21:42 +08:00
|
|
|
at_fast_impl!(Mat1, 1)
|
2013-07-22 16:26:20 +08:00
|
|
|
dim_impl!(Mat1, 1)
|
|
|
|
indexable_impl!(Mat1, 1)
|
2014-10-26 05:02:16 +08:00
|
|
|
index_impl!(Mat1, 1)
|
2013-09-14 23:08:48 +08:00
|
|
|
mat_mul_mat_impl!(Mat1, Mat1MulRhs, 1)
|
2014-11-16 21:04:15 +08:00
|
|
|
mat_mul_vec_impl!(Mat1, Vec1, Mat1MulRhs, 1, ::zero)
|
|
|
|
vec_mul_mat_impl!(Mat1, Vec1, Vec1MulRhs, 1, ::zero)
|
2014-10-10 17:23:52 +08:00
|
|
|
mat_mul_pnt_impl!(Mat1, Pnt1, Mat1MulRhs, 1, Orig::orig)
|
|
|
|
pnt_mul_mat_impl!(Mat1, Pnt1, Pnt1MulRhs, 1, Orig::orig)
|
2013-07-22 16:26:20 +08:00
|
|
|
// (specialized) inv_impl!(Mat1, 1)
|
|
|
|
transpose_impl!(Mat1, 1)
|
|
|
|
approx_eq_impl!(Mat1)
|
2013-08-26 05:01:44 +08:00
|
|
|
row_impl!(Mat1, Vec1, 1)
|
2013-09-13 16:26:19 +08:00
|
|
|
col_impl!(Mat1, Vec1, 1)
|
2014-08-16 18:16:26 +08:00
|
|
|
col_slice_impl!(Mat1, Vec1, DVec1, 1)
|
|
|
|
row_slice_impl!(Mat1, Vec1, DVec1, 1)
|
2014-08-16 19:12:08 +08:00
|
|
|
diag_impl!(Mat1, Vec1, 1)
|
2013-07-22 16:26:20 +08:00
|
|
|
to_homogeneous_impl!(Mat1, Mat2, 1, 2)
|
|
|
|
from_homogeneous_impl!(Mat1, Mat2, 1, 2)
|
2013-08-12 22:45:31 +08:00
|
|
|
outer_impl!(Vec1, Mat1)
|
2014-10-27 00:24:33 +08:00
|
|
|
eigen_qr_impl!(Mat1, Vec1)
|
2013-07-22 16:26:20 +08:00
|
|
|
|
2013-07-24 22:50:40 +08:00
|
|
|
/// Square matrix of dimension 2.
|
2014-11-16 21:04:15 +08:00
|
|
|
#[deriving(Eq, PartialEq, Encodable, Decodable, Clone, Hash, Rand, Show)]
|
2013-08-05 16:13:44 +08:00
|
|
|
pub struct Mat2<N> {
|
2014-04-02 04:58:06 +08:00
|
|
|
pub m11: N, pub m21: N,
|
|
|
|
pub m12: N, pub m22: N
|
2013-07-22 16:26:20 +08:00
|
|
|
}
|
|
|
|
|
2014-05-12 01:46:04 +08:00
|
|
|
eye_impl!(Mat2, 2, m11, m22)
|
|
|
|
|
2013-09-15 03:11:43 +08:00
|
|
|
double_dispatch_binop_decl_trait!(Mat2, Mat2MulRhs)
|
|
|
|
double_dispatch_binop_decl_trait!(Mat2, Mat2DivRhs)
|
|
|
|
double_dispatch_binop_decl_trait!(Mat2, Mat2AddRhs)
|
|
|
|
double_dispatch_binop_decl_trait!(Mat2, Mat2SubRhs)
|
2013-10-10 04:59:44 +08:00
|
|
|
double_dispatch_cast_decl_trait!(Mat2, Mat2Cast)
|
2013-09-15 03:11:43 +08:00
|
|
|
mul_redispatch_impl!(Mat2, Mat2MulRhs)
|
|
|
|
div_redispatch_impl!(Mat2, Mat2DivRhs)
|
|
|
|
add_redispatch_impl!(Mat2, Mat2AddRhs)
|
|
|
|
sub_redispatch_impl!(Mat2, Mat2SubRhs)
|
2013-10-10 04:59:44 +08:00
|
|
|
cast_redispatch_impl!(Mat2, Mat2Cast)
|
2013-07-23 05:42:35 +08:00
|
|
|
mat_impl!(Mat2, m11, m12,
|
|
|
|
m21, m22)
|
2014-11-21 18:21:02 +08:00
|
|
|
as_array_impl!(Mat2, 2)
|
2013-10-10 04:59:44 +08:00
|
|
|
mat_cast_impl!(Mat2, Mat2Cast, m11, m12,
|
|
|
|
m21, m22)
|
2013-09-15 03:11:43 +08:00
|
|
|
add_impl!(Mat2, Mat2AddRhs, m11, m12, m21, m22)
|
|
|
|
sub_impl!(Mat2, Mat2SubRhs, m11, m12, m21, m22)
|
|
|
|
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat2, f64, Mat2MulRhs, m11, m12, m21, m22)
|
|
|
|
mat_mul_scalar_impl!(Mat2, f32, Mat2MulRhs, m11, m12, m21, m22)
|
|
|
|
mat_mul_scalar_impl!(Mat2, i64, Mat2MulRhs, m11, m12, m21, m22)
|
|
|
|
mat_mul_scalar_impl!(Mat2, i32, Mat2MulRhs, m11, m12, m21, m22)
|
|
|
|
mat_mul_scalar_impl!(Mat2, i16, Mat2MulRhs, m11, m12, m21, m22)
|
|
|
|
mat_mul_scalar_impl!(Mat2, i8, Mat2MulRhs, m11, m12, m21, m22)
|
|
|
|
mat_mul_scalar_impl!(Mat2, u64, Mat2MulRhs, m11, m12, m21, m22)
|
|
|
|
mat_mul_scalar_impl!(Mat2, u32, Mat2MulRhs, m11, m12, m21, m22)
|
|
|
|
mat_mul_scalar_impl!(Mat2, u16, Mat2MulRhs, m11, m12, m21, m22)
|
|
|
|
mat_mul_scalar_impl!(Mat2, u8, Mat2MulRhs, m11, m12, m21, m22)
|
|
|
|
mat_mul_scalar_impl!(Mat2, uint, Mat2MulRhs, m11, m12, m21, m22)
|
|
|
|
mat_mul_scalar_impl!(Mat2, int, Mat2MulRhs, m11, m12, m21, m22)
|
|
|
|
|
|
|
|
mat_div_scalar_impl!(Mat2, f64, Mat2DivRhs, m11, m12, m21, m22)
|
|
|
|
mat_div_scalar_impl!(Mat2, f32, Mat2DivRhs, m11, m12, m21, m22)
|
|
|
|
mat_div_scalar_impl!(Mat2, i64, Mat2DivRhs, m11, m12, m21, m22)
|
|
|
|
mat_div_scalar_impl!(Mat2, i32, Mat2DivRhs, m11, m12, m21, m22)
|
|
|
|
mat_div_scalar_impl!(Mat2, i16, Mat2DivRhs, m11, m12, m21, m22)
|
|
|
|
mat_div_scalar_impl!(Mat2, i8, Mat2DivRhs, m11, m12, m21, m22)
|
|
|
|
mat_div_scalar_impl!(Mat2, u64, Mat2DivRhs, m11, m12, m21, m22)
|
|
|
|
mat_div_scalar_impl!(Mat2, u32, Mat2DivRhs, m11, m12, m21, m22)
|
|
|
|
mat_div_scalar_impl!(Mat2, u16, Mat2DivRhs, m11, m12, m21, m22)
|
|
|
|
mat_div_scalar_impl!(Mat2, u8, Mat2DivRhs, m11, m12, m21, m22)
|
|
|
|
mat_div_scalar_impl!(Mat2, uint, Mat2DivRhs, m11, m12, m21, m22)
|
|
|
|
mat_div_scalar_impl!(Mat2, int, Mat2DivRhs, m11, m12, m21, m22)
|
|
|
|
|
|
|
|
mat_add_scalar_impl!(Mat2, f64, Mat2AddRhs, m11, m12, m21, m22)
|
|
|
|
mat_add_scalar_impl!(Mat2, f32, Mat2AddRhs, m11, m12, m21, m22)
|
|
|
|
mat_add_scalar_impl!(Mat2, i64, Mat2AddRhs, m11, m12, m21, m22)
|
|
|
|
mat_add_scalar_impl!(Mat2, i32, Mat2AddRhs, m11, m12, m21, m22)
|
|
|
|
mat_add_scalar_impl!(Mat2, i16, Mat2AddRhs, m11, m12, m21, m22)
|
|
|
|
mat_add_scalar_impl!(Mat2, i8, Mat2AddRhs, m11, m12, m21, m22)
|
|
|
|
mat_add_scalar_impl!(Mat2, u64, Mat2AddRhs, m11, m12, m21, m22)
|
|
|
|
mat_add_scalar_impl!(Mat2, u32, Mat2AddRhs, m11, m12, m21, m22)
|
|
|
|
mat_add_scalar_impl!(Mat2, u16, Mat2AddRhs, m11, m12, m21, m22)
|
|
|
|
mat_add_scalar_impl!(Mat2, u8, Mat2AddRhs, m11, m12, m21, m22)
|
|
|
|
mat_add_scalar_impl!(Mat2, uint, Mat2AddRhs, m11, m12, m21, m22)
|
|
|
|
mat_add_scalar_impl!(Mat2, int, Mat2AddRhs, m11, m12, m21, m22)
|
|
|
|
|
|
|
|
mat_sub_scalar_impl!(Mat2, f64, Mat2SubRhs, m11, m12, m21, m22)
|
|
|
|
mat_sub_scalar_impl!(Mat2, f32, Mat2SubRhs, m11, m12, m21, m22)
|
|
|
|
mat_sub_scalar_impl!(Mat2, i64, Mat2SubRhs, m11, m12, m21, m22)
|
|
|
|
mat_sub_scalar_impl!(Mat2, i32, Mat2SubRhs, m11, m12, m21, m22)
|
|
|
|
mat_sub_scalar_impl!(Mat2, i16, Mat2SubRhs, m11, m12, m21, m22)
|
|
|
|
mat_sub_scalar_impl!(Mat2, i8, Mat2SubRhs, m11, m12, m21, m22)
|
|
|
|
mat_sub_scalar_impl!(Mat2, u64, Mat2SubRhs, m11, m12, m21, m22)
|
|
|
|
mat_sub_scalar_impl!(Mat2, u32, Mat2SubRhs, m11, m12, m21, m22)
|
|
|
|
mat_sub_scalar_impl!(Mat2, u16, Mat2SubRhs, m11, m12, m21, m22)
|
|
|
|
mat_sub_scalar_impl!(Mat2, u8, Mat2SubRhs, m11, m12, m21, m22)
|
|
|
|
mat_sub_scalar_impl!(Mat2, uint, Mat2SubRhs, m11, m12, m21, m22)
|
|
|
|
mat_sub_scalar_impl!(Mat2, int, Mat2SubRhs, m11, m12, m21, m22)
|
2013-09-15 03:11:43 +08:00
|
|
|
|
2013-09-13 16:26:19 +08:00
|
|
|
absolute_impl!(Mat2, m11, m12,
|
|
|
|
m21, m22)
|
2014-11-16 21:04:15 +08:00
|
|
|
zero_impl!(Mat2, m11, m12,
|
|
|
|
m21, m22)
|
|
|
|
one_impl!(Mat2, ::one, ::zero,
|
|
|
|
::zero, ::one)
|
2013-07-22 16:26:20 +08:00
|
|
|
iterable_impl!(Mat2, 2)
|
|
|
|
iterable_mut_impl!(Mat2, 2)
|
|
|
|
dim_impl!(Mat2, 2)
|
|
|
|
indexable_impl!(Mat2, 2)
|
2014-10-26 05:02:16 +08:00
|
|
|
index_impl!(Mat2, 2)
|
2013-09-13 19:21:42 +08:00
|
|
|
at_fast_impl!(Mat2, 2)
|
2013-09-14 17:06:41 +08:00
|
|
|
// (specialized) mul_impl!(Mat2, 2)
|
|
|
|
// (specialized) rmul_impl!(Mat2, Vec2, 2)
|
|
|
|
// (specialized) lmul_impl!(Mat2, Vec2, 2)
|
2013-07-22 16:26:20 +08:00
|
|
|
// (specialized) inv_impl!(Mat2, 2)
|
|
|
|
transpose_impl!(Mat2, 2)
|
|
|
|
approx_eq_impl!(Mat2)
|
2013-08-26 05:01:44 +08:00
|
|
|
row_impl!(Mat2, Vec2, 2)
|
2013-09-13 16:26:19 +08:00
|
|
|
col_impl!(Mat2, Vec2, 2)
|
2014-08-16 18:16:26 +08:00
|
|
|
col_slice_impl!(Mat2, Vec2, DVec2, 2)
|
|
|
|
row_slice_impl!(Mat2, Vec2, DVec2, 2)
|
2014-08-16 19:12:08 +08:00
|
|
|
diag_impl!(Mat2, Vec2, 2)
|
2013-07-22 16:26:20 +08:00
|
|
|
to_homogeneous_impl!(Mat2, Mat3, 2, 3)
|
|
|
|
from_homogeneous_impl!(Mat2, Mat3, 2, 3)
|
2013-08-12 22:45:31 +08:00
|
|
|
outer_impl!(Vec2, Mat2)
|
2014-10-27 00:24:33 +08:00
|
|
|
eigen_qr_impl!(Mat2, Vec2)
|
2013-07-22 16:26:20 +08:00
|
|
|
|
2013-07-24 22:50:40 +08:00
|
|
|
/// Square matrix of dimension 3.
|
2014-11-16 21:04:15 +08:00
|
|
|
#[deriving(Eq, PartialEq, Encodable, Decodable, Clone, Hash, Rand, Show)]
|
2013-08-05 16:13:44 +08:00
|
|
|
pub struct Mat3<N> {
|
2014-04-02 04:58:06 +08:00
|
|
|
pub m11: N, pub m21: N, pub m31: N,
|
|
|
|
pub m12: N, pub m22: N, pub m32: N,
|
|
|
|
pub m13: N, pub m23: N, pub m33: N
|
2013-07-22 16:26:20 +08:00
|
|
|
}
|
|
|
|
|
2014-05-12 01:46:04 +08:00
|
|
|
eye_impl!(Mat3, 3, m11, m22, m33)
|
|
|
|
|
2013-09-15 03:11:43 +08:00
|
|
|
double_dispatch_binop_decl_trait!(Mat3, Mat3MulRhs)
|
|
|
|
double_dispatch_binop_decl_trait!(Mat3, Mat3DivRhs)
|
|
|
|
double_dispatch_binop_decl_trait!(Mat3, Mat3AddRhs)
|
|
|
|
double_dispatch_binop_decl_trait!(Mat3, Mat3SubRhs)
|
2013-10-10 04:59:44 +08:00
|
|
|
double_dispatch_cast_decl_trait!(Mat3, Mat3Cast)
|
2013-09-15 03:11:43 +08:00
|
|
|
mul_redispatch_impl!(Mat3, Mat3MulRhs)
|
|
|
|
div_redispatch_impl!(Mat3, Mat3DivRhs)
|
|
|
|
add_redispatch_impl!(Mat3, Mat3AddRhs)
|
|
|
|
sub_redispatch_impl!(Mat3, Mat3SubRhs)
|
2013-10-10 04:59:44 +08:00
|
|
|
cast_redispatch_impl!(Mat3, Mat3Cast)
|
2013-07-23 05:42:35 +08:00
|
|
|
mat_impl!(Mat3, m11, m12, m13,
|
|
|
|
m21, m22, m23,
|
|
|
|
m31, m32, m33)
|
2014-11-21 18:21:02 +08:00
|
|
|
as_array_impl!(Mat3, 3)
|
2013-10-10 04:59:44 +08:00
|
|
|
mat_cast_impl!(Mat3, Mat3Cast, m11, m12, m13,
|
|
|
|
m21, m22, m23,
|
|
|
|
m31, m32, m33)
|
2013-09-15 03:11:43 +08:00
|
|
|
add_impl!(Mat3, Mat3AddRhs,
|
|
|
|
m11, m12, m13,
|
|
|
|
m21, m22, m23,
|
|
|
|
m31, m32, m33
|
|
|
|
)
|
|
|
|
sub_impl!(Mat3, Mat3SubRhs,
|
|
|
|
m11, m12, m13,
|
|
|
|
m21, m22, m23,
|
|
|
|
m31, m32, m33
|
|
|
|
)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat3, f64, Mat3MulRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_mul_scalar_impl!(Mat3, f32, Mat3MulRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_mul_scalar_impl!(Mat3, i64, Mat3MulRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_mul_scalar_impl!(Mat3, i32, Mat3MulRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_mul_scalar_impl!(Mat3, i16, Mat3MulRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_mul_scalar_impl!(Mat3, i8, Mat3MulRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_mul_scalar_impl!(Mat3, u64, Mat3MulRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_mul_scalar_impl!(Mat3, u32, Mat3MulRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_mul_scalar_impl!(Mat3, u16, Mat3MulRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_mul_scalar_impl!(Mat3, u8, Mat3MulRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_mul_scalar_impl!(Mat3, uint, Mat3MulRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_mul_scalar_impl!(Mat3, int, Mat3MulRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
|
|
|
|
mat_div_scalar_impl!(Mat3, f64, Mat3DivRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_div_scalar_impl!(Mat3, f32, Mat3DivRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_div_scalar_impl!(Mat3, i64, Mat3DivRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_div_scalar_impl!(Mat3, i32, Mat3DivRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_div_scalar_impl!(Mat3, i16, Mat3DivRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_div_scalar_impl!(Mat3, i8, Mat3DivRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_div_scalar_impl!(Mat3, u64, Mat3DivRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_div_scalar_impl!(Mat3, u32, Mat3DivRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_div_scalar_impl!(Mat3, u16, Mat3DivRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_div_scalar_impl!(Mat3, u8, Mat3DivRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_div_scalar_impl!(Mat3, uint, Mat3DivRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_div_scalar_impl!(Mat3, int, Mat3DivRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
|
|
|
|
mat_add_scalar_impl!(Mat3, f64, Mat3AddRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_add_scalar_impl!(Mat3, f32, Mat3AddRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_add_scalar_impl!(Mat3, i64, Mat3AddRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_add_scalar_impl!(Mat3, i32, Mat3AddRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_add_scalar_impl!(Mat3, i16, Mat3AddRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_add_scalar_impl!(Mat3, i8, Mat3AddRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_add_scalar_impl!(Mat3, u64, Mat3AddRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_add_scalar_impl!(Mat3, u32, Mat3AddRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_add_scalar_impl!(Mat3, u16, Mat3AddRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_add_scalar_impl!(Mat3, u8, Mat3AddRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_add_scalar_impl!(Mat3, uint, Mat3AddRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_add_scalar_impl!(Mat3, int, Mat3AddRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
|
|
|
|
mat_sub_scalar_impl!(Mat3, f64, Mat3SubRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_sub_scalar_impl!(Mat3, f32, Mat3SubRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_sub_scalar_impl!(Mat3, i64, Mat3SubRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_sub_scalar_impl!(Mat3, i32, Mat3SubRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_sub_scalar_impl!(Mat3, i16, Mat3SubRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_sub_scalar_impl!(Mat3, i8, Mat3SubRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_sub_scalar_impl!(Mat3, u64, Mat3SubRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_sub_scalar_impl!(Mat3, u32, Mat3SubRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_sub_scalar_impl!(Mat3, u16, Mat3SubRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_sub_scalar_impl!(Mat3, u8, Mat3SubRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_sub_scalar_impl!(Mat3, uint, Mat3SubRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
|
|
|
mat_sub_scalar_impl!(Mat3, int, Mat3SubRhs, m11, m12, m13, m21, m22, m23, m31, m32, m33)
|
2013-09-15 03:11:43 +08:00
|
|
|
|
|
|
|
absolute_impl!(Mat3,
|
|
|
|
m11, m12, m13,
|
|
|
|
m21, m22, m23,
|
|
|
|
m31, m32, m33
|
|
|
|
)
|
2014-11-16 21:04:15 +08:00
|
|
|
zero_impl!(Mat3,
|
|
|
|
m11, m12, m13,
|
|
|
|
m21, m22, m23,
|
|
|
|
m31, m32, m33
|
|
|
|
)
|
|
|
|
one_impl!(Mat3, ::one , ::zero, ::zero,
|
|
|
|
::zero, ::one , ::zero,
|
|
|
|
::zero, ::zero, ::one)
|
2013-07-22 16:26:20 +08:00
|
|
|
iterable_impl!(Mat3, 3)
|
|
|
|
iterable_mut_impl!(Mat3, 3)
|
|
|
|
dim_impl!(Mat3, 3)
|
|
|
|
indexable_impl!(Mat3, 3)
|
2014-10-26 05:02:16 +08:00
|
|
|
index_impl!(Mat3, 3)
|
2013-09-13 19:21:42 +08:00
|
|
|
at_fast_impl!(Mat3, 3)
|
2013-09-14 17:06:41 +08:00
|
|
|
// (specialized) mul_impl!(Mat3, 3)
|
|
|
|
// (specialized) rmul_impl!(Mat3, Vec3, 3)
|
|
|
|
// (specialized) lmul_impl!(Mat3, Vec3, 3)
|
2013-07-22 16:26:20 +08:00
|
|
|
// (specialized) inv_impl!(Mat3, 3)
|
|
|
|
transpose_impl!(Mat3, 3)
|
|
|
|
approx_eq_impl!(Mat3)
|
2013-08-26 05:01:44 +08:00
|
|
|
// (specialized) row_impl!(Mat3, Vec3, 3)
|
2013-09-13 16:26:19 +08:00
|
|
|
// (specialized) col_impl!(Mat3, Vec3, 3)
|
2014-08-16 18:16:26 +08:00
|
|
|
col_slice_impl!(Mat3, Vec3, DVec3, 3)
|
|
|
|
row_slice_impl!(Mat3, Vec3, DVec3, 3)
|
2014-08-16 19:12:08 +08:00
|
|
|
diag_impl!(Mat3, Vec3, 3)
|
2013-07-22 16:26:20 +08:00
|
|
|
to_homogeneous_impl!(Mat3, Mat4, 3, 4)
|
|
|
|
from_homogeneous_impl!(Mat3, Mat4, 3, 4)
|
2013-08-12 22:45:31 +08:00
|
|
|
outer_impl!(Vec3, Mat3)
|
2014-10-27 00:24:33 +08:00
|
|
|
eigen_qr_impl!(Mat3, Vec3)
|
2013-07-22 16:26:20 +08:00
|
|
|
|
2013-07-24 22:50:40 +08:00
|
|
|
/// Square matrix of dimension 4.
|
2014-11-16 21:04:15 +08:00
|
|
|
#[deriving(Eq, PartialEq, Encodable, Decodable, Clone, Hash, Rand, Show)]
|
2013-08-05 16:13:44 +08:00
|
|
|
pub struct Mat4<N> {
|
2014-04-02 04:58:06 +08:00
|
|
|
pub m11: N, pub m21: N, pub m31: N, pub m41: N,
|
|
|
|
pub m12: N, pub m22: N, pub m32: N, pub m42: N,
|
|
|
|
pub m13: N, pub m23: N, pub m33: N, pub m43: N,
|
|
|
|
pub m14: N, pub m24: N, pub m34: N, pub m44: N
|
2013-07-22 16:26:20 +08:00
|
|
|
}
|
|
|
|
|
2014-05-12 01:46:04 +08:00
|
|
|
eye_impl!(Mat4, 4, m11, m22, m33, m44)
|
|
|
|
|
2013-09-14 23:08:48 +08:00
|
|
|
double_dispatch_binop_decl_trait!(Mat4, Mat4MulRhs)
|
2013-09-15 03:11:43 +08:00
|
|
|
double_dispatch_binop_decl_trait!(Mat4, Mat4DivRhs)
|
|
|
|
double_dispatch_binop_decl_trait!(Mat4, Mat4AddRhs)
|
|
|
|
double_dispatch_binop_decl_trait!(Mat4, Mat4SubRhs)
|
2013-10-10 04:59:44 +08:00
|
|
|
double_dispatch_cast_decl_trait!(Mat4, Mat4Cast)
|
2013-09-15 03:11:43 +08:00
|
|
|
mul_redispatch_impl!(Mat4, Mat4MulRhs)
|
|
|
|
div_redispatch_impl!(Mat4, Mat4DivRhs)
|
|
|
|
add_redispatch_impl!(Mat4, Mat4AddRhs)
|
|
|
|
sub_redispatch_impl!(Mat4, Mat4SubRhs)
|
2013-10-10 04:59:44 +08:00
|
|
|
cast_redispatch_impl!(Mat4, Mat4Cast)
|
2013-07-23 05:42:35 +08:00
|
|
|
mat_impl!(Mat4,
|
|
|
|
m11, m12, m13, m14,
|
|
|
|
m21, m22, m23, m24,
|
|
|
|
m31, m32, m33, m34,
|
|
|
|
m41, m42, m43, m44
|
|
|
|
)
|
2014-11-21 18:21:02 +08:00
|
|
|
as_array_impl!(Mat4, 4)
|
2013-10-10 04:59:44 +08:00
|
|
|
mat_cast_impl!(Mat4, Mat4Cast,
|
2013-07-22 16:26:20 +08:00
|
|
|
m11, m12, m13, m14,
|
|
|
|
m21, m22, m23, m24,
|
|
|
|
m31, m32, m33, m34,
|
|
|
|
m41, m42, m43, m44
|
|
|
|
)
|
2013-09-15 03:11:43 +08:00
|
|
|
add_impl!(Mat4, Mat4AddRhs,
|
2013-08-12 23:04:53 +08:00
|
|
|
m11, m12, m13, m14,
|
|
|
|
m21, m22, m23, m24,
|
|
|
|
m31, m32, m33, m34,
|
|
|
|
m41, m42, m43, m44
|
|
|
|
)
|
2013-09-15 03:11:43 +08:00
|
|
|
sub_impl!(Mat4, Mat4SubRhs,
|
2013-08-12 23:04:53 +08:00
|
|
|
m11, m12, m13, m14,
|
|
|
|
m21, m22, m23, m24,
|
|
|
|
m31, m32, m33, m34,
|
|
|
|
m41, m42, m43, m44
|
|
|
|
)
|
2013-09-15 03:11:43 +08:00
|
|
|
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat4, f64, Mat4MulRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat4, f32, Mat4MulRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat4, i64, Mat4MulRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat4, i32, Mat4MulRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat4, i16, Mat4MulRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat4, i8, Mat4MulRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat4, u32, Mat4MulRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat4, u16, Mat4MulRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat4, u8, Mat4MulRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat4, uint, Mat4MulRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat4, int, Mat4MulRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
|
|
|
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat4, f64, Mat4DivRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat4, f32, Mat4DivRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat4, i64, Mat4DivRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat4, i32, Mat4DivRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat4, i16, Mat4DivRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat4, i8, Mat4DivRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat4, u32, Mat4DivRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat4, u16, Mat4DivRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat4, u8, Mat4DivRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat4, uint, Mat4DivRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat4, int, Mat4DivRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
|
|
|
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat4, f64, Mat4AddRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat4, f32, Mat4AddRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat4, i64, Mat4AddRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat4, i32, Mat4AddRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat4, i16, Mat4AddRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat4, i8, Mat4AddRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat4, u32, Mat4AddRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat4, u16, Mat4AddRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat4, u8, Mat4AddRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat4, uint, Mat4AddRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat4, int, Mat4AddRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
|
|
|
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat4, f64, Mat4SubRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat4, f32, Mat4SubRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat4, i64, Mat4SubRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat4, i32, Mat4SubRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat4, i16, Mat4SubRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat4, i8, Mat4SubRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat4, u32, Mat4SubRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat4, u16, Mat4SubRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat4, u8, Mat4SubRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat4, uint, Mat4SubRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat4, int, Mat4SubRhs, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
|
2013-09-15 03:11:43 +08:00
|
|
|
m41, m42, m43, m44)
|
|
|
|
|
2013-09-13 16:26:19 +08:00
|
|
|
absolute_impl!(Mat4,
|
|
|
|
m11, m12, m13, m14,
|
|
|
|
m21, m22, m23, m24,
|
|
|
|
m31, m32, m33, m34,
|
|
|
|
m41, m42, m43, m44
|
|
|
|
)
|
2014-11-16 21:04:15 +08:00
|
|
|
zero_impl!(Mat4,
|
|
|
|
m11, m12, m13, m14,
|
|
|
|
m21, m22, m23, m24,
|
|
|
|
m31, m32, m33, m34,
|
|
|
|
m41, m42, m43, m44
|
|
|
|
)
|
|
|
|
one_impl!(Mat4, ::one , ::zero, ::zero, ::zero,
|
|
|
|
::zero, ::one , ::zero, ::zero,
|
|
|
|
::zero, ::zero, ::one , ::zero,
|
|
|
|
::zero, ::zero, ::zero, ::one)
|
2013-07-22 16:26:20 +08:00
|
|
|
iterable_impl!(Mat4, 4)
|
|
|
|
iterable_mut_impl!(Mat4, 4)
|
|
|
|
dim_impl!(Mat4, 4)
|
|
|
|
indexable_impl!(Mat4, 4)
|
2014-10-26 05:02:16 +08:00
|
|
|
index_impl!(Mat4, 4)
|
2013-09-13 19:21:42 +08:00
|
|
|
at_fast_impl!(Mat4, 4)
|
2013-09-14 23:08:48 +08:00
|
|
|
mat_mul_mat_impl!(Mat4, Mat4MulRhs, 4)
|
2014-11-16 21:04:15 +08:00
|
|
|
mat_mul_vec_impl!(Mat4, Vec4, Mat4MulRhs, 4, ::zero)
|
|
|
|
vec_mul_mat_impl!(Mat4, Vec4, Vec4MulRhs, 4, ::zero)
|
2014-10-10 17:23:52 +08:00
|
|
|
mat_mul_pnt_impl!(Mat4, Pnt4, Mat4MulRhs, 4, Orig::orig)
|
|
|
|
pnt_mul_mat_impl!(Mat4, Pnt4, Pnt4MulRhs, 4, Orig::orig)
|
2013-07-22 16:26:20 +08:00
|
|
|
inv_impl!(Mat4, 4)
|
|
|
|
transpose_impl!(Mat4, 4)
|
|
|
|
approx_eq_impl!(Mat4)
|
2013-08-26 05:01:44 +08:00
|
|
|
row_impl!(Mat4, Vec4, 4)
|
2013-09-13 16:26:19 +08:00
|
|
|
col_impl!(Mat4, Vec4, 4)
|
2014-08-16 18:16:26 +08:00
|
|
|
col_slice_impl!(Mat4, Vec4, DVec4, 4)
|
|
|
|
row_slice_impl!(Mat4, Vec4, DVec4, 4)
|
2014-08-16 19:12:08 +08:00
|
|
|
diag_impl!(Mat4, Vec4, 4)
|
2013-07-22 16:26:20 +08:00
|
|
|
to_homogeneous_impl!(Mat4, Mat5, 4, 5)
|
|
|
|
from_homogeneous_impl!(Mat4, Mat5, 4, 5)
|
2013-08-12 22:45:31 +08:00
|
|
|
outer_impl!(Vec4, Mat4)
|
2014-10-27 00:24:33 +08:00
|
|
|
eigen_qr_impl!(Mat4, Vec4)
|
2013-07-22 16:26:20 +08:00
|
|
|
|
2013-07-24 22:50:40 +08:00
|
|
|
/// Square matrix of dimension 5.
|
2014-11-16 21:04:15 +08:00
|
|
|
#[deriving(Eq, PartialEq, Encodable, Decodable, Clone, Hash, Rand, Show)]
|
2013-08-05 16:13:44 +08:00
|
|
|
pub struct Mat5<N> {
|
2014-04-02 04:58:06 +08:00
|
|
|
pub m11: N, pub m21: N, pub m31: N, pub m41: N, pub m51: N,
|
|
|
|
pub m12: N, pub m22: N, pub m32: N, pub m42: N, pub m52: N,
|
|
|
|
pub m13: N, pub m23: N, pub m33: N, pub m43: N, pub m53: N,
|
|
|
|
pub m14: N, pub m24: N, pub m34: N, pub m44: N, pub m54: N,
|
|
|
|
pub m15: N, pub m25: N, pub m35: N, pub m45: N, pub m55: N
|
2013-07-22 16:26:20 +08:00
|
|
|
}
|
|
|
|
|
2014-05-12 01:46:04 +08:00
|
|
|
eye_impl!(Mat5, 5, m11, m22, m33, m44, m55)
|
|
|
|
|
2013-09-14 23:08:48 +08:00
|
|
|
double_dispatch_binop_decl_trait!(Mat5, Mat5MulRhs)
|
2013-09-15 03:11:43 +08:00
|
|
|
double_dispatch_binop_decl_trait!(Mat5, Mat5DivRhs)
|
|
|
|
double_dispatch_binop_decl_trait!(Mat5, Mat5AddRhs)
|
|
|
|
double_dispatch_binop_decl_trait!(Mat5, Mat5SubRhs)
|
2013-10-10 04:59:44 +08:00
|
|
|
double_dispatch_cast_decl_trait!(Mat5, Mat5Cast)
|
2013-09-15 03:11:43 +08:00
|
|
|
mul_redispatch_impl!(Mat5, Mat5MulRhs)
|
|
|
|
div_redispatch_impl!(Mat5, Mat5DivRhs)
|
|
|
|
add_redispatch_impl!(Mat5, Mat5AddRhs)
|
|
|
|
sub_redispatch_impl!(Mat5, Mat5SubRhs)
|
2013-10-10 04:59:44 +08:00
|
|
|
cast_redispatch_impl!(Mat5, Mat5Cast)
|
2013-07-23 05:42:35 +08:00
|
|
|
mat_impl!(Mat5,
|
|
|
|
m11, m12, m13, m14, m15,
|
|
|
|
m21, m22, m23, m24, m25,
|
|
|
|
m31, m32, m33, m34, m35,
|
|
|
|
m41, m42, m43, m44, m45,
|
|
|
|
m51, m52, m53, m54, m55
|
|
|
|
)
|
2014-11-21 18:21:02 +08:00
|
|
|
as_array_impl!(Mat5, 5)
|
2013-10-10 04:59:44 +08:00
|
|
|
mat_cast_impl!(Mat5, Mat5Cast,
|
2013-07-22 16:26:20 +08:00
|
|
|
m11, m12, m13, m14, m15,
|
|
|
|
m21, m22, m23, m24, m25,
|
|
|
|
m31, m32, m33, m34, m35,
|
|
|
|
m41, m42, m43, m44, m45,
|
|
|
|
m51, m52, m53, m54, m55
|
|
|
|
)
|
2013-09-13 16:26:19 +08:00
|
|
|
absolute_impl!(Mat5,
|
|
|
|
m11, m12, m13, m14, m15,
|
|
|
|
m21, m22, m23, m24, m25,
|
|
|
|
m31, m32, m33, m34, m35,
|
|
|
|
m41, m42, m43, m44, m45,
|
|
|
|
m51, m52, m53, m54, m55
|
|
|
|
)
|
2014-11-16 21:04:15 +08:00
|
|
|
zero_impl!(Mat5,
|
|
|
|
m11, m12, m13, m14, m15,
|
|
|
|
m21, m22, m23, m24, m25,
|
|
|
|
m31, m32, m33, m34, m35,
|
|
|
|
m41, m42, m43, m44, m45,
|
|
|
|
m51, m52, m53, m54, m55
|
|
|
|
)
|
2013-07-22 16:26:20 +08:00
|
|
|
one_impl!(Mat5,
|
2014-11-16 21:04:15 +08:00
|
|
|
::one , ::zero, ::zero, ::zero, ::zero,
|
|
|
|
::zero, ::one , ::zero, ::zero, ::zero,
|
|
|
|
::zero, ::zero, ::one , ::zero, ::zero,
|
|
|
|
::zero, ::zero, ::zero, ::one , ::zero,
|
|
|
|
::zero, ::zero, ::zero, ::zero, ::one
|
2013-07-22 16:26:20 +08:00
|
|
|
)
|
2013-09-15 03:11:43 +08:00
|
|
|
add_impl!(Mat5, Mat5AddRhs,
|
2013-08-12 22:50:50 +08:00
|
|
|
m11, m12, m13, m14, m15,
|
|
|
|
m21, m22, m23, m24, m25,
|
|
|
|
m31, m32, m33, m34, m35,
|
|
|
|
m41, m42, m43, m44, m45,
|
|
|
|
m51, m52, m53, m54, m55
|
|
|
|
)
|
2013-09-15 03:11:43 +08:00
|
|
|
sub_impl!(Mat5, Mat5SubRhs,
|
2013-08-12 23:04:53 +08:00
|
|
|
m11, m12, m13, m14, m15,
|
|
|
|
m21, m22, m23, m24, m25,
|
|
|
|
m31, m32, m33, m34, m35,
|
|
|
|
m41, m42, m43, m44, m45,
|
|
|
|
m51, m52, m53, m54, m55
|
|
|
|
)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat5, f64, Mat5MulRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat5, f32, Mat5MulRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat5, i64, Mat5MulRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat5, i32, Mat5MulRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat5, i16, Mat5MulRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat5, i8, Mat5MulRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat5, u64, Mat5MulRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat5, u32, Mat5MulRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat5, u16, Mat5MulRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat5, u8, Mat5MulRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat5, uint, Mat5MulRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat5, int, Mat5MulRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
|
|
|
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat5, f64, Mat5DivRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat5, f32, Mat5DivRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat5, i64, Mat5DivRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat5, i32, Mat5DivRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat5, i16, Mat5DivRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat5, i8, Mat5DivRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat5, u64, Mat5DivRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat5, u32, Mat5DivRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat5, u16, Mat5DivRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat5, u8, Mat5DivRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat5, uint, Mat5DivRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat5, int, Mat5DivRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
|
|
|
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat5, f64, Mat5AddRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat5, f32, Mat5AddRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat5, i64, Mat5AddRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat5, i32, Mat5AddRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat5, i16, Mat5AddRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat5, i8, Mat5AddRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat5, u64, Mat5AddRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat5, u32, Mat5AddRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat5, u16, Mat5AddRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat5, u8, Mat5AddRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat5, uint, Mat5AddRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat5, int, Mat5AddRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
|
|
|
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat5, f64, Mat5SubRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat5, f32, Mat5SubRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat5, i64, Mat5SubRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat5, i32, Mat5SubRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat5, i16, Mat5SubRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat5, i8, Mat5SubRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat5, u64, Mat5SubRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat5, u32, Mat5SubRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat5, u16, Mat5SubRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat5, u8, Mat5SubRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat5, uint, Mat5SubRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat5, int, Mat5SubRhs, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m41, m42, m43, m44, m45, m51, m52, m53, m54, m55)
|
|
|
|
|
2013-07-22 16:26:20 +08:00
|
|
|
iterable_impl!(Mat5, 5)
|
|
|
|
iterable_mut_impl!(Mat5, 5)
|
|
|
|
dim_impl!(Mat5, 5)
|
|
|
|
indexable_impl!(Mat5, 5)
|
2014-10-26 05:02:16 +08:00
|
|
|
index_impl!(Mat5, 5)
|
2013-09-13 19:21:42 +08:00
|
|
|
at_fast_impl!(Mat5, 5)
|
2013-09-14 23:08:48 +08:00
|
|
|
mat_mul_mat_impl!(Mat5, Mat5MulRhs, 5)
|
2014-11-16 21:04:15 +08:00
|
|
|
mat_mul_vec_impl!(Mat5, Vec5, Mat5MulRhs, 5, ::zero)
|
|
|
|
vec_mul_mat_impl!(Mat5, Vec5, Vec5MulRhs, 5, ::zero)
|
2014-10-10 17:23:52 +08:00
|
|
|
mat_mul_pnt_impl!(Mat5, Pnt5, Mat5MulRhs, 5, Orig::orig)
|
|
|
|
pnt_mul_mat_impl!(Mat5, Pnt5, Pnt5MulRhs, 5, Orig::orig)
|
2013-07-22 16:26:20 +08:00
|
|
|
inv_impl!(Mat5, 5)
|
|
|
|
transpose_impl!(Mat5, 5)
|
|
|
|
approx_eq_impl!(Mat5)
|
2013-08-26 05:01:44 +08:00
|
|
|
row_impl!(Mat5, Vec5, 5)
|
2013-09-13 16:26:19 +08:00
|
|
|
col_impl!(Mat5, Vec5, 5)
|
2014-08-16 18:16:26 +08:00
|
|
|
col_slice_impl!(Mat5, Vec5, DVec5, 5)
|
|
|
|
row_slice_impl!(Mat5, Vec5, DVec5, 5)
|
2014-08-16 19:12:08 +08:00
|
|
|
diag_impl!(Mat5, Vec5, 5)
|
2013-07-22 16:26:20 +08:00
|
|
|
to_homogeneous_impl!(Mat5, Mat6, 5, 6)
|
|
|
|
from_homogeneous_impl!(Mat5, Mat6, 5, 6)
|
2013-08-12 22:45:31 +08:00
|
|
|
outer_impl!(Vec5, Mat5)
|
2014-10-27 00:24:33 +08:00
|
|
|
eigen_qr_impl!(Mat5, Vec5)
|
2013-07-22 16:26:20 +08:00
|
|
|
|
2013-07-24 22:50:40 +08:00
|
|
|
/// Square matrix of dimension 6.
|
2014-11-16 21:04:15 +08:00
|
|
|
#[deriving(Eq, PartialEq, Encodable, Decodable, Clone, Hash, Rand, Show)]
|
2013-08-05 16:13:44 +08:00
|
|
|
pub struct Mat6<N> {
|
2014-04-02 04:58:06 +08:00
|
|
|
pub m11: N, pub m21: N, pub m31: N, pub m41: N, pub m51: N, pub m61: N,
|
|
|
|
pub m12: N, pub m22: N, pub m32: N, pub m42: N, pub m52: N, pub m62: N,
|
|
|
|
pub m13: N, pub m23: N, pub m33: N, pub m43: N, pub m53: N, pub m63: N,
|
|
|
|
pub m14: N, pub m24: N, pub m34: N, pub m44: N, pub m54: N, pub m64: N,
|
|
|
|
pub m15: N, pub m25: N, pub m35: N, pub m45: N, pub m55: N, pub m65: N,
|
|
|
|
pub m16: N, pub m26: N, pub m36: N, pub m46: N, pub m56: N, pub m66: N
|
2013-07-22 16:26:20 +08:00
|
|
|
}
|
|
|
|
|
2014-05-12 01:46:04 +08:00
|
|
|
eye_impl!(Mat6, 6, m11, m22, m33, m44, m55, m66)
|
|
|
|
|
2013-09-14 23:08:48 +08:00
|
|
|
double_dispatch_binop_decl_trait!(Mat6, Mat6MulRhs)
|
2013-09-15 03:11:43 +08:00
|
|
|
double_dispatch_binop_decl_trait!(Mat6, Mat6DivRhs)
|
|
|
|
double_dispatch_binop_decl_trait!(Mat6, Mat6AddRhs)
|
|
|
|
double_dispatch_binop_decl_trait!(Mat6, Mat6SubRhs)
|
2013-10-10 04:59:44 +08:00
|
|
|
double_dispatch_cast_decl_trait!(Mat6, Mat6Cast)
|
2013-09-15 03:11:43 +08:00
|
|
|
mul_redispatch_impl!(Mat6, Mat6MulRhs)
|
|
|
|
div_redispatch_impl!(Mat6, Mat6DivRhs)
|
|
|
|
add_redispatch_impl!(Mat6, Mat6AddRhs)
|
|
|
|
sub_redispatch_impl!(Mat6, Mat6SubRhs)
|
2013-10-10 04:59:44 +08:00
|
|
|
cast_redispatch_impl!(Mat6, Mat6Cast)
|
2013-07-23 05:42:35 +08:00
|
|
|
mat_impl!(Mat6,
|
|
|
|
m11, m12, m13, m14, m15, m16,
|
|
|
|
m21, m22, m23, m24, m25, m26,
|
|
|
|
m31, m32, m33, m34, m35, m36,
|
|
|
|
m41, m42, m43, m44, m45, m46,
|
|
|
|
m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66
|
|
|
|
)
|
2014-11-21 18:21:02 +08:00
|
|
|
as_array_impl!(Mat6, 6)
|
2013-10-10 04:59:44 +08:00
|
|
|
mat_cast_impl!(Mat6, Mat6Cast,
|
2013-07-22 16:26:20 +08:00
|
|
|
m11, m12, m13, m14, m15, m16,
|
|
|
|
m21, m22, m23, m24, m25, m26,
|
|
|
|
m31, m32, m33, m34, m35, m36,
|
|
|
|
m41, m42, m43, m44, m45, m46,
|
|
|
|
m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66
|
|
|
|
)
|
2013-09-15 03:11:43 +08:00
|
|
|
add_impl!(Mat6, Mat6AddRhs,
|
2013-08-12 22:50:50 +08:00
|
|
|
m11, m12, m13, m14, m15, m16,
|
|
|
|
m21, m22, m23, m24, m25, m26,
|
|
|
|
m31, m32, m33, m34, m35, m36,
|
|
|
|
m41, m42, m43, m44, m45, m46,
|
|
|
|
m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66
|
|
|
|
)
|
2013-09-15 03:11:43 +08:00
|
|
|
sub_impl!(Mat6, Mat6SubRhs,
|
2013-09-13 16:26:19 +08:00
|
|
|
m11, m12, m13, m14, m15, m16,
|
|
|
|
m21, m22, m23, m24, m25, m26,
|
|
|
|
m31, m32, m33, m34, m35, m36,
|
|
|
|
m41, m42, m43, m44, m45, m46,
|
|
|
|
m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66
|
|
|
|
)
|
2013-09-15 03:11:43 +08:00
|
|
|
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat6, f64, Mat6MulRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat6, f32, Mat6MulRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat6, i64, Mat6MulRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat6, i32, Mat6MulRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat6, i16, Mat6MulRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat6, i8, Mat6MulRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat6, u64, Mat6MulRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat6, u32, Mat6MulRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat6, u16, Mat6MulRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat6, u8, Mat6MulRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat6, uint, Mat6MulRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_mul_scalar_impl!(Mat6, int, Mat6MulRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
|
|
|
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat6, f64, Mat6DivRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat6, f32, Mat6DivRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat6, i64, Mat6DivRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat6, i32, Mat6DivRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat6, i16, Mat6DivRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat6, i8, Mat6DivRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat6, u64, Mat6DivRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat6, u32, Mat6DivRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat6, u16, Mat6DivRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat6, u8, Mat6DivRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat6, uint, Mat6DivRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_div_scalar_impl!(Mat6, int, Mat6DivRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
|
|
|
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat6, f64, Mat6AddRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat6, f32, Mat6AddRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat6, i64, Mat6AddRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat6, i32, Mat6AddRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat6, i16, Mat6AddRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat6, i8, Mat6AddRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat6, u64, Mat6AddRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat6, u32, Mat6AddRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat6, u16, Mat6AddRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat6, u8, Mat6AddRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat6, uint, Mat6AddRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_add_scalar_impl!(Mat6, int, Mat6AddRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
|
|
|
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat6, f64, Mat6SubRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat6, f32, Mat6SubRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat6, i64, Mat6SubRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat6, i32, Mat6SubRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat6, i16, Mat6SubRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat6, i8, Mat6SubRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat6, u64, Mat6SubRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat6, u32, Mat6SubRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat6, u16, Mat6SubRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat6, u8, Mat6SubRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat6, uint, Mat6SubRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
2014-05-23 01:54:54 +08:00
|
|
|
mat_sub_scalar_impl!(Mat6, int, Mat6SubRhs, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
2013-09-15 03:11:43 +08:00
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
|
|
|
|
|
|
|
absolute_impl!(Mat6, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
|
|
|
|
2014-11-16 21:04:15 +08:00
|
|
|
zero_impl!(Mat6, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26,
|
|
|
|
m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56,
|
|
|
|
m61, m62, m63, m64, m65, m66)
|
|
|
|
|
2013-07-22 16:26:20 +08:00
|
|
|
one_impl!(Mat6,
|
2014-11-16 21:04:15 +08:00
|
|
|
::one , ::zero, ::zero, ::zero, ::zero, ::zero,
|
|
|
|
::zero, ::one , ::zero, ::zero, ::zero, ::zero,
|
|
|
|
::zero, ::zero, ::one , ::zero, ::zero, ::zero,
|
|
|
|
::zero, ::zero, ::zero, ::one , ::zero, ::zero,
|
|
|
|
::zero, ::zero, ::zero, ::zero, ::one , ::zero,
|
|
|
|
::zero, ::zero, ::zero, ::zero, ::zero, ::one
|
2013-07-22 16:26:20 +08:00
|
|
|
)
|
|
|
|
iterable_impl!(Mat6, 6)
|
|
|
|
iterable_mut_impl!(Mat6, 6)
|
|
|
|
dim_impl!(Mat6, 6)
|
|
|
|
indexable_impl!(Mat6, 6)
|
2014-10-26 05:02:16 +08:00
|
|
|
index_impl!(Mat6, 6)
|
2013-09-13 19:21:42 +08:00
|
|
|
at_fast_impl!(Mat6, 6)
|
2013-09-14 23:08:48 +08:00
|
|
|
mat_mul_mat_impl!(Mat6, Mat6MulRhs, 6)
|
2014-11-16 21:04:15 +08:00
|
|
|
mat_mul_vec_impl!(Mat6, Vec6, Mat6MulRhs, 6, ::zero)
|
|
|
|
vec_mul_mat_impl!(Mat6, Vec6, Vec6MulRhs, 6, ::zero)
|
2014-10-10 17:23:52 +08:00
|
|
|
mat_mul_pnt_impl!(Mat6, Pnt6, Mat6MulRhs, 6, Orig::orig)
|
|
|
|
pnt_mul_mat_impl!(Mat6, Pnt6, Pnt6MulRhs, 6, Orig::orig)
|
2013-07-22 16:26:20 +08:00
|
|
|
inv_impl!(Mat6, 6)
|
|
|
|
transpose_impl!(Mat6, 6)
|
|
|
|
approx_eq_impl!(Mat6)
|
2013-08-26 05:01:44 +08:00
|
|
|
row_impl!(Mat6, Vec6, 6)
|
2013-09-13 16:26:19 +08:00
|
|
|
col_impl!(Mat6, Vec6, 6)
|
2014-08-16 18:16:26 +08:00
|
|
|
col_slice_impl!(Mat6, Vec6, DVec6, 6)
|
|
|
|
row_slice_impl!(Mat6, Vec6, DVec6, 6)
|
2014-08-16 19:12:08 +08:00
|
|
|
diag_impl!(Mat6, Vec6, 6)
|
2013-08-12 22:45:31 +08:00
|
|
|
outer_impl!(Vec6, Mat6)
|
2014-10-27 00:24:33 +08:00
|
|
|
eigen_qr_impl!(Mat6, Vec6)
|