4 x 4 symmetric matrix
More...
#include <JMatrix4S.hh>
|
| JMatrix4S () |
| Default constructor. More...
|
|
| JMatrix4S (const JMatrix4D &A) |
| Contructor. More...
|
|
| JMatrix4S (const double __a00, const double __a10, const double __a11, const double __a20, const double __a21, const double __a22, const double __a30, const double __a31, const double __a32, const double __a33) |
| Contructor. More...
|
|
void | invert () |
| Invert matrix. More...
|
|
JMatrix4D & | setIdentity () |
| Set to identity matrix. More...
|
|
void | set (const JMatrix4D &A) |
| Set matrix. More...
|
|
JMatrix4D & | reset () |
| Set matrix to the null matrix. More...
|
|
JMatrix4D & | transpose () |
| Transpose. More...
|
|
JMatrix4D & | negate () |
| Negate matrix. More...
|
|
JMatrix4D & | add (const JMatrix4D &A) |
| Matrix addition. More...
|
|
JMatrix4D & | sub (const JMatrix4D &A) |
| Matrix subtraction. More...
|
|
JMatrix4D & | mul (const double factor) |
| Scale matrix. More...
|
|
const JMatrix4D & | mul (const JMatrix4D &A, const JMatrix4D &B) |
| Matrix multiplication. More...
|
|
JMatrix4D & | mul (const JSecond_t &object) |
| Multiply with object. More...
|
|
JMatrix4D & | div (const double factor) |
| Scale matrix. More...
|
|
bool | equals (const JMatrix4D &A, const double eps=std::numeric_limits< double >::min()) const |
| Equality. More...
|
|
bool | isIdentity (const double eps=std::numeric_limits< double >::min()) const |
| Test identity. More...
|
|
double | getDeterminant () const |
| Get determinant of matrix. More...
|
|
void | transform (double &__x0, double &__x1, double &__x2, double &__x3) const |
| Transform. More...
|
|
4 x 4 symmetric matrix
Definition at line 26 of file JMatrix4S.hh.
◆ JMatrix4S() [1/3]
JMATH::JMatrix4S::JMatrix4S |
( |
| ) |
|
|
inline |
◆ JMatrix4S() [2/3]
JMATH::JMatrix4S::JMatrix4S |
( |
const JMatrix4D & |
A | ) |
|
|
inline |
◆ JMatrix4S() [3/3]
JMATH::JMatrix4S::JMatrix4S |
( |
const double |
__a00, |
|
|
const double |
__a10, |
|
|
const double |
__a11, |
|
|
const double |
__a20, |
|
|
const double |
__a21, |
|
|
const double |
__a22, |
|
|
const double |
__a30, |
|
|
const double |
__a31, |
|
|
const double |
__a32, |
|
|
const double |
__a33 |
|
) |
| |
|
inline |
Contructor.
The upper triangle is internally set.
- Parameters
-
__a00 | (0,0) |
__a10 | (1,0) |
__a11 | (1,1) |
__a20 | (2,0) |
__a21 | (2,1) |
__a22 | (2,2) |
__a30 | (3,0) |
__a31 | (3,1) |
__a32 | (3,2) |
__a33 | (3,3) |
Definition at line 63 of file JMatrix4S.hh.
68 __a10, __a11, __a21, __a31,
69 __a20, __a21, __a22, __a32,
70 __a30, __a31, __a32, __a33)
◆ invert()
void JMATH::JMatrix4S::invert |
( |
| ) |
|
|
inline |
Invert matrix.
Definition at line 77 of file JMatrix4S.hh.
91 if (fabs(
a10) > fabs(val)) {
96 if (fabs(
a20) > fabs(val)) {
101 if (fabs(
a30) > fabs(val)) {
131 throw JDivisionByZero(
"LDU decomposition zero pivot");
151 if (fabs(
a21) > fabs(val)) {
156 if (fabs(
a31) > fabs(val)) {
179 throw JDivisionByZero(
"LDU decomposition zero pivot");
192 if (fabs(
a32) > fabs(val)) {
208 throw JDivisionByZero(
"LDU decomposition zero pivot");
217 throw JDivisionByZero(
"D matrix not invertable");
◆ getInstance()
static const JMatrix4D& JMATH::JMatrix4D::getInstance |
( |
| ) |
|
|
inlinestaticinherited |
Get reference to unique instance of this class object.
- Returns
- zero matrix
Definition at line 89 of file JMatrix4D.hh.
◆ setIdentity()
Set to identity matrix.
- Returns
- this matrix
Definition at line 102 of file JMatrix4D.hh.
◆ getIdentity()
static const JMatrix4D& JMATH::JMatrix4D::getIdentity |
( |
| ) |
|
|
inlinestaticinherited |
Get reference to unique instance of this class object.
- Returns
- identity matrix
Definition at line 118 of file JMatrix4D.hh.
◆ set()
void JMATH::JMatrix4D::set |
( |
const JMatrix4D & |
A | ) |
|
|
inlineinherited |
Set matrix.
- Parameters
-
Definition at line 131 of file JMatrix4D.hh.
133 static_cast<JMatrix4D&>(*
this) = A;
◆ reset()
Set matrix to the null matrix.
- Returns
- this matrix
Definition at line 142 of file JMatrix4D.hh.
◆ transpose()
◆ negate()
Negate matrix.
- Returns
- -this matrix
Definition at line 175 of file JMatrix4D.hh.
◆ add()
Matrix addition.
- Parameters
-
- Returns
- this matrix + A
Definition at line 192 of file JMatrix4D.hh.
◆ sub()
Matrix subtraction.
- Parameters
-
- Returns
- this matrix - A
Definition at line 209 of file JMatrix4D.hh.
◆ mul() [1/3]
JMatrix4D& JMATH::JMatrix4D::mul |
( |
const double |
factor | ) |
|
|
inlineinherited |
Scale matrix.
- Parameters
-
- Returns
- this matrix * factor
Definition at line 226 of file JMatrix4D.hh.
228 a00 *= factor;
a01 *= factor;
a02 *= factor;
a03 *= factor;
229 a10 *= factor;
a11 *= factor;
a12 *= factor;
a13 *= factor;
230 a20 *= factor;
a21 *= factor;
a22 *= factor;
a23 *= factor;
231 a30 *= factor;
a31 *= factor;
a32 *= factor;
a33 *= factor;
◆ mul() [2/3]
Matrix multiplication.
- Parameters
-
- Returns
- this matrix
Definition at line 261 of file JMatrix4D.hh.
◆ mul() [3/3]
Multiply with object.
- Parameters
-
- Returns
- result object
Definition at line 273 of file JMath.hh.
◆ div()
JMatrix4D& JMATH::JMatrix4D::div |
( |
const double |
factor | ) |
|
|
inlineinherited |
Scale matrix.
- Parameters
-
- Returns
- this matrix / factor
Definition at line 243 of file JMatrix4D.hh.
245 a00 /= factor;
a01 /= factor;
a02 /= factor;
a03 /= factor;
246 a10 /= factor;
a11 /= factor;
a12 /= factor;
a13 /= factor;
247 a20 /= factor;
a21 /= factor;
a22 /= factor;
a23 /= factor;
248 a30 /= factor;
a31 /= factor;
a32 /= factor;
a33 /= factor;
◆ equals()
bool JMATH::JMatrix4D::equals |
( |
const JMatrix4D & |
A, |
|
|
const double |
eps = std::numeric_limits<double>::min() |
|
) |
| const |
|
inlineinherited |
Equality.
- Parameters
-
A | matrix |
eps | numerical precision |
- Returns
- true if matrices identical; else false
Definition at line 295 of file JMatrix4D.hh.
298 return (fabs(
a00 - A.
a00) <= eps &&
299 fabs(
a01 - A.
a01) <= eps &&
300 fabs(
a02 - A.
a02) <= eps &&
301 fabs(
a03 - A.
a03) <= eps &&
302 fabs(
a10 - A.
a10) <= eps &&
303 fabs(
a11 - A.
a11) <= eps &&
304 fabs(
a12 - A.
a12) <= eps &&
305 fabs(
a13 - A.
a13) <= eps &&
306 fabs(
a20 - A.
a20) <= eps &&
307 fabs(
a21 - A.
a21) <= eps &&
308 fabs(
a22 - A.
a22) <= eps &&
309 fabs(
a23 - A.
a23) <= eps &&
310 fabs(
a30 - A.
a30) <= eps &&
311 fabs(
a31 - A.
a31) <= eps &&
312 fabs(
a32 - A.
a32) <= eps &&
313 fabs(
a33 - A.
a33) <= eps);
◆ isIdentity()
bool JMATH::JMatrix4D::isIdentity |
( |
const double |
eps = std::numeric_limits<double>::min() | ) |
const |
|
inlineinherited |
Test identity.
- Parameters
-
- Returns
- true if identity matrix; else false
Definition at line 323 of file JMatrix4D.hh.
◆ getDeterminant()
double JMATH::JMatrix4D::getDeterminant |
( |
| ) |
const |
|
inlineinherited |
Get determinant of matrix.
- Returns
- determinant of matrix
Definition at line 334 of file JMatrix4D.hh.
◆ transform()
void JMATH::JMatrix4D::transform |
( |
double & |
__x0, |
|
|
double & |
__x1, |
|
|
double & |
__x2, |
|
|
double & |
__x3 |
|
) |
| const |
|
inlineinherited |
Transform.
- Parameters
-
__x0 | x0 value |
__x1 | x1 value |
__x2 | x2 value |
__x3 | x3 value |
Definition at line 366 of file JMatrix4D.hh.
368 const double x0 =
a00 * __x0 +
a01 * __x1 +
a02 * __x2 +
a03 * __x3;
369 const double x1 =
a10 * __x0 +
a11 * __x1 +
a12 * __x2 +
a13 * __x3;
370 const double x2 =
a20 * __x0 +
a21 * __x1 +
a22 * __x2 +
a23 * __x3;
371 const double x3 =
a30 * __x0 +
a31 * __x1 +
a32 * __x2 +
a33 * __x3;
◆ a00
double JMATH::JMatrix4D::a00 |
|
inherited |
◆ a01
double JMATH::JMatrix4D::a01 |
|
inherited |
◆ a02
double JMATH::JMatrix4D::a02 |
|
inherited |
◆ a03
double JMATH::JMatrix4D::a03 |
|
inherited |
◆ a10
double JMATH::JMatrix4D::a10 |
|
inherited |
◆ a11
double JMATH::JMatrix4D::a11 |
|
inherited |
◆ a12
double JMATH::JMatrix4D::a12 |
|
inherited |
◆ a13
double JMATH::JMatrix4D::a13 |
|
inherited |
◆ a20
double JMATH::JMatrix4D::a20 |
|
inherited |
◆ a21
double JMATH::JMatrix4D::a21 |
|
inherited |
◆ a22
double JMATH::JMatrix4D::a22 |
|
inherited |
◆ a23
double JMATH::JMatrix4D::a23 |
|
inherited |
◆ a30
double JMATH::JMatrix4D::a30 |
|
inherited |
◆ a31
double JMATH::JMatrix4D::a31 |
|
inherited |
◆ a32
double JMATH::JMatrix4D::a32 |
|
inherited |
◆ a33
double JMATH::JMatrix4D::a33 |
|
inherited |
The documentation for this class was generated from the following file: