19 #ifndef INCLUDED_numeric_xyzMatrix_hh
20 #define INCLUDED_numeric_xyzMatrix_hh
45 template<
typename T >
109 template<
typename U >
168 template<
typename U >
171 xx_( *(c.p_) ),
xy_( *(c.p_+3) ),
xz_( *(c.p_+6) ),
172 yx_( *(c.p_+1) ),
yy_( *(c.p_+4) ),
yz_( *(c.p_+7) ),
173 zx_( *(c.p_+2) ),
zy_( *(c.p_+5) ),
zz_( *(c.p_+8) )
181 template<
typename U >
198 template<
typename U >
201 xx_( *c.xp_ ),
xy_( *c.yp_ ),
xz_( *c.zp_ ),
202 yx_( *(c.xp_+1) ),
yy_( *(c.yp_+1) ),
yz_( *(c.zp_+1) ),
203 zx_( *(c.xp_+2) ),
zy_( *(c.yp_+2) ),
zz_( *(c.zp_+2) )
213 template<
typename U >
233 template<
typename U >
245 *(xp+1), *(yp+1), *(zp+1),
246 *(xp+2), *(yp+2), *(zp+2)
259 template<
typename U >
262 xx_( c.x_.x_ ),
xy_( c.y_.x_ ),
xz_( c.z_.x_ ),
263 yx_( c.x_.y_ ),
yy_( c.y_.y_ ),
yz_( c.z_.y_ ),
264 zx_( c.x_.z_ ),
zy_( c.y_.z_ ),
zz_( c.z_.z_ )
273 template<
typename U >
292 template<
typename U >
303 col_x.
x_, col_y.
x_, col_z.
x_,
304 col_x.
y_, col_y.
y_, col_z.
y_,
305 col_x.
z_, col_y.
z_, col_z.
z_
344 template<
typename U >
347 xx_( *(r.p_) ),
xy_( *(r.p_+1) ),
xz_( *(r.p_+2) ),
348 yx_( *(r.p_+3) ),
yy_( *(r.p_+4) ),
yz_( *(r.p_+5) ),
349 zx_( *(r.p_+6) ),
zy_( *(r.p_+7) ),
zz_( *(r.p_+8) )
357 template<
typename U >
374 template<
typename U >
377 xx_( *r.xp_ ),
xy_( *(r.xp_+1) ),
xz_( *(r.xp_+2) ),
378 yx_( *r.yp_ ),
yy_( *(r.yp_+1) ),
yz_( *(r.yp_+2) ),
379 zx_( *r.zp_ ),
zy_( *(r.zp_+1) ),
zz_( *(r.zp_+2) )
389 template<
typename U >
409 template<
typename U >
420 *xp, *(xp+1), *(xp+2),
421 *yp, *(yp+1), *(yp+2),
422 *zp, *(zp+1), *(zp+2)
435 template<
typename U >
438 xx_( r.x_.x_ ),
xy_( r.x_.y_ ),
xz_( r.x_.z_ ),
439 yx_( r.y_.x_ ),
yy_( r.y_.y_ ),
yz_( r.y_.z_ ),
440 zx_( r.z_.x_ ),
zy_( r.z_.y_ ),
zz_( r.z_.z_ )
449 template<
typename U >
468 template<
typename U >
479 row_x.
x_, row_x.
y_, row_x.
z_,
480 row_y.
x_, row_y.
y_, row_y.
z_,
481 row_z.
x_, row_z.
y_, row_z.
z_
510 template<
typename U >
574 template<
typename U >
587 template<
typename U >
592 xx_ += m.xx_;
xy_ += m.xy_;
xz_ += m.xz_;
593 yx_ += m.yx_;
yy_ += m.yy_;
yz_ += m.yz_;
594 zx_ += m.zx_;
zy_ += m.zy_;
zz_ += m.zz_;
600 template<
typename U >
605 xx_ -= m.xx_;
xy_ -= m.xy_;
xz_ -= m.xz_;
606 yx_ -= m.yx_;
yy_ -= m.yy_;
yz_ -= m.yz_;
607 zx_ -= m.zx_;
zy_ -= m.zy_;
zz_ -= m.zz_;
614 template<
typename U >
622 x = (
xx_ * m.xx_ ) + (
xy_ * m.yx_ ) + (
xz_ * m.zx_ );
623 y = (
xx_ * m.xy_ ) + (
xy_ * m.yy_ ) + (
xz_ * m.zy_ );
624 z = (
xx_ * m.xz_ ) + (
xy_ * m.yz_ ) + (
xz_ * m.zz_ );
628 x = (
yx_ * m.xx_ ) + (
yy_ * m.yx_ ) + (
yz_ * m.zx_ );
629 y = (
yx_ * m.xy_ ) + (
yy_ * m.yy_ ) + (
yz_ * m.zy_ );
630 z = (
yx_ * m.xz_ ) + (
yy_ * m.yz_ ) + (
yz_ * m.zz_ );
634 x = (
zx_ * m.xx_ ) + (
zy_ * m.yx_ ) + (
zz_ * m.zx_ );
635 y = (
zx_ * m.xy_ ) + (
zy_ * m.yy_ ) + (
zz_ * m.zy_ );
636 z = (
zx_ * m.xz_ ) + (
zy_ * m.yz_ ) + (
zz_ * m.zz_ );
648 template<
typename U >
662 template<
typename U >
677 template<
typename U >
692 template<
typename U >
710 template<
typename U >
725 template<
typename U >
793 assert( t !=
Value( 0 ) );
795 xx_ *= inv_t;
xy_ *= inv_t;
xz_ *= inv_t;
796 yx_ *= inv_t;
yy_ *= inv_t;
yz_ *= inv_t;
797 zx_ *= inv_t;
zy_ *= inv_t;
zz_ *= inv_t;
812 a.xx_ + b.xx_, a.xy_ + b.xy_, a.xz_ + b.xz_,
813 a.yx_ + b.yx_, a.yy_ + b.yy_, a.yz_ + b.yz_,
814 a.zx_ + b.zx_, a.zy_ + b.zy_, a.zz_ + b.zz_
826 m.xx_ + t, m.xy_ + t, m.xz_ + t,
827 m.yx_ + t, m.yy_ + t, m.yz_ + t,
828 m.zx_ + t, m.zy_ + t, m.zz_ + t
840 t + m.xx_, t + m.xy_, t + m.xz_,
841 t + m.yx_, t + m.yy_, t + m.yz_,
842 t + m.zx_, t + m.zy_, t + m.zz_
854 a.xx_ - b.xx_, a.xy_ - b.xy_, a.xz_ - b.xz_,
855 a.yx_ - b.yx_, a.yy_ - b.yy_, a.yz_ - b.yz_,
856 a.zx_ - b.zx_, a.zy_ - b.zy_, a.zz_ - b.zz_
868 m.xx_ - t, m.xy_ - t, m.xz_ - t,
869 m.yx_ - t, m.yy_ - t, m.yz_ - t,
870 m.zx_ - t, m.zy_ - t, m.zz_ - t
882 t - m.xx_, t - m.xy_, t - m.xz_,
883 t - m.yx_, t - m.yy_, t - m.yz_,
884 t - m.zx_, t - m.zy_, t - m.zz_
897 ( a.xx_ * b.xx_ ) + ( a.xy_ * b.yx_ ) + ( a.xz_ * b.zx_ ),
898 ( a.xx_ * b.xy_ ) + ( a.xy_ * b.yy_ ) + ( a.xz_ * b.zy_ ),
899 ( a.xx_ * b.xz_ ) + ( a.xy_ * b.yz_ ) + ( a.xz_ * b.zz_ ),
902 ( a.yx_ * b.xx_ ) + ( a.yy_ * b.yx_ ) + ( a.yz_ * b.zx_ ),
903 ( a.yx_ * b.xy_ ) + ( a.yy_ * b.yy_ ) + ( a.yz_ * b.zy_ ),
904 ( a.yx_ * b.xz_ ) + ( a.yy_ * b.yz_ ) + ( a.yz_ * b.zz_ ),
907 ( a.zx_ * b.xx_ ) + ( a.zy_ * b.yx_ ) + ( a.zz_ * b.zx_ ),
908 ( a.zx_ * b.xy_ ) + ( a.zy_ * b.yy_ ) + ( a.zz_ * b.zy_ ),
909 ( a.zx_ * b.xz_ ) + ( a.zy_ * b.yz_ ) + ( a.zz_ * b.zz_ )
921 m.xx_ * t, m.xy_ * t, m.xz_ * t,
922 m.yx_ * t, m.yy_ * t, m.yz_ * t,
923 m.zx_ * t, m.zy_ * t, m.zz_ * t
935 t * m.xx_, t * m.xy_, t * m.xz_,
936 t * m.yx_, t * m.yy_, t * m.yz_,
937 t * m.zx_, t * m.zy_, t * m.zz_
948 assert( t !=
Value( 0 ) );
951 m.xx_ * inv_t, m.xy_ * inv_t, m.xz_ * inv_t,
952 m.yx_ * inv_t, m.yy_ * inv_t, m.yz_ * inv_t,
953 m.zx_ * inv_t, m.zy_ * inv_t, m.zz_ * inv_t
1016 template<
typename U >
1050 template<
typename U >
1079 template<
typename U >
1108 template<
typename U >
1143 template<
typename U >
1151 x = (
xx_ * m.xx_ ) + (
xy_ * m.yx_ ) + (
xz_ * m.zx_ );
1152 y = (
xx_ * m.xy_ ) + (
xy_ * m.yy_ ) + (
xz_ * m.zy_ );
1153 z = (
xx_ * m.xz_ ) + (
xy_ * m.yz_ ) + (
xz_ * m.zz_ );
1157 x = (
yx_ * m.xx_ ) + (
yy_ * m.yx_ ) + (
yz_ * m.zx_ );
1158 y = (
yx_ * m.xy_ ) + (
yy_ * m.yy_ ) + (
yz_ * m.zy_ );
1159 z = (
yx_ * m.xz_ ) + (
yy_ * m.yz_ ) + (
yz_ * m.zz_ );
1163 x = (
zx_ * m.xx_ ) + (
zy_ * m.yx_ ) + (
zz_ * m.zx_ );
1164 y = (
zx_ * m.xy_ ) + (
zy_ * m.yy_ ) + (
zz_ * m.zy_ );
1165 z = (
zx_ * m.xz_ ) + (
zy_ * m.yz_ ) + (
zz_ * m.zz_ );
1173 template<
typename U >
1181 x = (
xx_ * m.xx_ ) + (
xy_ * m.xy_ ) + (
xz_ * m.xz_ );
1182 y = (
xx_ * m.yx_ ) + (
xy_ * m.yy_ ) + (
xz_ * m.yz_ );
1183 z = (
xx_ * m.zx_ ) + (
xy_ * m.zy_ ) + (
xz_ * m.zz_ );
1187 x = (
yx_ * m.xx_ ) + (
yy_ * m.xy_ ) + (
yz_ * m.xz_ );
1188 y = (
yx_ * m.yx_ ) + (
yy_ * m.yy_ ) + (
yz_ * m.yz_ );
1189 z = (
yx_ * m.zx_ ) + (
yy_ * m.zy_ ) + (
yz_ * m.zz_ );
1193 x = (
zx_ * m.xx_ ) + (
zy_ * m.xy_ ) + (
zz_ * m.xz_ );
1194 y = (
zx_ * m.yx_ ) + (
zy_ * m.yy_ ) + (
zz_ * m.yz_ );
1195 z = (
zx_ * m.zx_ ) + (
zy_ * m.zy_ ) + (
zz_ * m.zz_ );
1203 template<
typename U >
1211 x = ( m.xx_ *
xx_ ) + ( m.xy_ *
yx_ ) + ( m.xz_ *
zx_ );
1212 y = ( m.yx_ *
xx_ ) + ( m.yy_ *
yx_ ) + ( m.yz_ *
zx_ );
1213 z = ( m.zx_ *
xx_ ) + ( m.zy_ *
yx_ ) + ( m.zz_ *
zx_ );
1217 x = ( m.xx_ *
xy_ ) + ( m.xy_ *
yy_ ) + ( m.xz_ *
zy_ );
1218 y = ( m.yx_ *
xy_ ) + ( m.yy_ *
yy_ ) + ( m.yz_ *
zy_ );
1219 z = ( m.zx_ *
xy_ ) + ( m.zy_ *
yy_ ) + ( m.zz_ *
zy_ );
1223 x = ( m.xx_ *
xz_ ) + ( m.xy_ *
yz_ ) + ( m.xz_ *
zz_ );
1224 y = ( m.yx_ *
xz_ ) + ( m.yy_ *
yz_ ) + ( m.yz_ *
zz_ );
1225 z = ( m.zx_ *
xz_ ) + ( m.zy_ *
yz_ ) + ( m.zz_ *
zz_ );
1233 template<
typename U >
1241 x = ( m.xx_ *
xx_ ) + ( m.yx_ *
yx_ ) + ( m.zx_ *
zx_ );
1242 y = ( m.xy_ *
xx_ ) + ( m.yy_ *
yx_ ) + ( m.zy_ *
zx_ );
1243 z = ( m.xz_ *
xx_ ) + ( m.yz_ *
yx_ ) + ( m.zz_ *
zx_ );
1247 x = ( m.xx_ *
xy_ ) + ( m.yx_ *
yy_ ) + ( m.zx_ *
zy_ );
1248 y = ( m.xy_ *
xy_ ) + ( m.yy_ *
yy_ ) + ( m.zy_ *
zy_ );
1249 z = ( m.xz_ *
xy_ ) + ( m.yz_ *
yy_ ) + ( m.zz_ *
zy_ );
1253 x = ( m.xx_ *
xz_ ) + ( m.yx_ *
yz_ ) + ( m.zx_ *
zz_ );
1254 y = ( m.xy_ *
xz_ ) + ( m.yy_ *
yz_ ) + ( m.zy_ *
zz_ );
1255 z = ( m.xz_ *
xz_ ) + ( m.yz_ *
yz_ ) + ( m.zz_ *
zz_ );
1346 assert( ( i > 0 ) && ( i <= 3 ) );
1363 assert( ( i > 0 ) && ( i <= 3 ) );
1443 assert( ( i > 0 ) && ( i <= 3 ) );
1460 assert( ( i > 0 ) && ( i <= 3 ) );
1643 assert( ( i > 0 ) && ( i <= 3 ) );
1644 assert( ( j > 0 ) && ( j <= 3 ) );
1647 return ( j == 1 ?
xx_ : ( j == 2 ?
xy_ :
xz_ ) );
1649 return ( j == 1 ?
yx_ : ( j == 2 ?
yy_ :
yz_ ) );
1651 return ( j == 1 ?
zx_ : ( j == 2 ?
zy_ :
zz_ ) );
1661 assert( ( i > 0 ) && ( i <= 3 ) );
1662 assert( ( j > 0 ) && ( j <= 3 ) );
1665 return ( j == 1 ?
xx_ : ( j == 2 ?
xy_ :
xz_ ) );
1667 return ( j == 1 ?
yx_ : ( j == 2 ?
yy_ :
yz_ ) );
1669 return ( j == 1 ?
zx_ : ( j == 2 ?
zy_ :
zz_ ) );
1766 static Value const ZERO( 0 );
1768 (
xx_ == ZERO ) && (
xy_ == ZERO ) && (
xz_ == ZERO ) &&
1769 (
yx_ == ZERO ) && (
yy_ == ZERO ) && (
yz_ == ZERO ) &&
1770 (
zx_ == ZERO ) && (
zy_ == ZERO ) && (
zz_ == ZERO );
1779 static Value const ZERO( 0 );
1780 static Value const ONE( 1 );
1782 (
xx_ == ONE ) && (
xy_ == ZERO ) && (
xz_ == ZERO ) &&
1783 (
yx_ == ZERO ) && (
yy_ == ONE ) && (
yz_ == ZERO ) &&
1784 (
zx_ == ZERO ) && (
zy_ == ZERO ) && (
zz_ == ONE );
1830 (a.yy_*a.zz_-a.yz_*a.zy_)/D, -(a.xy_*a.zz_-a.xz_*a.zy_)/D, (a.xy_*a.yz_-a.xz_*a.yy_)/D,
1831 -(a.yx_*a.zz_-a.zx_*a.yz_)/D, (a.xx_*a.zz_-a.xz_*a.zx_)/D, -(a.xx_*a.yz_-a.xz_*a.yx_)/D,
1832 (a.yx_*a.zy_-a.zx_*a.yy_)/D, -(a.xx_*a.zy_-a.xy_*a.zx_)/D, (a.xx_*a.yy_-a.xy_*a.yx_)/D
1846 ( a.xx_ == b.xx_ ) && ( a.xy_ == b.xy_ ) && ( a.xz_ == b.xz_ ) &&
1847 ( a.yx_ == b.yx_ ) && ( a.yy_ == b.yy_ ) && ( a.yz_ == b.yz_ ) &&
1848 ( a.zx_ == b.zx_ ) && ( a.zy_ == b.zy_ ) && ( a.zz_ == b.zz_ );
1869 ( a.xx_ < b.xx_ ) && ( a.xy_ < b.xy_ ) && ( a.xz_ < b.xz_ ) &&
1870 ( a.yx_ < b.yx_ ) && ( a.yy_ < b.yy_ ) && ( a.yz_ < b.yz_ ) &&
1871 ( a.zx_ < b.zx_ ) && ( a.zy_ < b.zy_ ) && ( a.zz_ < b.zz_ );
1882 ( a.xx_ <= b.xx_ ) && ( a.xy_ <= b.xy_ ) && ( a.xz_ <= b.xz_ ) &&
1883 ( a.yx_ <= b.yx_ ) && ( a.yy_ <= b.yy_ ) && ( a.yz_ <= b.yz_ ) &&
1884 ( a.zx_ <= b.zx_ ) && ( a.zy_ <= b.zy_ ) && ( a.zz_ <= b.zz_ );
1895 ( a.xx_ >= b.xx_ ) && ( a.xy_ >= b.xy_ ) && ( a.xz_ >= b.xz_ ) &&
1896 ( a.yx_ >= b.yx_ ) && ( a.yy_ >= b.yy_ ) && ( a.yz_ >= b.yz_ ) &&
1897 ( a.zx_ >= b.zx_ ) && ( a.zy_ >= b.zy_ ) && ( a.zz_ >= b.zz_ );
1908 ( a.xx_ > b.xx_ ) && ( a.xy_ > b.xy_ ) && ( a.xz_ > b.xz_ ) &&
1909 ( a.yx_ > b.yx_ ) && ( a.yy_ > b.yy_ ) && ( a.yz_ > b.yz_ ) &&
1910 ( a.zx_ > b.zx_ ) && ( a.zy_ > b.zy_ ) && ( a.zz_ > b.zz_ );
1921 ( m.xx_ == t ) && ( m.xy_ == t ) && ( m.xz_ == t ) &&
1922 ( m.yx_ == t ) && ( m.yy_ == t ) && ( m.yz_ == t ) &&
1923 ( m.zx_ == t ) && ( m.zy_ == t ) && ( m.zz_ == t );
1944 ( m.xx_ < t ) && ( m.xy_ < t ) && ( m.xz_ < t ) &&
1945 ( m.yx_ < t ) && ( m.yy_ < t ) && ( m.yz_ < t ) &&
1946 ( m.zx_ < t ) && ( m.zy_ < t ) && ( m.zz_ < t );
1957 ( m.xx_ <= t ) && ( m.xy_ <= t ) && ( m.xz_ <= t ) &&
1958 ( m.yx_ <= t ) && ( m.yy_ <= t ) && ( m.yz_ <= t ) &&
1959 ( m.zx_ <= t ) && ( m.zy_ <= t ) && ( m.zz_ <= t );
1970 ( m.xx_ >= t ) && ( m.xy_ >= t ) && ( m.xz_ >= t ) &&
1971 ( m.yx_ >= t ) && ( m.yy_ >= t ) && ( m.yz_ >= t ) &&
1972 ( m.zx_ >= t ) && ( m.zy_ >= t ) && ( m.zz_ >= t );
1983 ( m.xx_ > t ) && ( m.xy_ > t ) && ( m.xz_ > t ) &&
1984 ( m.yx_ > t ) && ( m.yy_ > t ) && ( m.yz_ > t ) &&
1985 ( m.zx_ > t ) && ( m.zy_ > t ) && ( m.zz_ > t );
1996 ( t == m.xx_ ) && ( t == m.xy_ ) && ( t == m.xz_ ) &&
1997 ( t == m.yx_ ) && ( t == m.yy_ ) && ( t == m.yz_ ) &&
1998 ( t == m.zx_ ) && ( t == m.zy_ ) && ( t == m.zz_ );
2019 ( t < m.xx_ ) && ( t < m.xy_ ) && ( t < m.xz_ ) &&
2020 ( t < m.yx_ ) && ( t < m.yy_ ) && ( t < m.yz_ ) &&
2021 ( t < m.zx_ ) && ( t < m.zy_ ) && ( t < m.zz_ );
2032 ( t <= m.xx_ ) && ( t <= m.xy_ ) && ( t <= m.xz_ ) &&
2033 ( t <= m.yx_ ) && ( t <= m.yy_ ) && ( t <= m.yz_ ) &&
2034 ( t <= m.zx_ ) && ( t <= m.zy_ ) && ( t <= m.zz_ );
2045 ( t >= m.xx_ ) && ( t >= m.xy_ ) && ( t >= m.xz_ ) &&
2046 ( t >= m.yx_ ) && ( t >= m.yy_ ) && ( t >= m.yz_ ) &&
2047 ( t >= m.zx_ ) && ( t >= m.zy_ ) && ( t >= m.zz_ );
2058 ( t > m.xx_ ) && ( t > m.xy_ ) && ( t > m.xz_ ) &&
2059 ( t > m.yx_ ) && ( t > m.yy_ ) && ( t > m.yz_ ) &&
2060 ( t > m.zx_ ) && ( t > m.zy_ ) && ( t > m.zz_ );
2068 output <<
"(" <<
xx_ <<
", " <<
xy_ <<
", " <<
xz_ <<
")" << std::endl;
2069 output <<
"(" <<
yx_ <<
", " <<
yy_ <<
", " <<
yz_ <<
")" << std::endl;
2070 output <<
"(" <<
zx_ <<
", " <<
zy_ <<
", " <<
zz_ <<
")" << std::endl;
2087 template<
typename T >
2093 template<
typename T >
2099 template<
typename T >
2105 template<
typename T >
2111 template<
typename T >
2117 template<
typename T >
2123 template<
typename T >
2129 template<
typename T >
2135 template<
typename T >
2141 template<
typename T >
2147 template<
typename T >
2153 template<
typename T >
2159 template<
typename T >
2165 template<
typename T >
2171 template<
typename T >
2177 template<
typename T >
2183 template<
typename T >
2189 template<
typename T >
2195 template<
typename T >
2197 operator <( xyzMatrix< T >
const & m,
T const & t );
2201 template<
typename T >
2203 operator <=( xyzMatrix< T >
const & m,
T const & t );
2207 template<
typename T >
2213 template<
typename T >
2219 template<
typename T >
2225 template<
typename T >
2231 template<
typename T >
2233 operator <( T const & t, xyzMatrix< T >
const & m );
2237 template<
typename T >
2239 operator <=( T const & t, xyzMatrix< T >
const & m );
2243 template<
typename T >
2249 template<
typename T >
2256 template<
typename T >
2276 #endif // INCLUDED_numeric_xyzMatrix_HH
3x3 matrix row pointers wrapper class
xyzMatrix(ColVectors< U > const &c)
Columns constructor.
void yz(Value const &yz_a)
yz assignment
xyzVector< T > const & x_
x column
xyzMatrix & row(int const i, Vector const &v)
Row ( i, xyzVector ) assignment: 1-based index.
xyzMatrix(ColPointers< U > const &c)
Pointers to contiguous columns constructor.
static xyzMatrix rows_constructor(xyzVector< U > const &row_x, xyzVector< U > const &row_y, xyzVector< U > const &row_z)
xyzVector rows named constructor
xyzMatrix & set_diagonal(xyzVector< U > const &diag_a)
Set diagonal of xyzMatrix from xyzVector.
bool operator==(BodyPosition< T > const &p1, BodyPosition< T > const &p2)
BodyPosition == BodyPosition.
xyzMatrix(ColsPointer< U > const &c)
Pointer to contiguous column-ordered values constructor.
xyzMatrix(Value const &xx_a, Value const &xy_a, Value const &xz_a, Value const &yx_a, Value const &yy_a, Value const &yz_a, Value const &zx_a, Value const &zy_a, Value const &zz_a)
Row-ordered value constructor.
T const * yp_
Pointer (non-owning) to y row.
xyzMatrix & transpose()
Transpose.
xyzMatrix & subtract_diagonal(Value const &xx_a, Value const &yy_a, Value const &zz_a)
Subtract values from diagonal of xyzMatrix.
3x3 matrix column vectors wrapper class
friend xyzVector< T > operator*(xyzMatrix< T > const &m, xyzVector< T > const &v)
xyzMatrix * xyzVector
xyzMatrix & add_diagonal(xyzVector< U > const &diag_a)
Add xyzVector to diagonal of xyzMatrix.
friend bool operator==(xyzMatrix const &a, xyzMatrix const &b)
xyzMatrix == xyzMatrix
static xyzMatrix cols_constructor(xyzVector< U > const &col_x, xyzVector< U > const &col_y, xyzVector< U > const &col_z)
xyzVector columns named constructor
Value const & zz() const
Value zz const.
Value det() const
Determinant.
Vector row_x() const
Row x.
xyzVector< T > const & y_
y row
xyzMatrix & to_diag(Value const &xx_a, Value const &yy_a, Value const &zz_a)
Set to diagonal xyzMatrix from value.
Vector col_y() const
Column y.
static xyzMatrix rows(Value const &xx_a, Value const &xy_a, Value const &xz_a, Value const &yx_a, Value const &yy_a, Value const &yz_a, Value const &zx_a, Value const &zy_a, Value const &zz_a)
Row-ordered value named constructor.
T const * xp_
Pointer (non-owning) to x column.
static xyzMatrix diag(xyzVector< U > const &diag_a)
Diagonal xyzVector named constructor.
xyzMatrix & operator*=(xyzMatrix< U > const &m)
*= xyzMatrix
Value x_
Coordinates of the 3 coordinate vector.
xyzMatrix & operator=(xyzMatrix const &m)
Copy assignment.
xyzMatrix & clear()
Clear.
MathMatrix< T > operator*(const MathMatrix< T > &MATRIX_LHS, const MathMatrix< T > &MATRIX_RHS)
multiply two matrixs of equal size by building the inner product yielding the scalar product ...
friend bool operator>(xyzMatrix const &a, xyzMatrix const &b)
xyzMatrix > xyzMatrix
xyzMatrix & col(int const i, Vector const &v)
Column( i, xyzVector ) assignment: 1-base index.
xyzMatrix & left_multiply_by_transpose(xyzMatrix< U > const &m)
Left multiply by transpose xyzMatrix.
bool is_zero() const
Is zero?
xyzMatrix transposed() const
Transposed copy.
Value const & operator()(int const i, int const j) const
xyzMatrix( i, j ) const: 1-based index
static ColPointers< U > cols(U const *xp, U const *yp, U const *zp)
Pointers to contiguous columns named constructor/assignment.
static xyzMatrix cols_constructor(U const *xp, U const *yp, U const *zp)
Pointers to contiguous columns named constructor.
Value const & yx() const
Value yx const.
friend bool operator<=(xyzMatrix const &a, xyzMatrix const &b)
xyzMatrix <= xyzMatrix
MathMatrix< T > operator-(const MathMatrix< T > &MATRIX_LHS, const MathMatrix< T > &MATRIX_RHS)
subtract two matrixs of equal size
Value const & xx() const
Value xx const.
void yx(Value const &yx_a)
yx assignment
Vector row_z() const
Row z.
friend bool operator>=(xyzMatrix const &a, xyzMatrix const &b)
xyzMatrix >= xyzMatrix
Value const & yz() const
Value yz const.
Value const & yy() const
Value yy const.
xyzMatrix & col_z(Vector const &v)
Column z assignment.
friend xyzMatrix operator-(xyzMatrix const &a, xyzMatrix const &b)
xyzMatrix - xyzMatrix
void zy(Value const &zy_a)
zy assignment
xyzMatrix & to_identity()
Set to the identity xyzMatrix.
static xyzMatrix rows_constructor(U const *xp, U const *yp, U const *zp)
Pointers to contiguous rows named constructor.
xyzMatrix(Value const &t)
Uniform value constructor.
xyzVector< T > const & z_
z column
xyzMatrix & zero()
Set to the zero xyzMatrix.
void yy(Value const &yy_a)
yy assignment
bool operator>=(xyzMatrix< T > const &a, xyzMatrix< T > const &b)
xyzMatrix >= xyzMatrix
Vector col(int const i) const
Column( i ): 1-based index.
friend bool operator!=(xyzMatrix const &a, xyzMatrix const &b)
xyzMatrix != xyzMatrix
Value trace() const
Trace.
T const * zp_
Pointer (non-owning) to z column.
MathMatrix< T > operator/(const MathMatrix< T > &MATRIX_LHS, const T &SCALAR_RHS)
divide matrix with scalar
void xz(Value const &xz_a)
xz assignment
static RowPointers< U > rows(U const *xp, U const *yp, U const *zp)
Pointers to contiguous rows named constructor/assignment.
xyzMatrix & operator+=(xyzMatrix< U > const &m)
+= xyzMatrix
xyzMatrix & row_x(Vector const &v)
Row x assignment.
Vector col_x() const
Column x.
xyzMatrix & operator-=(xyzMatrix< U > const &m)
-= xyzMatrix
friend bool operator<(xyzMatrix const &a, xyzMatrix const &b)
xyzMatrix < xyzMatrix
xyzMatrix & set_diagonal(Value const &xx_a, Value const &yy_a, Value const &zz_a)
set diagonal of xyzMatrix from value
T const & const_reference
xyzMatrix & row_z(Vector const &v)
Row z assignment.
void zx(Value const &zx_a)
zx assignment
3x3 matrix column pointers wrapper class
friend xyzMatrix operator+(xyzMatrix const &a, xyzMatrix const &b)
xyzMatrix + xyzMatrix
xyzVector< T > const & x_
x row
static RowVectors< U > rows(xyzVector< U > const &row_x, xyzVector< U > const &row_y, xyzVector< U > const &row_z)
Row vectors named constructor/assignment.
Vector row_y() const
Row y.
xyzMatrix & subtract_diagonal(xyzVector< U > const &diag_a)
Subtract xyzVector from diagonal of xyzMatrix.
static RowsPointer< U > rows(U const *rp)
Pointer to contiguous row-ordered values named constructor/assignment.
numeric::xyzVector and numeric::xyzMatrix functions forward declarations
void show(std::ostream &output=std::cout) const
Show.
void zz(Value const &zz_a)
zz assignment
T const * xp_
Pointer (non-owning) to x row.
Value const & zx() const
Value zx const.
bool operator>(xyzMatrix< T > const &a, xyzMatrix< T > const &b)
xyzMatrix > xyzMatrix
xyzMatrix & to_diag(xyzVector< U > const &diag_a)
Set to diagonal xyzMatrix from xyzVector.
xyzMatrix & col_y(Vector const &v)
Column y assignment.
xyzMatrix & add_diagonal(Value const &xx_a, Value const &yy_a, Value const &zz_a)
Add values to diagonal of xyzMatrix.
T const * p_
Pointer (non-owning) to contiguous row-ordered 3x3 matrix.
static xyzMatrix const & I()
Identity xyzMatrix for expressions.
bool operator!=(BodyPosition< T > const &p1, BodyPosition< T > const &p2)
BodyPosition != BodyPosition.
numeric::xyzMatrix forward declarations
Vector col_z() const
Column z.
xyzMatrix(xyzMatrix< U > const &m)
Copy constructor.
3x3 matrix row vectors wrapper class
xyzVector< T > const & z_
z row
ocstream cout(std::cout)
Wrapper around std::cout.
Value const & zy() const
Value zy const.
xyzMatrix(RowVectors< U > const &r)
Rows constructor.
MathMatrix< T > operator+(const MathMatrix< T > &MATRIX_LHS, const MathMatrix< T > &MATRIX_RHS)
sum two matrixs of equal size
xyzMatrix: Fast 3x3 xyz matrix template
xyzMatrix & col_x(Vector const &v)
Column x assignment.
xyzVector< T > const & y_
y column
Value xx_
Elements of the 3x3 matrix.
xyzMatrix & right_multiply_by_transpose(xyzMatrix< U > const &m)
Right multiply by transpose xyzMatrix.
Vector row(int const i) const
Row ( i ): 1-based index.
friend xyzMatrix operator/(xyzMatrix const &m, Value const &t)
xyzMatrix / Value
xyzMatrix(RowPointers< U > const &r)
Pointers to contiguous rows constructor.
static xyzMatrix diag(Value const &xx_a, Value const &yy_a, Value const &zz_a)
Diagonal value named constructor.
Contiguous column-ordered 3x3 matrix pointer wrapper class.
xyzMatrix & operator/=(Value const &t)
/= Value
bool is_identity() const
Is identity?
T const * yp_
Pointer (non-owning) to y column.
Contiguous row-ordered 3x3 matrix pointer wrapper class.
Fast (x,y,z)-coordinate numeric vector.
xyzMatrix & left_multiply_by(xyzMatrix< U > const &m)
Left multiply by xyzMatrix.
xyzMatrix(xyzMatrix const &m)
Copy constructor.
Value const & xz() const
Value xz const.
xyzMatrix & row_y(Vector const &v)
Row y assignment.
void xx(Value const &xx_a)
xx assignment
T const * p_
Pointer (non-owning) to contiguous column-ordered 3x3 matrix.
Value const & xy() const
Value xy const.
static ColVectors< U > cols(xyzVector< U > const &col_x, xyzVector< U > const &col_y, xyzVector< U > const &col_z)
Column vectors named constructor/assignment.
xyzMatrix & right_multiply_by(xyzMatrix< U > const &m)
Right multiply by xyzMatrix.
static xyzMatrix cols(Value const &xx_a, Value const &yx_a, Value const &zx_a, Value const &xy_a, Value const &yy_a, Value const &zy_a, Value const &xz_a, Value const &yz_a, Value const &zz_a)
Column-ordered value named constructor.
xyzMatrix(RowsPointer< U > const &r)
Pointer to contiguous row-ordered values constructor.
void xy(Value const &xy_a)
xy assignment
static ColsPointer< U > cols(U const *cp)
Pointer to contiguous column-ordered values named constructor/assignment.
T const * zp_
Pointer (non-owning) to z row.
xyzMatrix()
Default constructor.
static xyzMatrix identity()
Identity xyzMatrix named constructor.
xyzMatrix< T > inverse() const