MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/Imath / register_Matrix22

Function register_Matrix22

src/python/PyImath/PyImathMatrix22.cpp:536–675  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

534
535template <class T>
536class_<Matrix22<T> >
537register_Matrix22()
538{
539 typedef PyImath::StaticFixedArray<Matrix22<T>,T,2,IndexAccessMatrixRow<Matrix22<T>,T,2> > Matrix22_helper;
540
541 MatrixRow<T,2>::register_class();
542 class_<Matrix22<T> > matrix22_class(Matrix22Name<T>::value, Matrix22Name<T>::value,init<Matrix22<T> >("copy construction"));
543 matrix22_class
544 .def(init<>("initialize to identity"))
545 .def(init<T>("initialize all entries to a single value"))
546 .def(init<T,T,T,T>("make from components"))
547 .def("__init__", make_constructor(Matrix2_tuple_constructor<T>))
548 .def("__init__", make_constructor(Matrix2_matrix_constructor<T,float>))
549 .def("__init__", make_constructor(Matrix2_matrix_constructor<T,double>))
550
551 //.def_readwrite("x00", &Matrix22<T>::x[0][0])
552 //.def_readwrite("x01", &Matrix22<T>::x[0][1])
553 //.def_readwrite("x02", &Matrix22<T>::x[0][2])
554 //.def_readwrite("x10", &Matrix22<T>::x[1][0])
555 //.def_readwrite("x11", &Matrix22<T>::x[1][1])
556 //.def_readwrite("x12", &Matrix22<T>::x[1][2])
557 //.def_readwrite("x20", &Matrix22<T>::x[2][0])
558 //.def_readwrite("x21", &Matrix22<T>::x[2][1])
559 //.def_readwrite("x22", &Matrix22<T>::x[2][2])
560 .def("baseTypeEpsilon", &Matrix22<T>::baseTypeEpsilon,"baseTypeEpsilon() epsilon value of the base type of the vector")
561 .staticmethod("baseTypeEpsilon")
562 .def("baseTypeMax", &Matrix22<T>::baseTypeMax,"baseTypeMax() max value of the base type of the vector")
563 .staticmethod("baseTypeMax")
564 .def("baseTypeLowest", &Matrix22<T>::baseTypeLowest,"baseTypeLowest() largest negative value of the base type of the vector")
565 .staticmethod("baseTypeLowest")
566 .def("baseTypeSmallest", &Matrix22<T>::baseTypeSmallest,"baseTypeSmallest() smallest value of the base type of the vector")
567 .staticmethod("baseTypeSmallest")
568 .def("equalWithAbsError", &Matrix22<T>::equalWithAbsError,"m1.equalWithAbsError(m2,e) true if the elements "
569 "of v1 and v2 are the same with an absolute error of no more than e, "
570 "i.e., abs(m1[i] - m2[i]) <= e")
571 .def("equalWithRelError", &Matrix22<T>::equalWithRelError,"m1.equalWithAbsError(m2,e) true if the elements "
572 "of m1 and m2 are the same with an absolute error of no more than e, "
573 "i.e., abs(m1[i] - m2[i]) <= e * abs(m1[i])")
574 // need a different version for matrix data access
575 .def("__len__", Matrix22_helper::len)
576 .def("__getitem__", Matrix22_helper::getitem)
577 //.def("__setitem__", Matrix22_helper::setitem)
578 .def("makeIdentity",&Matrix22<T>::makeIdentity,"makeIdentity() make this matrix the identity matrix")
579 .def("transpose",&Matrix22<T>::transpose,return_internal_reference<>(),"transpose() transpose this matrix")
580 .def("transposed",&Matrix22<T>::transposed,"transposed() return a transposed copy of this matrix")
581 .def("invert",&invert22<T>,invert22_overloads("invert() invert this matrix")[return_internal_reference<>()])
582 .def("inverse",&inverse22<T>,inverse22_overloads("inverse() return an inverted copy of this matrix"))
583 .def("determinant",&Matrix22<T>::determinant,"determinant() return the determinant of this matrix")
584 .def(self == self) // NOSONAR - suppress SonarCloud bug report.
585 .def(self != self) // NOSONAR - suppress SonarCloud bug report.
586 .def("__iadd__", &iadd22<T, float>,return_internal_reference<>())
587 .def("__iadd__", &iadd22<T, double>,return_internal_reference<>())
588 .def("__iadd__", &iadd22T<T>,return_internal_reference<>())
589 .def("__add__", &add22<T>)
590 .def("__isub__", &isub22<T, float>,return_internal_reference<>())
591 .def("__isub__", &isub22<T, double>,return_internal_reference<>())
592 .def("__isub__", &isub22T<T>,return_internal_reference<>())
593 .def("__sub__", &sub22<T>)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected