diff --git a/Base/Vector/RotMatrix.cpp b/Base/Vector/RotMatrix.cpp index 42d27ec6c0af50fb7db148855e2411afe83d7a0a..fea631c366b6dd23786795e5c3f2bc3b875647f2 100644 --- a/Base/Vector/RotMatrix.cpp +++ b/Base/Vector/RotMatrix.cpp @@ -67,7 +67,7 @@ std::array<double, 3> RotMatrix::zxzEulerAngles() const return {std::atan2(m02, -m12), beta, std::atan2(m20, m21)}; } -RotMatrix RotMatrix::getInverse() const +RotMatrix RotMatrix::Inverse() const { return {-x, -y, -z, s}; } @@ -89,13 +89,13 @@ template R3 RotMatrix::transformed<R3>(const R3& v) const; template C3 RotMatrix::transformed<C3>(const C3& v) const; template <class T> -T RotMatrix::transformedInverse(const T& v) const +T RotMatrix::counterTransformed(const T& v) const { - return getInverse().transformed(v); + return Inverse().transformed(v); } -template R3 RotMatrix::transformedInverse<R3>(const R3& v) const; -template C3 RotMatrix::transformedInverse<C3>(const C3& v) const; +template R3 RotMatrix::counterTransformed<R3>(const R3& v) const; +template C3 RotMatrix::counterTransformed<C3>(const C3& v) const; RotMatrix RotMatrix::operator*(const RotMatrix& o) const { diff --git a/Base/Vector/RotMatrix.h b/Base/Vector/RotMatrix.h index 9559667362c0f251d5d929b4c9d9f6c80c678280..ece7e06faceb6024edb406ce2861d7cdc2459f83 100644 --- a/Base/Vector/RotMatrix.h +++ b/Base/Vector/RotMatrix.h @@ -46,7 +46,7 @@ public: std::array<double, 3> zxzEulerAngles() const; //! Returns the inverse transformation. - RotMatrix getInverse() const; + RotMatrix Inverse() const; //! Return transformed vector _v_. template <class T> @@ -54,7 +54,7 @@ public: //! Return transformed vector _v_. template <class T> - T transformedInverse(const T& v) const; + T counterTransformed(const T& v) const; //! Composes two transformations RotMatrix operator*(const RotMatrix&) const; diff --git a/Resample/Particle/ReParticle.cpp b/Resample/Particle/ReParticle.cpp index cfee7e137e5f02417189c1a7abc5ec1ac292273f..307ecfbc6ec92793654d4e48b0da2729cb5e8553 100644 --- a/Resample/Particle/ReParticle.cpp +++ b/Resample/Particle/ReParticle.cpp @@ -100,7 +100,7 @@ complex_t ReParticle::formfactor_at_bottom(C3 q) const complex_t ReParticle::theFF(const WavevectorInfo& wavevectors) const { WavevectorInfo wavevectors2 = - m_rotMatrix ? wavevectors.transformed(m_rotMatrix->getInverse()) : wavevectors; + m_rotMatrix ? wavevectors.transformed(m_rotMatrix->Inverse()) : wavevectors; complex_t result = m_ff->theFF(wavevectors2); if (m_material && m_ambient_material) result = (m_material->scalarSubtrSLD(wavevectors2) @@ -114,7 +114,7 @@ complex_t ReParticle::theFF(const WavevectorInfo& wavevectors) const SpinMatrix ReParticle::thePolFF(const WavevectorInfo& wavevectors) const { WavevectorInfo wavevectors2 = - m_rotMatrix ? wavevectors.transformed(m_rotMatrix->getInverse()) : wavevectors; + m_rotMatrix ? wavevectors.transformed(m_rotMatrix->Inverse()) : wavevectors; SpinMatrix result = m_ff->thePolFF(wavevectors2); if (m_material && m_ambient_material) { // the conjugated linear part of time reversal operator T diff --git a/Sample/Scattering/Rotations.cpp b/Sample/Scattering/Rotations.cpp index 5fb7365459b7d2364d41befa856be373b5de92c1..3d9d1b97e586640badd53ce7552fed0e2b5a91ae 100644 --- a/Sample/Scattering/Rotations.cpp +++ b/Sample/Scattering/Rotations.cpp @@ -166,7 +166,7 @@ RotationEuler::RotationEuler(double alpha, double beta, double gamma) IRotation* RotationEuler::createInverse() const { - RotMatrix inverse_transform(rotMatrix().getInverse()); + RotMatrix inverse_transform(rotMatrix().Inverse()); return createRotation(inverse_transform); } diff --git a/Tests/Unit/Base/RotMatrixTest.cpp b/Tests/Unit/Base/RotMatrixTest.cpp index 7102934fbb67554f3c754b2bfdf68127686e82b1..bfdfda9cdda06d6bd11ce50a78fc2ffed414abda 100644 --- a/Tests/Unit/Base/RotMatrixTest.cpp +++ b/Tests/Unit/Base/RotMatrixTest.cpp @@ -14,7 +14,7 @@ protected: void InversionTest(const RotMatrix& mRot, const R3& a0) { - const RotMatrix mInv = mRot.getInverse(); + const RotMatrix mInv = mRot.Inverse(); const R3 a1 = mRot.transformed(a0); const R3 a2 = mInv.transformed(a1); @@ -47,7 +47,7 @@ TEST_F(RotMatrixTest, RotateZ) EXPECT_NEAR(v.y(), 1.0, epsilon); EXPECT_DOUBLE_EQ(v.z(), 2.0); - const RotMatrix m4 = m3.getInverse(); + const RotMatrix m4 = m3.Inverse(); const R3 w = m4.transformed(v); EXPECT_NEAR(w.x(), a.x(), epsilon); diff --git a/auto/Wrap/libBornAgainBase.py b/auto/Wrap/libBornAgainBase.py index 63c3743288635d0a3ba7565c6ac113fb5e84b3ac..82e8fc768d3721413beb113d3d51df1ee9ccd6ac 100644 --- a/auto/Wrap/libBornAgainBase.py +++ b/auto/Wrap/libBornAgainBase.py @@ -1928,15 +1928,9 @@ class RotMatrix(object): """ return _libBornAgainBase.RotMatrix_zxzEulerAngles(self) - def getInverse(self): - r""" - getInverse(RotMatrix self) -> RotMatrix - RotMatrix RotMatrix::getInverse() const - - Returns the inverse transformation. - - """ - return _libBornAgainBase.RotMatrix_getInverse(self) + def Inverse(self): + r"""Inverse(RotMatrix self) -> RotMatrix""" + return _libBornAgainBase.RotMatrix_Inverse(self) def __mul__(self, arg2): r"""__mul__(RotMatrix self, RotMatrix arg2) -> RotMatrix""" diff --git a/auto/Wrap/libBornAgainBase_wrap.cpp b/auto/Wrap/libBornAgainBase_wrap.cpp index 6c1f5ad175cce28eb0905cfb65bff114a76f0c0b..7ad86da405a535106ad26757b129db155327b87f 100644 --- a/auto/Wrap/libBornAgainBase_wrap.cpp +++ b/auto/Wrap/libBornAgainBase_wrap.cpp @@ -24774,7 +24774,7 @@ fail: } -SWIGINTERN PyObject *_wrap_RotMatrix_getInverse(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_RotMatrix_Inverse(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; RotMatrix *arg1 = (RotMatrix *) 0 ; void *argp1 = 0 ; @@ -24786,10 +24786,10 @@ SWIGINTERN PyObject *_wrap_RotMatrix_getInverse(PyObject *SWIGUNUSEDPARM(self), swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RotMatrix, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RotMatrix_getInverse" "', argument " "1"" of type '" "RotMatrix const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RotMatrix_Inverse" "', argument " "1"" of type '" "RotMatrix const *""'"); } arg1 = reinterpret_cast< RotMatrix * >(argp1); - result = ((RotMatrix const *)arg1)->getInverse(); + result = ((RotMatrix const *)arg1)->Inverse(); resultobj = SWIG_NewPointerObj((new RotMatrix(static_cast< const RotMatrix& >(result))), SWIGTYPE_p_RotMatrix, SWIG_POINTER_OWN | 0 ); return resultobj; fail: @@ -30027,13 +30027,7 @@ static PyMethodDef SwigMethods[] = { "Calculates the Euler angles corresponding to the rotation. \n" "\n" ""}, - { "RotMatrix_getInverse", _wrap_RotMatrix_getInverse, METH_O, "\n" - "RotMatrix_getInverse(RotMatrix self) -> RotMatrix\n" - "RotMatrix RotMatrix::getInverse() const\n" - "\n" - "Returns the inverse transformation. \n" - "\n" - ""}, + { "RotMatrix_Inverse", _wrap_RotMatrix_Inverse, METH_O, "RotMatrix_Inverse(RotMatrix self) -> RotMatrix"}, { "RotMatrix___mul__", _wrap_RotMatrix___mul__, METH_VARARGS, "RotMatrix___mul__(RotMatrix self, RotMatrix arg2) -> RotMatrix"}, { "RotMatrix___eq__", _wrap_RotMatrix___eq__, METH_VARARGS, "RotMatrix___eq__(RotMatrix self, RotMatrix arg2) -> bool"}, { "RotMatrix_isIdentity", _wrap_RotMatrix_isIdentity, METH_O, "\n"