| 826 | |
| 827 | template <class T> |
| 828 | class_<Matrix33<T> > |
| 829 | register_Matrix33() |
| 830 | { |
| 831 | typedef PyImath::StaticFixedArray<Matrix33<T>,T,3,IndexAccessMatrixRow<Matrix33<T>,T,3> > Matrix33_helper; |
| 832 | |
| 833 | MatrixRow<T,3>::register_class(); |
| 834 | class_<Matrix33<T> > matrix33_class(Matrix33Name<T>::value, Matrix33Name<T>::value,init<Matrix33<T> >("copy construction")); |
| 835 | matrix33_class |
| 836 | .def(init<>("initialize to identity")) |
| 837 | .def(init<T>("initialize all entries to a single value")) |
| 838 | .def(init<T,T,T,T,T,T,T,T,T>("make from components")) |
| 839 | .def("__init__", make_constructor(Matrix3_tuple_constructor<T>)) |
| 840 | .def("__init__", make_constructor(Matrix3_matrix_constructor<T,float>)) |
| 841 | .def("__init__", make_constructor(Matrix3_matrix_constructor<T,double>)) |
| 842 | |
| 843 | //.def_readwrite("x00", &Matrix33<T>::x[0][0]) |
| 844 | //.def_readwrite("x01", &Matrix33<T>::x[0][1]) |
| 845 | //.def_readwrite("x02", &Matrix33<T>::x[0][2]) |
| 846 | //.def_readwrite("x10", &Matrix33<T>::x[1][0]) |
| 847 | //.def_readwrite("x11", &Matrix33<T>::x[1][1]) |
| 848 | //.def_readwrite("x12", &Matrix33<T>::x[1][2]) |
| 849 | //.def_readwrite("x20", &Matrix33<T>::x[2][0]) |
| 850 | //.def_readwrite("x21", &Matrix33<T>::x[2][1]) |
| 851 | //.def_readwrite("x22", &Matrix33<T>::x[2][2]) |
| 852 | .def("baseTypeEpsilon", &Matrix33<T>::baseTypeEpsilon,"baseTypeEpsilon() epsilon value of the base type of the vector") |
| 853 | .staticmethod("baseTypeEpsilon") |
| 854 | .def("baseTypeMax", &Matrix33<T>::baseTypeMax,"baseTypeMax() max value of the base type of the vector") |
| 855 | .staticmethod("baseTypeMax") |
| 856 | .def("baseTypeLowest", &Matrix33<T>::baseTypeLowest,"baseTypeLowest() largest negative value of the base type of the vector") |
| 857 | .staticmethod("baseTypeLowest") |
| 858 | .def("baseTypeSmallest", &Matrix33<T>::baseTypeSmallest,"baseTypeSmallest() smallest value of the base type of the vector") |
| 859 | .staticmethod("baseTypeSmallest") |
| 860 | .def("equalWithAbsError", &Matrix33<T>::equalWithAbsError,"m1.equalWithAbsError(m2,e) true if the elements " |
| 861 | "of v1 and v2 are the same with an absolute error of no more than e, " |
| 862 | "i.e., abs(m1[i] - m2[i]) <= e") |
| 863 | .def("equalWithRelError", &Matrix33<T>::equalWithRelError,"m1.equalWithAbsError(m2,e) true if the elements " |
| 864 | "of m1 and m2 are the same with an absolute error of no more than e, " |
| 865 | "i.e., abs(m1[i] - m2[i]) <= e * abs(m1[i])") |
| 866 | // need a different version for matrix data access |
| 867 | .def("__len__", Matrix33_helper::len) |
| 868 | .def("__getitem__", Matrix33_helper::getitem) |
| 869 | //.def("__setitem__", Matrix33_helper::setitem) |
| 870 | .def("makeIdentity",&Matrix33<T>::makeIdentity,"makeIdentity() make this matrix the identity matrix") |
| 871 | .def("transpose",&Matrix33<T>::transpose,return_internal_reference<>(),"transpose() transpose this matrix") |
| 872 | .def("transposed",&Matrix33<T>::transposed,"transposed() return a transposed copy of this matrix") |
| 873 | .def("invert",&invert33<T>,invert33_overloads("invert() invert this matrix")[return_internal_reference<>()]) |
| 874 | .def("inverse",&inverse33<T>,inverse33_overloads("inverse() return an inverted copy of this matrix")) |
| 875 | .def("gjInvert",&gjInvert33<T>,gjInvert33_overloads("gjInvert() invert this matrix")[return_internal_reference<>()]) |
| 876 | .def("gjInverse",&gjInverse33<T>,gjInverse33_overloads("gjInverse() return an inverted copy of this matrix")) |
| 877 | .def("minorOf",&Matrix33<T>::minorOf,"minorOf() return the matrix minor of the (row,col) element of this matrix") |
| 878 | .def("fastMinor",&Matrix33<T>::fastMinor,"fastMinor() return the matrix minor using the specified rows and columns of this matrix") |
| 879 | .def("determinant",&Matrix33<T>::determinant,"determinant() return the determinant of this matrix") |
| 880 | .def(self == self) // NOSONAR - suppress SonarCloud bug report. |
| 881 | .def(self != self) // NOSONAR - suppress SonarCloud bug report. |
| 882 | .def("__iadd__", &iadd33<T, float>,return_internal_reference<>()) |
| 883 | .def("__iadd__", &iadd33<T, double>,return_internal_reference<>()) |
| 884 | .def("__iadd__", &iadd33T<T>,return_internal_reference<>()) |
| 885 | .def("__add__", &add33<T>) |
nothing calls this directly
no outgoing calls
no test coverage detected