#include <vecmath.h>
Definition at line 691 of file vecmath.h.
◆ Matrix4() [1/4]
EMAN::Matrix4::Matrix4 |
( |
| ) |
|
|
inline |
◆ Matrix4() [2/4]
◆ Matrix4() [3/4]
◆ Matrix4() [4/4]
EMAN::Matrix4::Matrix4 |
( |
const Matrix4 & |
m | ) |
|
|
inline |
◆ approxEqual()
bool EMAN::Matrix4::approxEqual |
( |
const Matrix4 & |
m, |
|
|
double |
eps = 1e-12 |
|
) |
| const |
|
inline |
Definition at line 825 of file vecmath.h.
826 for (
int i = 0; i < 16; i++ )
bool isZero(double in_d, double in_dEps=1e-16)
References EMAN::isZero(), and mat.
◆ column()
Vector4 EMAN::Matrix4::column |
( |
int |
c | ) |
const |
|
inline |
◆ identity()
static Matrix4 EMAN::Matrix4::identity |
( |
| ) |
|
|
inlinestatic |
◆ index()
int EMAN::Matrix4::index |
( |
int |
row, |
|
|
int |
col |
|
) |
| const |
|
inline |
◆ inverse()
Matrix4 EMAN::Matrix4::inverse |
( |
| ) |
const |
|
inline |
Definition at line 956 of file vecmath.h.
964 for (j = 0; j < 4; j++) {
966 for (i = j + 1; i < 4; i++) {
967 if (fabs(a(i,j)) > fabs(a(p,j)))
972 for ( i = 0; i < 4; i++ ) {
973 const double ta = a(p,i);
977 const double tb = b(p,i);
983 const double s = a(j,j);
985 for ( i = 0; i < 4; i++ ) {
990 for (i = 0; i < 4; i++) {
992 for (
int k = 0; k < 4; k++ ) {
993 b(i,k) -= a(i,j) * b(j,k);
994 a(i,k) -= a(i,j) * a(j,k);
static Matrix4 identity()
References Assert, identity(), and EMAN::isZero().
◆ operator()() [1/2]
double & EMAN::Matrix4::operator() |
( |
int |
row, |
|
|
int |
col |
|
) |
| |
|
inline |
◆ operator()() [2/2]
const double & EMAN::Matrix4::operator() |
( |
int |
row, |
|
|
int |
col |
|
) |
| const |
|
inline |
◆ operator*() [1/4]
Definition at line 804 of file vecmath.h.
806 for (
int i = 0; i < 4; i++ ) {
807 for (
int j = 0; j < 4; j++ ) {
809 for (
int k = 0; k < 4; k++ )
810 matRet(i,j) += (*this)(i,k) * b(k,j);
◆ operator*() [2/4]
Definition at line 788 of file vecmath.h.
789 const Point3 pt((*
this)(0,0) * p[0] + (*
this)(0,1) * p[1] + (*
this)(0,2) * p[2] + (*
this)(0,3),
790 (*
this)(1,0) * p[0] + (*
this)(1,1) * p[1] + (*
this)(1,2) * p[2] + (*
this)(1,3),
791 (*
this)(2,0) * p[0] + (*
this)(2,1) * p[1] + (*
this)(2,2) * p[2] + (*
this)(2,3));
792 const double w = (*this)(3,0) * p[0] + (*
this)(3,1) * p[1] + (*
this)(3,2) * p[2] + (*
this)(3,3);
794 return Point3( pt[0] / w, pt[1] / w, pt[2] / w );
References Assert, and EMAN::isZero().
◆ operator*() [3/4]
Definition at line 782 of file vecmath.h.
783 return Vector3((*
this)(0,0) * v[0] + (*
this)(0,1) * v[1] + (*
this)(0,2) * v[2],
784 (*
this)(1,0) * v[0] + (*
this)(1,1) * v[1] + (*
this)(1,2) * v[2],
785 (*
this)(2,0) * v[0] + (*
this)(2,1) * v[1] + (*
this)(2,2) * v[2]);
◆ operator*() [4/4]
Definition at line 797 of file vecmath.h.
798 return Vector4((*
this)(0,0) * v[0] + (*
this)(0,1) * v[1] + (*
this)(0,2) * v[2] + (*
this)(0,3) * v[3],
799 (*
this)(1,0) * v[0] + (*
this)(1,1) * v[1] + (*
this)(1,2) * v[2] + (*
this)(1,3) * v[3],
800 (*
this)(2,0) * v[0] + (*
this)(2,1) * v[1] + (*
this)(2,2) * v[2] + (*
this)(2,3) * v[3],
801 (*
this)(3,0) * v[0] + (*
this)(3,1) * v[1] + (*
this)(3,2) * v[2] + (*
this)(3,3) * v[3]);
◆ operator*=()
◆ operator+()
Definition at line 768 of file vecmath.h.
770 for (
int i = 0; i < 16; i++ )
771 matRet.mat[i] =
mat[i] + m.mat[i];
References mat.
◆ operator+=()
◆ operator-()
Definition at line 775 of file vecmath.h.
777 for (
int i = 0; i < 16; i++ )
778 matRet.mat[i] =
mat[i] - m.mat[i];
References mat.
◆ operator-=()
◆ operator=()
Definition at line 723 of file vecmath.h.
724 memcpy( &
mat[0], &m.mat[0],
sizeof(
double) * 16 );
References mat.
◆ operator==()
bool EMAN::Matrix4::operator== |
( |
const Matrix4 & |
m | ) |
const |
|
inline |
Definition at line 818 of file vecmath.h.
819 for (
int i = 0; i < 16; i++ )
820 if (
mat[i] != m.mat[i] )
References mat.
◆ print()
void EMAN::Matrix4::print |
( |
| ) |
const |
|
inline |
Definition at line 832 of file vecmath.h.
833 std::cout <<
"( " << (*this)(0,0) <<
", " << (*
this)(0,1) <<
", " << (*
this)(0,2) <<
", " << (*
this)(0,3) <<
"\n";
834 std::cout <<
" " << (*this)(1,0) <<
", " << (*
this)(1,1) <<
", " << (*
this)(1,2) <<
", " << (*
this)(1,3) <<
"\n";
835 std::cout <<
" " << (*this)(2,0) <<
", " << (*
this)(2,1) <<
", " << (*
this)(2,2) <<
", " << (*
this)(2,3) <<
"\n";
836 std::cout <<
" " << (*this)(3,0) <<
", " << (*
this)(3,1) <<
", " << (*
this)(3,2) <<
", " << (*
this)(3,3) <<
")\n";
◆ rotation() [1/2]
static Matrix4 EMAN::Matrix4::rotation |
( |
const Vector3 & |
axis, |
|
|
double |
angle |
|
) |
| |
|
inlinestatic |
Definition at line 867 of file vecmath.h.
870 const double c = cos(angle);
871 const double s = sin(angle);
872 const double t = 1 - c;
874 return Matrix4(Vector4(t * a[0] * a[0] + c,
875 t * a[0] * a[1] - s * a[2],
876 t * a[0] * a[2] + s * a[1],
878 Vector4(t * a[0] * a[1] + s * a[2],
880 t * a[1] * a[2] - s * a[0],
882 Vector4(t * a[0] * a[2] - s * a[1],
883 t * a[1] * a[2] + s * a[0],
886 Vector4(0, 0, 0, 1));
References Matrix4(), and EMAN::Vector3::normalize().
◆ rotation() [2/2]
Definition at line 860 of file vecmath.h.
861 return Matrix4(Vector4(u[0], u[1], u[2], 0),
862 Vector4(v[0], v[1], v[2], 0),
863 Vector4(w[0], w[1], w[2], 0),
864 Vector4(0 , 0 , 0 , 1));
References Matrix4().
◆ row()
Vector4 EMAN::Matrix4::row |
( |
int |
r | ) |
const |
|
inline |
◆ scaling() [1/3]
Definition at line 919 of file vecmath.h.
920 return Matrix4(Vector4(s[0], 0 , 0 , 0),
921 Vector4(0 , s[1], 0 , 0),
922 Vector4(0 , 0 , s[2], 0),
923 Vector4(0 , 0 , 0 , 1));
References Matrix4().
Referenced by scaling().
◆ scaling() [2/3]
static Matrix4 EMAN::Matrix4::scaling |
( |
double |
scale | ) |
|
|
inlinestatic |
Definition at line 933 of file vecmath.h.
934 return scaling(Vector3(scale, scale, scale));
static Matrix4 scaling(const Vector3 &s)
References scaling().
◆ scaling() [3/3]
static Matrix4 EMAN::Matrix4::scaling |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
z |
|
) |
| |
|
inlinestatic |
◆ translation() [1/2]
Definition at line 846 of file vecmath.h.
847 return Matrix4(Vector4(1, 0, 0, p[0]),
848 Vector4(0, 1, 0, p[1]),
849 Vector4(0, 0, 1, p[2]),
850 Vector4(0, 0, 0, 1));
References Matrix4().
◆ translation() [2/2]
Definition at line 853 of file vecmath.h.
854 return Matrix4(Vector4(1, 0, 0, v[0]),
855 Vector4(0, 1, 0, v[1]),
856 Vector4(0, 0, 1, v[2]),
857 Vector4(0, 0, 0, 1));
References Matrix4().
◆ transpose()
Matrix4 EMAN::Matrix4::transpose |
( |
| ) |
const |
|
inline |
Definition at line 760 of file vecmath.h.
762 for (
int i = 0; i < 4; i++ )
763 for (
int j = 0; j < 4; j++ )
764 matRet(i,j) = (*this)(j,i);
◆ xrotation()
static Matrix4 EMAN::Matrix4::xrotation |
( |
double |
angle | ) |
|
|
inlinestatic |
Definition at line 889 of file vecmath.h.
890 const double c = cos(angle);
891 const double s = sin(angle);
893 return Matrix4(Vector4(1, 0, 0, 0),
894 Vector4(0, c, -s, 0),
896 Vector4(0, 0, 0, 1));
References Matrix4().
◆ yrotation()
static Matrix4 EMAN::Matrix4::yrotation |
( |
double |
angle | ) |
|
|
inlinestatic |
Definition at line 899 of file vecmath.h.
900 double c = cos(angle);
901 double s = sin(angle);
903 return Matrix4(Vector4( c, 0, s, 0),
904 Vector4( 0, 1, 0, 0),
905 Vector4(-s, 0, c, 0),
906 Vector4( 0, 0, 0, 1));
References Matrix4().
◆ zrotation()
static Matrix4 EMAN::Matrix4::zrotation |
( |
double |
angle | ) |
|
|
inlinestatic |
Definition at line 909 of file vecmath.h.
910 const double c = cos(angle);
911 const double s = sin(angle);
913 return Matrix4(Vector4(c, -s, 0, 0),
916 Vector4(0, 0, 0, 1));
References Matrix4().
◆ mat
double EMAN::Matrix4::mat[16] |
|
private |
The documentation for this class was generated from the following file: