<!-- (c) Electronic Arts. All Rights Reserved. -->
<TESTCLASS>

<CLASS NAME="UnitTestMatrix33" HEADER="matrix33test.h" SOURCE="matrix33test.inc" RWHOSTHEADER="rw/math/vpu/matrix33_operation.h" RWGENERICHEADER="rw/math/fpu/matrix33_operation.h" RWOPTIMALHEADER="rw/math/optimal/matrix33_operation.h" HOST="true" GENERIC="true" OPTIMAL="true">

  <TYPE NAME="class">

    <TYPE NAME="correctness">

      <TEST NAME="test0">
      <![CDATA[

        SetFunctionName("Matrix33()");

        Matrix33 m;

        // The matrix is not initialized to any specific values, so we don't need to validate anything.

      ]]>
      </TEST>

      <TEST NAME="test1">
      <![CDATA[

#ifdef HOST_TESTING

        SetFunctionName("Matrix33(const fpu::Matrix33Template<FloatClassRHS> &_m)");

        ::rw::math::fpu::Matrix33Template<double> doubleUnalignedMatrix;
        ::rw::math::fpu::Matrix33Template<float> floatUnalignedMatrix;
        ::rw::math::fpu::Matrix33Template<double> doubleAlignedMatrix;
        ::rw::math::fpu::Matrix33Template<float> floatAlignedMatrix;

        doubleUnalignedMatrix.Set(
            0, 1, 0,
            -1, 0, 0,
            2, 3, 4
            );
        floatUnalignedMatrix.Set(
            0, 1, 0,
            -1, 0, 0,
            2, 3, 4
            );
        doubleAlignedMatrix.Set(
            0, 1, 0,
            -1, 0, 0,
            2, 3, 4
            );
        floatAlignedMatrix.Set(
            0, 1, 0,
            -1, 0, 0,
            2, 3, 4
            );

        Matrix33 ref;
        ref.Set(
            0, 1, 0,
            -1, 0, 0,
            2, 3, 4
            );

        Matrix33 test_doubleUnalignedMatrix(doubleUnalignedMatrix);
        Matrix33 test_floatUnalignedMatrix(doubleUnalignedMatrix);
        Matrix33 test_doubleAlignedMatrix(doubleUnalignedMatrix);
        Matrix33 test_floatAlignedMatrix(doubleUnalignedMatrix);

        Validate(IsSimilar(test_doubleUnalignedMatrix, ref) &&
                 IsSimilar(test_floatUnalignedMatrix, ref) &&
                 IsSimilar(test_doubleAlignedMatrix, ref) &&
                 IsSimilar(test_floatAlignedMatrix, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test2">
      <![CDATA[

        SetFunctionName("Matrix33(Matrix33)");

        Matrix33 m0((float_basic_type)1.0f, (float_basic_type)2.0f, (float_basic_type)3.0f,
                    (float_basic_type)4.0f, (float_basic_type)5.0f, (float_basic_type)6.0f,
                    (float_basic_type)7.0f, (float_basic_type)8.0f, (float_basic_type)9.0f);

        Matrix33 m1(m0);

        Validate(IsSimilar(m0, m1));

      ]]>
      </TEST>


      <TEST NAME="test3">
      <![CDATA[

        SetFunctionName("Matrix33(FloatType m0, FloatType m1, FloatType m2, FloatType m3, FloatType m4, FloatType m5, FloatType m6, FloatType m7, FloatType m8)");

        Matrix33 m( (float_basic_type) 2.0f,
                    (float_basic_type) 3.0f,
                    (float_basic_type) 4.0f,
                    (float_basic_type) 5.0f,
                    (float_basic_type) 6.0f,
                    (float_basic_type) 7.0f,
                    (float_basic_type) 8.0f,
                    (float_basic_type) 9.0f,
                    (float_basic_type) 10.0f);

        Validate(
                    m.GetElem(0) == float_test_type( 2.0f) &&
                    m.GetElem(1) == float_test_type( 3.0f) &&
                    m.GetElem(2) == float_test_type( 4.0f) &&
                    m.GetElem(3) == float_test_type( 5.0f) &&
                    m.GetElem(4) == float_test_type( 6.0f) &&
                    m.GetElem(5) == float_test_type( 7.0f) &&
                    m.GetElem(6) == float_test_type( 8.0f) &&
                    m.GetElem(7) == float_test_type( 9.0f) &&
                    m.GetElem(8) == float_test_type(10.0f)
            );

      ]]>
      </TEST>


      <TEST NAME="matrix33_vecfloat_construction">
      <![CDATA[

        #ifdef HOST_TESTING

        SetFunctionName("Matrix33(VecFloat m0, VecFloat m1, VecFloat m2, VecFloat m3, VecFloat m4, VecFloat m5, VecFloat m6, VecFloat m7, VecFloat m8)");

        Matrix33 m( VecFloat( 2.0f),
                    VecFloat( 3.0f),
                    VecFloat( 4.0f),
                    VecFloat( 5.0f),
                    VecFloat( 6.0f),
                    VecFloat( 7.0f),
                    VecFloat( 8.0f),
                    VecFloat( 9.0f),
                    VecFloat(10.0f) );

        Validate(
                    m.GetElem(0) == VecFloat( 2.0f) &&
                    m.GetElem(1) == VecFloat( 3.0f) &&
                    m.GetElem(2) == VecFloat( 4.0f) &&
                    m.GetElem(3) == VecFloat( 5.0f) &&
                    m.GetElem(4) == VecFloat( 6.0f) &&
                    m.GetElem(5) == VecFloat( 7.0f) &&
                    m.GetElem(6) == VecFloat( 8.0f) &&
                    m.GetElem(7) == VecFloat( 9.0f) &&
                    m.GetElem(8) == VecFloat(10.0f)
            );

        #endif

      ]]>
      </TEST>


      <TEST NAME="test4">
      <![CDATA[

        SetFunctionName("Matrix33(FloatType *)");

        float_basic_type f[9] = {2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f};
        Matrix33 m(&f[0]);

        Validate(
                    m.GetElem(0) == float_test_type( 2.0f) &&
                    m.GetElem(1) == float_test_type( 3.0f) &&
                    m.GetElem(2) == float_test_type( 4.0f) &&
                    m.GetElem(3) == float_test_type( 5.0f) &&
                    m.GetElem(4) == float_test_type( 6.0f) &&
                    m.GetElem(5) == float_test_type( 7.0f) &&
                    m.GetElem(6) == float_test_type( 8.0f) &&
                    m.GetElem(7) == float_test_type( 9.0f) &&
                    m.GetElem(8) == float_test_type(10.0f)
            );

      ]]>
      </TEST>


      <TEST NAME="test5">
      <![CDATA[

        SetFunctionName("Matrix33(Vector3, Vector3, Vector3)");

        Vector3 v1(2.0f, 3.0f, 4.0f);
        Vector3 v2(5.0f, 6.0f, 7.0f);
        Vector3 v3(8.0f, 9.0f, 10.0f);

        Matrix33 m(v1,v2,v3);

        Validate(
                    m.GetElem(0) == float_test_type( 2.0f) &&
                    m.GetElem(1) == float_test_type( 3.0f) &&
                    m.GetElem(2) == float_test_type( 4.0f) &&
                    m.GetElem(3) == float_test_type( 5.0f) &&
                    m.GetElem(4) == float_test_type( 6.0f) &&
                    m.GetElem(5) == float_test_type( 7.0f) &&
                    m.GetElem(6) == float_test_type( 8.0f) &&
                    m.GetElem(7) == float_test_type( 9.0f) &&
                    m.GetElem(8) == float_test_type(10.0f)
        );

      ]]>
      </TEST>


      <TEST NAME="test6">
      <![CDATA[

        SetFunctionName("SetZero()");

        Matrix33 zero((float_test_type)0.0, (float_test_type)0.0, (float_test_type)0.0,
                      (float_test_type)0.0, (float_test_type)0.0, (float_test_type)0.0,
                      (float_test_type)0.0, (float_test_type)0.0, (float_test_type)0.0);
        Matrix33 m((float_test_type)1.0f, (float_test_type)3.0f, (float_test_type)3.0f,
                   (float_test_type)0.4f, (float_test_type)0.5f, (float_test_type)2.0f,
                   (float_test_type)1.0f, (float_test_type)7.0f, (float_test_type)9.0f);
        m.SetZero();

        Validate(IsSimilar(m, zero));

      ]]>
      </TEST>


      <TEST NAME="test7">
      <![CDATA[

        SetFunctionName("SetIdentity()");

        Matrix33 identity((float_test_type)1.0,(float_test_type)0.0,(float_test_type)0.0,
                          (float_test_type)0.0,(float_test_type)1.0,(float_test_type)0.0,
                          (float_test_type)0.0,(float_test_type)0.0,(float_test_type)1.0);
        Matrix33 m;
        m.SetIdentity();

        Validate(IsSimilar(m, identity));

      ]]>
      </TEST>


      <TEST NAME="test8">
      <![CDATA[

        SetFunctionName("Set(FloatType m0, FloatType m1, FloatType m2, FloatType m3, FloatType m4, FloatType m5, FloatType m6, FloatType m7, FloatType m8)");

        Matrix33 m;
        m.Set(
                    (float_basic_type) 2.0f,
                    (float_basic_type) 3.0f,
                    (float_basic_type) 4.0f,
                    (float_basic_type) 5.0f,
                    (float_basic_type) 6.0f,
                    (float_basic_type) 7.0f,
                    (float_basic_type) 8.0f,
                    (float_basic_type) 9.0f,
                    (float_basic_type) 10.0f);

        Validate(
                    m.GetElem(0) == float_test_type( 2.0f) &&
                    m.GetElem(1) == float_test_type( 3.0f) &&
                    m.GetElem(2) == float_test_type( 4.0f) &&
                    m.GetElem(3) == float_test_type( 5.0f) &&
                    m.GetElem(4) == float_test_type( 6.0f) &&
                    m.GetElem(5) == float_test_type( 7.0f) &&
                    m.GetElem(6) == float_test_type( 8.0f) &&
                    m.GetElem(7) == float_test_type( 9.0f) &&
                    m.GetElem(8) == float_test_type(10.0f)
                );

      ]]>
      </TEST>


      <TEST NAME="test9">
      <![CDATA[

        SetFunctionName("Set(Vector3, Vector3, Vector3)");

        Vector3 v1(2.0f, 3.0f, 4.0f);
        Vector3 v2(5.0f, 6.0f, 7.0f);
        Vector3 v3(8.0f, 9.0f, 10.0f);

        Matrix33 m;
        m.Set(v1,v2,v3);

        Validate(
            m.GetElem(0) == float_test_type( 2.0f) &&
            m.GetElem(1) == float_test_type( 3.0f) &&
            m.GetElem(2) == float_test_type( 4.0f) &&
            m.GetElem(3) == float_test_type( 5.0f) &&
            m.GetElem(4) == float_test_type( 6.0f) &&
            m.GetElem(5) == float_test_type( 7.0f) &&
            m.GetElem(6) == float_test_type( 8.0f) &&
            m.GetElem(7) == float_test_type( 9.0f) &&
            m.GetElem(8) == float_test_type(10.0f)
        );

      ]]>
      </TEST>


      <TEST NAME="test10">
      <![CDATA[

        SetFunctionName("GetElem(int i)");

        Matrix33 m;
        m.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);

        Validate(
            m.GetElem(0) == float_test_type( 2.0f) &&
            m.GetElem(1) == float_test_type( 3.0f) &&
            m.GetElem(2) == float_test_type( 4.0f) &&
            m.GetElem(3) == float_test_type( 5.0f) &&
            m.GetElem(4) == float_test_type( 6.0f) &&
            m.GetElem(5) == float_test_type( 7.0f) &&
            m.GetElem(6) == float_test_type( 8.0f) &&
            m.GetElem(7) == float_test_type( 9.0f) &&
            m.GetElem(8) == float_test_type(10.0f)
            );

      ]]>
      </TEST>


      <TEST NAME="test11">
      <![CDATA[

        SetFunctionName("GetElem(int i) const");

        Matrix33 m;
        m.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);

        Validate(
            ((const Matrix33*)(&m))->GetElem(0) == float_test_type( 2.0f) &&
            ((const Matrix33*)(&m))->GetElem(1) == float_test_type( 3.0f) &&
            ((const Matrix33*)(&m))->GetElem(2) == float_test_type( 4.0f) &&
            ((const Matrix33*)(&m))->GetElem(3) == float_test_type( 5.0f) &&
            ((const Matrix33*)(&m))->GetElem(4) == float_test_type( 6.0f) &&
            ((const Matrix33*)(&m))->GetElem(5) == float_test_type( 7.0f) &&
            ((const Matrix33*)(&m))->GetElem(6) == float_test_type( 8.0f) &&
            ((const Matrix33*)(&m))->GetElem(7) == float_test_type( 9.0f) &&
            ((const Matrix33*)(&m))->GetElem(8) == float_test_type(10.0f)
            );

      ]]>
      </TEST>


      <TEST NAME="test12">
      <![CDATA[

        SetFunctionName("GetElem(int row, int column)");

        Matrix33 m;
        m.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);

        Validate(
            m.GetElem(0, 0) == float_test_type( 2.0f) &&
            m.GetElem(0, 1) == float_test_type( 3.0f) &&
            m.GetElem(0, 2) == float_test_type( 4.0f) &&
            m.GetElem(1, 0) == float_test_type( 5.0f) &&
            m.GetElem(1, 1) == float_test_type( 6.0f) &&
            m.GetElem(1, 2) == float_test_type( 7.0f) &&
            m.GetElem(2, 0) == float_test_type( 8.0f) &&
            m.GetElem(2, 1) == float_test_type( 9.0f) &&
            m.GetElem(2, 2) == float_test_type(10.0f)
            );

      ]]>
      </TEST>


      <TEST NAME="test13">
      <![CDATA[

        SetFunctionName("GetElem(int row, int column) const");

        Matrix33 m;
        m.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);

        Validate(
            ((const Matrix33*)(&m))->GetElem(0, 0) == float_test_type( 2.0f) &&
            ((const Matrix33*)(&m))->GetElem(0, 1) == float_test_type( 3.0f) &&
            ((const Matrix33*)(&m))->GetElem(0, 2) == float_test_type( 4.0f) &&
            ((const Matrix33*)(&m))->GetElem(1, 0) == float_test_type( 5.0f) &&
            ((const Matrix33*)(&m))->GetElem(1, 1) == float_test_type( 6.0f) &&
            ((const Matrix33*)(&m))->GetElem(1, 2) == float_test_type( 7.0f) &&
            ((const Matrix33*)(&m))->GetElem(2, 0) == float_test_type( 8.0f) &&
            ((const Matrix33*)(&m))->GetElem(2, 1) == float_test_type( 9.0f) &&
            ((const Matrix33*)(&m))->GetElem(2, 2) == float_test_type(10.0f)
            );

      ]]>
      </TEST>


      <TEST NAME="test14">
      <![CDATA[

        SetFunctionName("operator () (int row, int column)");

        Matrix33 m;
        m.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);

        Validate(
            m.operator()(0, 0) == float_test_type( 2.0f) &&
            m.operator()(0, 1) == float_test_type( 3.0f) &&
            m.operator()(0, 2) == float_test_type( 4.0f) &&
            m.operator()(1, 0) == float_test_type( 5.0f) &&
            m.operator()(1, 1) == float_test_type( 6.0f) &&
            m.operator()(1, 2) == float_test_type( 7.0f) &&
            m.operator()(2, 0) == float_test_type( 8.0f) &&
            m.operator()(2, 1) == float_test_type( 9.0f) &&
            m.operator()(2, 2) == float_test_type(10.0f)
            );

      ]]>
      </TEST>


      <TEST NAME="test15">
      <![CDATA[

        SetFunctionName("operator () (int row, int column) const");

        Matrix33 m;
        m.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);

        Validate(
            ((const Matrix33*)(&m))->operator()(0, 0) == float_test_type( 2.0f) &&
            ((const Matrix33*)(&m))->operator()(0, 1) == float_test_type( 3.0f) &&
            ((const Matrix33*)(&m))->operator()(0, 2) == float_test_type( 4.0f) &&
            ((const Matrix33*)(&m))->operator()(1, 0) == float_test_type( 5.0f) &&
            ((const Matrix33*)(&m))->operator()(1, 1) == float_test_type( 6.0f) &&
            ((const Matrix33*)(&m))->operator()(1, 2) == float_test_type( 7.0f) &&
            ((const Matrix33*)(&m))->operator()(2, 0) == float_test_type( 8.0f) &&
            ((const Matrix33*)(&m))->operator()(2, 1) == float_test_type( 9.0f) &&
            ((const Matrix33*)(&m))->operator()(2, 2) == float_test_type(10.0f)
            );

      ]]>
      </TEST>


      <TEST NAME="test16">
      <![CDATA[

        SetFunctionName("GetRow(int row)");

        Matrix33 m(
            1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f
            );
        Vector3 &r = m.GetRow(0);

        float_basic_type rf = 1.0f;
        Validate( r == Vector3(rf, rf, rf));

      ]]>
      </TEST>


      <TEST NAME="test17">
      <![CDATA[

        SetFunctionName("GetRow(int row) const");

        Matrix33 m(
            1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f
            );
        const Vector3 &r = m.GetRow(0);

        float_basic_type rf = 1.0f;
        Validate( r == Vector3(rf, rf, rf));

      ]]>
      </TEST>


      <TEST NAME="test18">
      <![CDATA[

        SetFunctionName("XAxis()");

        Matrix33 m(
            1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f
            );
        Vector3 &r = m.XAxis();

        float_basic_type rf = 1.0f;
        Validate( r == Vector3(rf, rf, rf));

      ]]>
      </TEST>


      <TEST NAME="test19">
      <![CDATA[

        SetFunctionName("YAxis()");

        Matrix33 m(
            1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f
            );
        Vector3 &r = m.YAxis();

        float_basic_type rf = 2.0f;
        Validate( r == Vector3(rf, rf, rf));

      ]]>
      </TEST>


      <TEST NAME="test20">
      <![CDATA[

        SetFunctionName("ZAxis()");

        Matrix33 m(
            1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f
            );
        Vector3 &r = m.ZAxis();

        float_basic_type rf = 3.0f;
        Validate( r == Vector3(rf, rf, rf));

      ]]>
      </TEST>


      <TEST NAME="test21">
      <![CDATA[

        SetFunctionName("XAxis() const");

        const Matrix33 m(
            1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f
            );
        const Vector3 &r = m.XAxis();

        float_basic_type rf = 1.0f;
        Validate( r == Vector3(rf, rf, rf));

      ]]>
      </TEST>


      <TEST NAME="test22">
      <![CDATA[

        SetFunctionName("YAxis() const");

        const Matrix33 m(
            1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f
            );
        const Vector3 &r = m.YAxis();

        float_basic_type rf = 2.0f;
        Validate( r == Vector3(rf, rf, rf));

      ]]>
      </TEST>


      <TEST NAME="test23">
      <![CDATA[

        SetFunctionName("ZAxis() const");

        const Matrix33 m(
            1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f
            );
        const Vector3 &r = m.ZAxis();

        float_basic_type rf = 3.0f;
        Validate( r == Vector3(rf, rf, rf));

      ]]>
      </TEST>


      <TEST NAME="test24">
      <![CDATA[

        SetFunctionName("SetElem(int i, FloatType f)");

        Matrix33 m(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);
        m.SetElem(2, 4.4f);

        Validate(
          m.GetElem(0) == float_test_type( 2.0f) &&
          m.GetElem(1) == float_test_type( 3.0f) &&
          m.GetElem(2) == float_test_type( 4.4f) &&
          m.GetElem(3) == float_test_type( 5.0f) &&
          m.GetElem(4) == float_test_type( 6.0f) &&
          m.GetElem(5) == float_test_type( 7.0f) &&
          m.GetElem(6) == float_test_type( 8.0f) &&
          m.GetElem(7) == float_test_type( 9.0f) &&
          m.GetElem(8) == float_test_type(10.0f)
        );

      ]]>
      </TEST>


      <TEST NAME="test25">
      <![CDATA[

        SetFunctionName("SetElem(int row, int column, FloatType f)");

        Matrix33 m(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);
        m.SetElem(2, 2, 0.1f);

        Validate(
          m.GetElem(0, 0) == float_test_type( 2.0f) &&
          m.GetElem(0, 1) == float_test_type( 3.0f) &&
          m.GetElem(0, 2) == float_test_type( 4.0f) &&
          m.GetElem(1, 0) == float_test_type( 5.0f) &&
          m.GetElem(1, 1) == float_test_type( 6.0f) &&
          m.GetElem(1, 2) == float_test_type( 7.0f) &&
          m.GetElem(2, 0) == float_test_type( 8.0f) &&
          m.GetElem(2, 1) == float_test_type( 9.0f) &&
          m.GetElem(2, 2) == float_test_type( 0.1f)
        );

      ]]>
      </TEST>


      <TEST NAME="test26">
      <![CDATA[

        SetFunctionName("SetRow(int row, Vector3 v)");

        Matrix33 m(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);

        Vector3 v(0.4f,0.4f,0.4f);
        m.SetRow(1, v);

        Validate(
          m.GetElem(0, 0) == float_test_type( 2.0f) &&
          m.GetElem(0, 1) == float_test_type( 3.0f) &&
          m.GetElem(0, 2) == float_test_type( 4.0f) &&
          m.GetElem(1, 0) == float_test_type( 0.4f) &&
          m.GetElem(1, 1) == float_test_type( 0.4f) &&
          m.GetElem(1, 2) == float_test_type( 0.4f) &&
          m.GetElem(2, 0) == float_test_type( 8.0f) &&
          m.GetElem(2, 1) == float_test_type( 9.0f) &&
          m.GetElem(2, 2) == float_test_type(10.0f)
        );

      ]]>
      </TEST>


      <TEST NAME="test27">
      <![CDATA[

        SetFunctionName("XAxis() = vector3");

        Matrix33 m(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);

        Vector3 v(0.1f,0.1f,0.1f);
        m.XAxis() = v;

        Validate(
          m.GetElem(0, 0) == float_test_type( 0.1f) &&
          m.GetElem(0, 1) == float_test_type( 0.1f) &&
          m.GetElem(0, 2) == float_test_type( 0.1f) &&
          m.GetElem(1, 0) == float_test_type( 5.0f) &&
          m.GetElem(1, 1) == float_test_type( 6.0f) &&
          m.GetElem(1, 2) == float_test_type( 7.0f) &&
          m.GetElem(2, 0) == float_test_type( 8.0f) &&
          m.GetElem(2, 1) == float_test_type( 9.0f) &&
          m.GetElem(2, 2) == float_test_type(10.0f)
        );

      ]]>
      </TEST>


      <TEST NAME="test28">
      <![CDATA[

        SetFunctionName("YAxis() = vector3");

        Matrix33 m(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);

        Vector3 v(0.4f,0.4f,0.4f);
        m.YAxis() = v;

        Validate(
          m.GetElem(0, 0) == float_test_type( 2.0f) &&
          m.GetElem(0, 1) == float_test_type( 3.0f) &&
          m.GetElem(0, 2) == float_test_type( 4.0f) &&
          m.GetElem(1, 0) == float_test_type( 0.4f) &&
          m.GetElem(1, 1) == float_test_type( 0.4f) &&
          m.GetElem(1, 2) == float_test_type( 0.4f) &&
          m.GetElem(2, 0) == float_test_type( 8.0f) &&
          m.GetElem(2, 1) == float_test_type( 9.0f) &&
          m.GetElem(2, 2) == float_test_type(10.0f)
        );

      ]]>
      </TEST>


      <TEST NAME="test29">
      <![CDATA[

        SetFunctionName("ZAxis()  = vector3");

        Matrix33 m(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);

        Vector3 v(0.4f,0.4f,0.4f);
        m.ZAxis() = v;

        Validate(
          m.GetElem(0, 0) == float_test_type( 2.0f) &&
          m.GetElem(0, 1) == float_test_type( 3.0f) &&
          m.GetElem(0, 2) == float_test_type( 4.0f) &&
          m.GetElem(1, 0) == float_test_type( 5.0f) &&
          m.GetElem(1, 1) == float_test_type( 6.0f) &&
          m.GetElem(1, 2) == float_test_type( 7.0f) &&
          m.GetElem(2, 0) == float_test_type( 0.4f) &&
          m.GetElem(2, 1) == float_test_type( 0.4f) &&
          m.GetElem(2, 2) == float_test_type( 0.4f)
        );

      ]]>
      </TEST>


      <TEST NAME="test30">
      <![CDATA[

#ifdef HOST_TESTING

        SetFunctionName("SetElem(int i, VecFloatRefIndex::InParam f)");

        Matrix33 m(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);
        MakeVectorIntrinsic(vi, 0.1f, 0.2f, 0.3f, 0.4f);
        m.SetElem(0,VecFloatRefIndex(vi,1));

        Validate(
          m.GetElem(0, 0) == float_test_type( 0.2f) &&
          m.GetElem(0, 1) == float_test_type( 3.0f) &&
          m.GetElem(0, 2) == float_test_type( 4.0f) &&
          m.GetElem(1, 0) == float_test_type( 5.0f) &&
          m.GetElem(1, 1) == float_test_type( 6.0f) &&
          m.GetElem(1, 2) == float_test_type( 7.0f) &&
          m.GetElem(2, 0) == float_test_type( 8.0f) &&
          m.GetElem(2, 1) == float_test_type( 9.0f) &&
          m.GetElem(2, 2) == float_test_type(10.0f)
        );

#endif

      ]]>
      </TEST>


      <TEST NAME="test31">
      <![CDATA[

#ifdef HOST_TESTING

        SetFunctionName("SetElem(int i, VecFloatRef<XSRC_INDEX> f)");

        Matrix33 m(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);
        MakeVectorIntrinsic(vi, 0.1f, 0.2f, 0.3f, 0.4f);
        m.SetElem(0,VecFloatRefY(vi));

        Validate(
          m.GetElem(0, 0) == float_test_type( 0.2f) &&
          m.GetElem(0, 1) == float_test_type( 3.0f) &&
          m.GetElem(0, 2) == float_test_type( 4.0f) &&
          m.GetElem(1, 0) == float_test_type( 5.0f) &&
          m.GetElem(1, 1) == float_test_type( 6.0f) &&
          m.GetElem(1, 2) == float_test_type( 7.0f) &&
          m.GetElem(2, 0) == float_test_type( 8.0f) &&
          m.GetElem(2, 1) == float_test_type( 9.0f) &&
          m.GetElem(2, 2) == float_test_type(10.0f)
        );

#endif

      ]]>
      </TEST>


      <TEST NAME="test32">
      <![CDATA[

#ifdef HOST_TESTING

        SetFunctionName("SetElem(int row, int col, VecFloatRefIndex::InParam f)");

        Matrix33 m(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);
            MakeVectorIntrinsic(vi, 0.1f, 0.2f, 0.3f, 0.4f);
        m.SetElem(0,0,VecFloatRefIndex(vi,1));

        Validate(
            m.GetElem(0, 0) == float_test_type( 0.2f) &&
            m.GetElem(0, 1) == float_test_type( 3.0f) &&
            m.GetElem(0, 2) == float_test_type( 4.0f) &&
            m.GetElem(1, 0) == float_test_type( 5.0f) &&
            m.GetElem(1, 1) == float_test_type( 6.0f) &&
            m.GetElem(1, 2) == float_test_type( 7.0f) &&
            m.GetElem(2, 0) == float_test_type( 8.0f) &&
            m.GetElem(2, 1) == float_test_type( 9.0f) &&
            m.GetElem(2, 2) == float_test_type(10.0f)
            );

#endif

      ]]>
      </TEST>


      <TEST NAME="test33">
      <![CDATA[

#ifdef HOST_TESTING

        SetFunctionName("SetElem(int row, int col, VecFloatRef<XSRC_INDEX> f)");

        Matrix33 m(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);
            MakeVectorIntrinsic(vi, 0.1f, 0.2f, 0.3f, 0.4f);
        m.SetElem(0,0,VecFloatRefY(vi));

        Validate(
            m.GetElem(0, 0) == float_test_type( 0.2f) &&
            m.GetElem(0, 1) == float_test_type( 3.0f) &&
            m.GetElem(0, 2) == float_test_type( 4.0f) &&
            m.GetElem(1, 0) == float_test_type( 5.0f) &&
            m.GetElem(1, 1) == float_test_type( 6.0f) &&
            m.GetElem(1, 2) == float_test_type( 7.0f) &&
            m.GetElem(2, 0) == float_test_type( 8.0f) &&
            m.GetElem(2, 1) == float_test_type( 9.0f) &&
            m.GetElem(2, 2) == float_test_type(10.0f)
            );


#endif

      ]]>
      </TEST>

      <TEST NAME="Right">
      <![CDATA[

        SetFunctionName("Right()");

        Matrix33 m(
            1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f
            );
        Vector3 &r = m.Right();

        float_basic_type rf = 1.0f;
        Validate( r == Vector3(rf, rf, rf));

      ]]>
      </TEST>


      <TEST NAME="Up">
      <![CDATA[

        SetFunctionName("Up()");

        Matrix33 m(
            1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f
            );
        Vector3 &r = m.Up();

        float_basic_type rf = 2.0f;
        Validate( r == Vector3(rf, rf, rf));

      ]]>
      </TEST>


      <TEST NAME="At">
      <![CDATA[

        SetFunctionName("At()");

        Matrix33 m(
            1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f
            );
        Vector3 &r = m.At();

        float_basic_type rf = 3.0f;
        Validate( r == Vector3(rf, rf, rf));

      ]]>
      </TEST>


      <TEST NAME="RightConst">
      <![CDATA[

        SetFunctionName("Right() const");

        const Matrix33 m(
            1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f
            );
        const Vector3 &r = m.Right();

        float_basic_type rf = 1.0f;
        Validate( r == Vector3(rf, rf, rf));

      ]]>
      </TEST>


      <TEST NAME="UpConst">
      <![CDATA[

        SetFunctionName("Up() const");

        const Matrix33 m(
            1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f
            );
        const Vector3 &r = m.Up();

        float_basic_type rf = 2.0f;
        Validate( r == Vector3(rf, rf, rf));

      ]]>
      </TEST>


      <TEST NAME="AtConst">
      <![CDATA[

        SetFunctionName("At() const");

        const Matrix33 m(
            1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f
            );
        const Vector3 &r = m.At();

        float_basic_type rf = 3.0f;
        Validate( r == Vector3(rf, rf, rf));

      ]]>
      </TEST>


      <TEST NAME="RightVector3">
      <![CDATA[

        SetFunctionName("Right() = vector3");

        Matrix33 m(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);

        Vector3 v(0.1f,0.1f,0.1f);
        m.Right() = v;

        Validate(
            m.GetElem(0, 0) == float_test_type( 0.1f) &&
            m.GetElem(0, 1) == float_test_type( 0.1f) &&
            m.GetElem(0, 2) == float_test_type( 0.1f) &&
            m.GetElem(1, 0) == float_test_type( 5.0f) &&
            m.GetElem(1, 1) == float_test_type( 6.0f) &&
            m.GetElem(1, 2) == float_test_type( 7.0f) &&
            m.GetElem(2, 0) == float_test_type( 8.0f) &&
            m.GetElem(2, 1) == float_test_type( 9.0f) &&
            m.GetElem(2, 2) == float_test_type(10.0f)
            );

      ]]>
      </TEST>


      <TEST NAME="UpVector3">
      <![CDATA[

        SetFunctionName("Up() = vector3");

        Matrix33 m(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);

        Vector3 v(0.4f,0.4f,0.4f);
        m.Up() = v;

        Validate(
            m.GetElem(0, 0) == float_test_type( 2.0f) &&
            m.GetElem(0, 1) == float_test_type( 3.0f) &&
            m.GetElem(0, 2) == float_test_type( 4.0f) &&
            m.GetElem(1, 0) == float_test_type( 0.4f) &&
            m.GetElem(1, 1) == float_test_type( 0.4f) &&
            m.GetElem(1, 2) == float_test_type( 0.4f) &&
            m.GetElem(2, 0) == float_test_type( 8.0f) &&
            m.GetElem(2, 1) == float_test_type( 9.0f) &&
            m.GetElem(2, 2) == float_test_type(10.0f)
            );

      ]]>
      </TEST>


      <TEST NAME="AtVector3">
      <![CDATA[

        SetFunctionName("At()  = vector3");

        Matrix33 m(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);

        Vector3 v(0.4f,0.4f,0.4f);
        m.At() = v;

        Validate(
            m.GetElem(0, 0) == float_test_type( 2.0f) &&
            m.GetElem(0, 1) == float_test_type( 3.0f) &&
            m.GetElem(0, 2) == float_test_type( 4.0f) &&
            m.GetElem(1, 0) == float_test_type( 5.0f) &&
            m.GetElem(1, 1) == float_test_type( 6.0f) &&
            m.GetElem(1, 2) == float_test_type( 7.0f) &&
            m.GetElem(2, 0) == float_test_type( 0.4f) &&
            m.GetElem(2, 1) == float_test_type( 0.4f) &&
            m.GetElem(2, 2) == float_test_type( 0.4f)
            );

      ]]>
      </TEST>

      <TEST NAME="select_maskscalar">
      <![CDATA[
      
        SetFunctionName("Matrix33 Select(MaskScalar mask, Matrix33 a, Matrix33 b)");
        Matrix33 m1(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);
        Matrix33 m2((float_test_type)2.0f * m1);

        Matrix33 result1 = Select( MaskScalar(true), m1, m2 );
        Matrix33 result2 = Select( MaskScalar(false), m1, m2 );
        Validate(
            result1 == m1 &&
            result2 == m2
        );

      ]]>
      </TEST>

    </TYPE>

    <TYPE NAME="performance">

      <TEST NAME="test34">
      <![CDATA[

        SetFunctionName("SetZero()");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                m33_array[i].SetZero();
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test35">
      <![CDATA[

        SetFunctionName("SetIdentity()");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                m33_array[i].SetIdentity();
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test36">
      <![CDATA[

        SetFunctionName("Set(float m0, float m1, float m2, float m3, float m4, float m5, float m6, float m7, float m8)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                m33_array[i].Set(x_array[i], y_array[i], z_array[i], x_array[i], y_array[i], z_array[i], x_array[i], y_array[i], z_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test37">
      <![CDATA[

        SetFunctionName("GetElem(int i)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                retValueFloat = m33_array[i].GetElem(0);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test38">
      <![CDATA[

        SetFunctionName("GetElem(int i) const");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                retValueFloat = ((const Matrix33*)&(m33_array[i]))->GetElem(0);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test39">
      <![CDATA[

        SetFunctionName("GetElem(int row, int column)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                retValueFloat = m33_array[i].GetElem(0, 0);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test40">
      <![CDATA[

        SetFunctionName("GetElem(int row, int column)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                retValueFloat = ((const Matrix33*)&(m33_array[i]))->GetElem(0, 0);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test41">
      <![CDATA[

        SetFunctionName("operator()(int row, int column)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                retValueFloat = m33_array[i].operator()(0, 0);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test42">
      <![CDATA[

        SetFunctionName("operator()(int row, int column) const");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                retValueFloat = ((const Matrix33*)&(m33_array[i]))->operator()(0, 0);
            }
        }

        StopTimer();

      ]]>
      </TEST>

    </TYPE>

  </TYPE>

  <TYPE NAME="function">

    <TYPE NAME="correctness">

      <TEST NAME="test43">
      <![CDATA[

        SetFunctionName("Negate(const Matrix33 &m)");

        Matrix33 m, r, ref;
        m.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        r = Negate(m);

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = -(m.GetElem(i));
        }

        Validate(IsSimilar(r, ref));

      ]]>
      </TEST>


      <TEST NAME="test44">
      <![CDATA[

        SetFunctionName("Mult(const Matrix33 &m, const float_t a)");

        Matrix33 m, r, ref;
        m.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        float_basic_type  s = 2.0f;
        r = Mult(m, s);

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = m.GetElem(i) * (float_test_type)s;
        }

        Validate(IsSimilar(r, ref));

      ]]>
      </TEST>


      <TEST NAME="test45">
      <![CDATA[

        SetFunctionName("Divide(const Matrix33 &m, const float_t a)");

        Matrix33 m, r, ref;
        m.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        float_basic_type s = 2.0f;
        r = Divide(m, s);

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = m.GetElem(i) / (float_test_type)s;
        }

        Validate(IsSimilar(r, ref));

      ]]>
      </TEST>


      <TEST NAME="test46">
      <![CDATA[

        SetFunctionName("Add(const Matrix33 &a, const Matrix33 &b)");

        Matrix33 a, b, r, ref;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        b.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);
        r = Add(a, b);

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = a.GetElem(i) + b.GetElem(i);
        }
        Validate(IsSimilar(r, ref));

      ]]>
      </TEST>


      <TEST NAME="test47">
      <![CDATA[

        SetFunctionName("Subtract(const Matrix33 &a, const Matrix33 &b)");

        Matrix33 a, b, r, ref;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        b.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);
        r = Subtract(a, b);

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = a.GetElem(i) - b.GetElem(i);
        }
        Validate(IsSimilar(r, ref));

      ]]>
      </TEST>


      <TEST NAME="test48">
      <![CDATA[

        SetFunctionName("SelfAdd(Matrix33 &a, const Matrix33 &b)");

        Matrix33 a, b, r, ref;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        b.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);
        r = a;
        SelfAdd(r, b);

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = a.GetElem(i) + b.GetElem(i);
        }
        Validate(IsSimilar(r, ref));

      ]]>
      </TEST>


      <TEST NAME="test49">
      <![CDATA[

        SetFunctionName("SelfSubtract(Matrix33 &a, const Matrix33 &b)");

        Matrix33 a, b, r, ref;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        b.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);
        r = a;
        SelfSubtract(r, b);

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = a.GetElem(i) - b.GetElem(i);
        }
        Validate(IsSimilar(r, ref));

      ]]>
      </TEST>


      <TEST NAME="test50">
      <![CDATA[

        SetFunctionName("SelfMult(Matrix33 &m, const float_t a)");

        Matrix33 a, r, ref;
        float_basic_type s = 2.0f;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        r = a;
        SelfMult(r, s);

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = a.GetElem(i) * (float_test_type)s;
        }
        Validate(IsSimilar(r, ref));

      ]]>
      </TEST>


      <TEST NAME="test51">
      <![CDATA[

#ifdef HOST_TESTING

        SetFunctionName("SelfMult(Matrix33 &m, VecFloatRef<INDEX> a)");

        Matrix33 a, r, ref;
        float_basic_type s = 2.0f;
        Vector3 svec(s,s,s);
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        r = a;
        SelfMult( r, svec.X() );

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = a.GetElem(i) * (float_test_type)s;
        }
        Validate(IsSimilar(r, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test52">
      <![CDATA[

#ifdef HOST_TESTING

        SetFunctionName("SelfMult(Matrix33 &m, VecFloatRefIndex a)");

        Matrix33 a, r, ref;
        float_basic_type s = 2.0f;
        Vector3 svec(s,s,s);
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        r = a;
        SelfMult( r, svec.GetComponent(0) );

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = a.GetElem(i) * (float_test_type)s;
        }
        Validate(IsSimilar(r, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test53">
      <![CDATA[

#ifdef HOST_TESTING

        SetFunctionName("Mult(const Matrix33 &m, VecFloatRef)");

        Matrix33 m, r, ref;
        m.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        float_basic_type s = 2.0f;
            MakeVectorIntrinsic(vi, s, s, s, s);

        r = Mult(m, VecFloatRefY(vi));

        for (int i = 0; i < 9; i++)
        {
                ref.GetElem(i) = m.GetElem(i) * (float_test_type)s;
        }

        Validate(IsSimilar(r, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test54">
      <![CDATA[

#ifdef HOST_TESTING

        SetFunctionName("Mult(const Matrix33 &m, VecFloatRefIndex)");

        Matrix33 m, r, ref;
        m.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        float_basic_type s = 2.0f;
            MakeVectorIntrinsic(vi, s, s, s, s);

        r = Mult(m, VecFloatRefIndex(vi, 2));

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = m.GetElem(i) * (float_test_type)s;
        }

        Validate(IsSimilar(r, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test55">
      <![CDATA[

        SetFunctionName("SelfDivide(Matrix33 &m, const float_t a)");

        Matrix33 a, r, ref;
        float_basic_type s = 2.0f;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        r = a;
        SelfDivide(r, s);

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = a.GetElem(i) / (float_test_type)s;
        }
        Validate(IsSimilar(r, ref));

      ]]>
      </TEST>


      <TEST NAME="test56">
      <![CDATA[

#ifdef HOST_TESTING

        SetFunctionName("SelfDivide(Matrix33 &m, VecFloatRef<INDEX> a)");

        Matrix33 a, r, ref;
        float_basic_type s = 2.0f;
        Vector3 svec(s,s,s);
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        r = a;
        SelfDivide(r, svec.X());

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = a.GetElem(i) / (float_test_type)s;
        }
        Validate(IsSimilar(r, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test57">
      <![CDATA[

#ifdef HOST_TESTING

        SetFunctionName("SelfDivide(Matrix33 &m, VecFloatRefIndex a)");

        Matrix33 a, r, ref;
        float_basic_type s = 2.0f;
        Vector3 svec(s,s,s);
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        r = a;
        SelfDivide(r, svec.GetComponent(0));

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = a.GetElem(i) / (float_test_type)s;
        }
        Validate(IsSimilar(r, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test58">
      <![CDATA[

#ifdef HOST_TESTING

        SetFunctionName("Divide(const Matrix33 &m, VecFloatRef)");

        Matrix33 m, r, ref;
        m.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        float_basic_type s = 2.0f;
            MakeVectorIntrinsic(vi, s, s, s, s);

        r = Divide(m, VecFloatRefY(vi));

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = m.GetElem(i) / (float_test_type)s;
        }

        Validate(IsSimilar(r, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test59">
      <![CDATA[

#ifdef HOST_TESTING

        SetFunctionName("Divide(const Matrix33 &m, VecFloatRefIndex)");

        Matrix33 m, r, ref;
        m.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        float_basic_type s = 2.0f;
            MakeVectorIntrinsic(vi, s, s, s, s);

        r = Divide(m, VecFloatRefIndex(vi, 2));

        for (int i = 0; i < 9; i++)
        {
                ref.GetElem(i) = m.GetElem(i) / (float_test_type)s;
        }

        Validate(IsSimilar(r, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test60">
      <![CDATA[

        SetFunctionName("Mult(const Vector3 &v, const Matrix33 &m)");

        Matrix33 m;
        Vector3 v3, r, ra;
        v3.Set(6.0f, -1.0f, -3.0f);
        m.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        r = Mult(v3, m); // test with non-aliasing

        ra.Set(6.0f, -1.0f, -3.0f);
        ra = Mult(ra, m);  // test with aliasing

        Vector3 ref(
                  m.GetElem(0, 0) * v3.X() + m.GetElem(1, 0) * v3.Y() + m.GetElem(2, 0) * v3.Z(),
                  m.GetElem(0, 1) * v3.X() + m.GetElem(1, 1) * v3.Y() + m.GetElem(2, 1) * v3.Z(),
                  m.GetElem(0, 2) * v3.X() + m.GetElem(1, 2) * v3.Y() + m.GetElem(2, 2) * v3.Z());

        Validate(IsSimilar(r, ref) && IsSimilar(ra, ref));

      ]]>
      </TEST>


      <TEST NAME="test61">
      <![CDATA[

        SetFunctionName("Mult(const Matrix33 &a, const Matrix33 &b)");

        Matrix33 a, b, r, ref;

        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        b.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);


        r = Mult(a, b);

        for (int32_t i = 0; i < 3; ++i)
        {
            ref.SetElem(i, 0, a.GetElem(i, 0) * b.GetElem(0, 0) + a.GetElem(i, 1) * b.GetElem(1, 0) + a.GetElem(i, 2) * b.GetElem(2, 0) );
            ref.SetElem(i, 1, a.GetElem(i, 0) * b.GetElem(0, 1) + a.GetElem(i, 1) * b.GetElem(1, 1) + a.GetElem(i, 2) * b.GetElem(2, 1) );
            ref.SetElem(i, 2, a.GetElem(i, 0) * b.GetElem(0, 2) + a.GetElem(i, 1) * b.GetElem(1, 2) + a.GetElem(i, 2) * b.GetElem(2, 2) );
        }

        Validate(IsSimilar(r, ref));

      ]]>
      </TEST>


      <TEST NAME="test62">
      <![CDATA[

        SetFunctionName("Determinant(const Matrix33 &m)");

        Matrix33 m;

        m.Set(
            1, 2, 0,
            -1, 1, 1,
            1, 2, 3
            );

        float_basic_type r = Determinant(m);

        Validate(IsEqualWithEpsilon(r, (float_basic_type) 9.0f));

      ]]>
      </TEST>


      <TEST NAME="test63">
      <![CDATA[

        SetFunctionName("Determinant(const Matrix33 &m)");

        Matrix33 m;

        m.Set(
            1, 2, 0,
            -1, 1, 1,
            -4, 4, 4
            );

        float_basic_type r = Determinant(m);

        Validate(IsEqualWithEpsilon(r, (float_basic_type) 0.0f));

      ]]>
      </TEST>


      <TEST NAME="test64">
      <![CDATA[

        SetFunctionName("Transpose(const Matrix33 &m)");

        Matrix33 m, r, ref;

        m.Set(
            1, 2, 3,
            4, 5, 6,
            7, 8, 9
             );
        ref.Set(
            1, 4, 7,
            2, 5, 8,
            3, 6, 9
            );

        r = Transpose(m);

        Validate(IsSimilar(r, ref));

      ]]>
      </TEST>


      <TEST NAME="test65">
      <![CDATA[

        SetFunctionName("OrthoNormalize(m)");
        Matrix33 initialMat(
             0.0683740f,   0.7263507f,   0.2320748f,
             0.5608486f,   0.1985144f,   0.2312237f,
             0.6623569f,   0.5442573f,   0.2164633f
            );

        Matrix33 r = OrthoNormalize(initialMat);
        bool isOrtho = IsOrthogonal(r, (float_basic_type) 0.01f);
        bool isNormal = IsNormal(r, (float_basic_type) 0.01f);

        Matrix33 mat2 = Matrix33FromEulerXYZ(Vector3(1.0f, 2.0f, 3.0f));
        Matrix33 r2 = OrthoNormalize(mat2);

        Validate( isOrtho && isNormal &&
                  IsOrthogonal(r2) && IsNormal(r2) && IsSimilar(mat2, r2) );

      ]]>
      </TEST>


      <TEST NAME="test66">
      <![CDATA[

        SetFunctionName("InverseOrthonormal(m)");
        Matrix33 initialMat = OrthoNormalize(Matrix33(
             0.0683740f,   0.7263507f,   0.2320748f,
             0.5608486f,   0.1985144f,   0.2312237f,
             0.6623569f,   0.5442573f,   0.2164633f
            ));
        Matrix33 productRef(
            1.0f, 0.0f, 0.0f,
            0.0f, 1.0f, 0.0f,
            0.0f, 0.0f, 1.0f
            );

        Matrix33 r = InverseOrthonormal(initialMat);
        Matrix33 product = Mult(r, initialMat);
        Validate( IsSimilar(product, productRef) );

      ]]>
      </TEST>


      <TEST NAME="test67">
      <![CDATA[

        SetFunctionName("InverseOrthonormal(m)");
        Matrix33 initialMat = OrthoNormalize(Matrix33(
             0.0683740f,   0.7263507f,   0.2320748f,
             0.0683740f,   0.7263507f,   0.2320748f,
             0.6623569f,   0.5442573f,   0.2164633f
            ));
        Matrix33 productRef(
            1.0f, 0.0f, 0.0f,
            0.0f, 1.0f, 0.0f,
            0.0f, 0.0f, 1.0f
            );

        Matrix33 r = InverseOrthonormal(initialMat);
        Matrix33 product = Mult(r, initialMat);
        Validate( IsSimilar(product, productRef) );

      ]]>
      </TEST>


      <TEST NAME="test68">
      <![CDATA[

        SetFunctionName("Inverse(const Matrix33 &m)");

        Matrix33 m, r, ref;

        m.Set(
            1, 2, 0,
            -1, 1, 1,
            1, 2, 3
            );

        ref.Set(
            1.0f/9.0f, -6.0f/9.0f,  2.0f/9.0f,
            4.0f/9.0f,  3.0f/9.0f, -1.0f/9.0f,
            -3.0f/9.0f,          0,  3.0f/9.0f
            );

        r = Inverse(m);

        Validate(IsSimilar(r, ref));

      ]]>
      </TEST>


      <TEST NAME="test69">
      <![CDATA[

        SetFunctionName("Inverse(const Matrix33 &m, &determinant)");

        Matrix33 m, r, ref;
        float_test_type determinant;

        m.Set(
             1, 2, 0,
            -1, 1, 1,
             1, 2, 3
            );

        ref.Set(
             1.0f/9.0f, -6.0f/9.0f,  2.0f/9.0f,
             4.0f/9.0f,  3.0f/9.0f, -1.0f/9.0f,
            -3.0f/9.0f,          0,  3.0f/9.0f
            );

        r = Inverse(m, determinant);

        Validate(IsSimilar(r, ref) &&
        IsSimilar((float_test_type)determinant, (float_test_type)9.0) );

      ]]>
      </TEST>


      <TEST NAME="test70">
      <![CDATA[

        SetFunctionName("Vector3 Transform(Vector3 vec, Matrix33 matrix)");
        Matrix33 a(
            -0.8149562f,   0.5008597f,   0.2915235f,
            -0.4312790f,  -0.1881537f,  -0.8823812f,
            -0.3870979f,  -0.8448300f,   0.3693473f
            );
        Vector3 vec[3] =
        {
            Vector3( 1.0f, 2.0f, 3.0f ),
            Vector3( 3.0f, -2.0f, 1.0f ),
            Vector3( 9.0f, -2.0f, 8.0f )
        };
        Vector3 ref[3] =
        {
            Vector3(-2.83880798f, -2.40993783f, -0.36519710f),
            Vector3(-1.9694085f, 1.0340564f, 3.0086801f ),
            Vector3(-9.5688305f, -1.8745952f, 7.3432522f )
        };
        Vector3 res[3];
        for( int i=0; i<3; ++i)
        {
            res[i] = Transform( vec[i], a );
        }
        Validate(   IsSimilar(res[0], ref[0]) &&
                    IsSimilar(res[1], ref[1]) &&
                    IsSimilar(res[2], ref[2]) );

      ]]>
      </TEST>


      <TEST NAME="test71">
      <![CDATA[

        SetFunctionName("IsSimilar(const Matrix33 &a, const Matrix33 &b, float_t epsilon = rw::math::kSmallFloat)");

        Matrix33 a, b, c, d, e;

        a.Set(
             1.0f,  2.0f,  0.0f,
            -1.0f,  1.0f,  1.0f,
             1.0f,  2.0f,  3.0f
            );

        b.Set(
            1.0f,  2.0f,  0.0f,
           -1.0f,  1.0f,  1.0f,
            1.0f,  2.0f,  3.0f
            );

        c.Set(
            2.0f,  2.0f,  0.0f,
           -1.0f,  1.0f,  1.0f,
            1.0f,  2.0f,  3.0f
            );

        d.Set(
            1.0f,  2.0f,  0.0f,
           -1.0f,  2.0f,  1.0f,
            1.0f,  2.0f,  3.0f
            );

        e.Set(
            1.0f,  2.0f,  0.0f,
           -1.0f,  1.0f,  1.0f,
            2.0f,  2.0f,  3.0f
            );

        bool perturbTest = true;
        for(int row=0;row<3;row++)
        {
            for(int col=0;col<3;col++)
            {
                Matrix33 testMatrix = a;
                // Perturb the matrix to make it different from a.
                testMatrix.GetElem(row, col) = testMatrix.GetElem(row, col) + (float_test_type)1.0f;
                if( IsSimilar(a,testMatrix) )
                {
                    perturbTest = false;
                    break;
                }
            }
        }

        Validate(IsSimilar(a, b) && !IsSimilar(a, c) && !IsSimilar(a, d) && !IsSimilar(a, e) && perturbTest);

      ]]>
      </TEST>


      <TEST NAME="isanynan">
      <![CDATA[


#if !defined EA_PLATFORM_PS3_SPU
        SetFunctionName("IsAnyNaN(Matrix33 v)");

        float zero = 0.0f;
        float_test_type nan = float_test_type(zero / zero);
        int numPermutations = 1 << Matrix33::NumberOfCols;
        bool result = true;
        // Doing all possible permutations of the matrix could be pretty slow. Instead,
        // all permutations along the diagonal will be done.
        for( int curPermutation=0;curPermutation<numPermutations;curPermutation++)
        {
            Matrix33 mat;
            mat.SetZero();
            for( int elem = 0; elem < Matrix33::NumberOfCols; elem++ )
            {
                if( curPermutation & (1<<elem) )
                {
                    mat.SetElem( elem, elem, nan );
                }
            }
            if( curPermutation == 0 )
            {
                // All bits are zero so the matrix has no NaN's
                result &= !IsAnyNaN(mat);
            }
            else
            {
                // At least one element is NaN.
                result &= IsAnyNaN(mat);
            }
        }
        Validate(result);
#endif

      ]]>
      </TEST>


      <TEST NAME="test72">
      <![CDATA[

// on SPU, NaN operations evaluates to 0
#if !defined EA_PLATFORM_PS3_SPU
    {

        SetFunctionName("IsValid(Matrix33 m)");

        Matrix33 a, b;

        a.Set(
             1.0f,  2.0f,  0.0f,
            -1.0f,  1.0f,  1.0f,
             1.0f,  2.0f,  3.0f
            );
        b.Set(
            1.0f,  2.0f,  0.0f,
           -1.0f,  1.0f,  1.0f,
            1.0f,  (float)testing::GetNaN(),  3.0f
            );

        Validate(IsValid(a) && !IsValid(b));
        }
#endif  
      ]]>
      </TEST>

      <TEST NAME="test73">
      <![CDATA[

        SetFunctionName("GetNormalError(Matrix33 matrix)");
        Matrix33 mat(
            1.1f, 0.0f, 0.1f,
            0.1f, 1.0f, 0.0f,
            0.0f, 0.0f, 1.0f
        );

        float_test_type r = GetNormalError(mat);

        Validate(IsSimilar(r, (float_test_type)(0.0485f)));

      ]]>
      </TEST>


      <TEST NAME="test74">
      <![CDATA[

        SetFunctionName("GetOrthogonalRowSetError(Matrix33 matrix)");
        Matrix33 mat(
            1.1f, 0.0f, 0.1f,
            0.1f, 1.0f, 0.0f,
            0.0f, 0.0f, 1.0f
        );

        float_test_type r = GetOrthogonalRowSetError(mat);

        Validate(IsSimilar(r, (float_test_type) 0.0221f));

      ]]>
      </TEST>

      <TEST NAME="test75">
      <![CDATA[

        SetFunctionName("IsNormal(Matrix33 matrix)");
        Matrix33 mat1(
            0.2672612f,    0.5345225f,    0.8017837f,
            0.0f, 1.0f, 0.0f,
            0.0f, 0.0f, 1.0f
        );
        Matrix33 mat2(
            1.0f, 0.3f, 0.0f,
            0.0f, 1.0f, 0.0f,
            0.0f, 0.0f, 1.0f
        );

        Validate(
             IsNormal(mat1, (float_test_type) 0.001f) &&
            !IsNormal(mat2, (float_test_type) 0.001f) );

      ]]>
      </TEST>


      <TEST NAME="test76">
      <![CDATA[

        SetFunctionName("IsOrthogonalRowSet(Matrix33 matrix)");

        Matrix33 mat1(
            0.2672612f,    0.5345225f,    0.8017837f,
            0.0f, 1.0f, 0.0f,
            0.0f, 0.0f, 1.0f
        );

        Matrix33 mat2(
            1.0f, 0.3f, 0.0f,
            0.0f, 1.0f, 0.0f,
            0.0f, 0.0f, 1.0f
        );

        // orthogonal row set
        Matrix33 mat3(
            -0.5097992f,  0.2732867f, -0.8157323f,
            -1.2839158f, -1.5041522f,  0.2984735f,
            -1.718125f,   1.7992397f,  1.6765389f
        );

        Validate(
            !IsOrthogonalRowSet(mat1, (float_test_type) 0.001f) &&
            !IsOrthogonalRowSet(mat2, (float_test_type) 0.001f) &&
             IsOrthogonalRowSet(mat3, (float_test_type) 0.001f) );

      ]]>
      </TEST>


      <TEST NAME="test77">
      <![CDATA[

        SetFunctionName("Matrix33FromQuaternion(const Quaternion &q)");

        Quaternion q;
        Matrix33 r, ref;

        q.Set(SQRT_HALF, 0, 0, SQRT_HALF);

        ref.Set(
            1, 0, 0,
            0, 0, 1,
            0,-1, 0
            );

        r = Matrix33FromQuaternion(q);

        Validate(IsSimilar(r, ref));

      ]]>
      </TEST>


      <TEST NAME="test78">
      <![CDATA[

        SetFunctionName("Matrix33FromQuaternion(const Quaternion &q)");

        Quaternion q;
        Matrix33 r, ref;

        q.Set(0, 0, 0, 1);

        ref.Set(
            1, 0, 0,
            0, 1, 0,
            0, 0, 1
            );

        r = Matrix33FromQuaternion(q);

        Validate(IsSimilar(r, ref));

      ]]>
      </TEST>


      <TEST NAME="test79">
      <![CDATA[

        SetFunctionName("Matrix33FromQuaternion(const Quaternion &q)");

        Quaternion q;
        Matrix33 r, ref;
        float_test_type angle = -PI + 0.0001f;
        float_test_type zero = 0.0f;

        for (; angle < float_test_type(PI); angle += float_test_type(0.25f))
        {
            q.Set(Sin(angle / float_test_type(2.0f)), zero, zero, Cos(angle / float_test_type(2.0f)));

            ref.Set(
                float_test_type(1.0f), zero, zero,
                zero, Cos(angle), Sin(angle),
                zero, Sin(-angle), Cos(angle)
                );

            r = Matrix33FromQuaternion(q);

            Validate(IsSimilar(r, ref));
        }

      ]]>
      </TEST>


      <TEST NAME="test80">
      <![CDATA[

        SetFunctionName("Matrix33FromQuaternion(const Quaternion &q)");

        Quaternion q;
        Matrix33 r, ref;
        float_test_type angle = -PI + 0.0001f;
        float_test_type zero = 0.0f;

        for (; angle < float_test_type(PI); angle += float_test_type(0.25f))
        {
            q.Set(zero, Sin(angle / float_test_type(2.0f)), zero, Cos(angle / float_test_type(2.0f)));

            ref.Set(
                Cos(angle), zero, Sin(-angle),
                zero, float_test_type(1.0f), zero,
                Sin(angle), zero, Cos(angle)
                );

            r = Matrix33FromQuaternion(q);

            Validate(IsSimilar(r, ref));
        }

      ]]>
      </TEST>


      <TEST NAME="test81">
      <![CDATA[

        SetFunctionName("Matrix33FromQuaternion(const Quaternion &q)");

        Quaternion q;
        Matrix33 r, ref;
        float_test_type angle = -PI + 0.0001f;
        float_test_type zero = 0.0f;

        for (; angle < float_test_type(PI); angle += float_test_type(0.25f))
        {
            q.Set(zero, zero, Sin(angle / float_test_type(2.0f)), Cos(angle / float_test_type(2.0f)));

            ref.Set(
                Cos(angle), Sin(angle), zero,
                Sin(-angle), Cos(angle), zero,
                zero, zero, float_test_type(1.0f)
                );

            r = Matrix33FromQuaternion(q);

            Validate(IsSimilar(r, ref));
        }

      ]]>
      </TEST>


      <TEST NAME="test82">
      <![CDATA[

        SetFunctionName("Matrix33FromEulerXYZ(const Vector3 &euler)");

        Vector3 euler;
        Matrix33 r, ref;

        euler.Set(HALF_PI, 0.0f, 0.0f);
        ref.Set(
             1,  0,  0,
             0,  0,  1,
             0, -1,  0
            );

        r = Matrix33FromEulerXYZ(euler);

        Validate(IsSimilar(r, ref));

      ]]>
      </TEST>


      <TEST NAME="test83">
      <![CDATA[

        SetFunctionName("Matrix33FromEulerXYZ(const Vector3 &euler)");

        Vector3 euler;
        Matrix33 r, ref;
        float_test_type angle = -PI + 0.0001f;
        float_test_type zero = 0.0f;

        for(; angle < float_test_type(PI); angle += float_test_type(0.25f))
        {
            euler.Set(angle, float_test_type(0.0f), float_test_type(0.0f));
            ref.Set(
                float_test_type(1.0f),  zero,  zero,
                zero,  Cos(angle), Sin(angle) ,
                zero,  Sin(-angle),  Cos(angle)
                );

            r = Matrix33FromEulerXYZ(euler);

            Validate(IsSimilar(r, ref));
        }

      ]]>
      </TEST>


      <TEST NAME="test84">
      <![CDATA[

        SetFunctionName("Matrix33FromEulerXYZ(const Vector3 &euler)");

        Vector3 euler;
        Matrix33 r, ref;
        float_test_type angle = -PI + 0.0001f;
        float_test_type zero = 0.0f;

        for(; angle < float_test_type(PI); angle += float_test_type(0.25f))
        {
            euler.Set(float_test_type(0.0f), angle, float_test_type(0.0f));
            ref.Set(
                Cos(angle), zero, Sin(-angle) ,
                zero, float_test_type(1.0f),  zero,
                Sin(angle), zero, Cos(angle)
                );

            r = Matrix33FromEulerXYZ(euler);

            Validate(IsSimilar(r, ref));
        }

      ]]>
      </TEST>


      <TEST NAME="test85">
      <![CDATA[

        SetFunctionName("Matrix33FromEulerXYZ(const Vector3 &euler)");

        Vector3 euler;
        Matrix33 r, ref;
        float_test_type angle = -PI + 0.0001f;
        float_test_type zero = 0.0f;

        for(; angle < float_test_type(PI); angle += float_test_type(0.25f))
        {
            euler.Set(float_test_type(0.0f), float_test_type(0.0f), angle);
            ref.Set(
                Cos(angle), Sin(angle) , zero,
                Sin(-angle), Cos(angle), zero,
                zero, zero, float_test_type(1.0f)
                );

            r = Matrix33FromEulerXYZ(euler);

            Validate(IsSimilar(r, ref));
        }

      ]]>
      </TEST>


      <TEST NAME="test86">
      <![CDATA[

        SetFunctionName("EulerXYZFromMatrix33(const Matrix33& m)");

        Matrix33 m;
        Vector3 rA, rB, refA, refB;

        // Tests implementation code when cy > 0.001f
        m.Set(
             1,  0,  0,
             0,  0,  1,
             0, -1,  0
            );

        refA.Set(HALF_PI, 0, 0);

        rA = EulerXYZFromMatrix33(m);

        // Tests implementation code when cy < 0.001f
        m.Set(
             0,  0,  1,
             1,  0,  0,
             0, -1,  0
            );

        refB.Set(HALF_PI, -HALF_PI, 0);

        rB = EulerXYZFromMatrix33(m);
        Validate(IsSimilar(rA, refA) &&
                 IsSimilar(rB, refB) );

      ]]>
      </TEST>


      <TEST NAME="test87">
      <![CDATA[

        SetFunctionName("EulerXYZFromMatrix33(const Matrix33& m)");

        Matrix33 m;
        Vector3 r, ref;
        float_test_type angle = -PI + 0.001f;
        float_test_type zero = 0.0f;

        for (; angle < (float_test_type)PI; angle += float_test_type(0.25f))
        {
            m.Set(
                float_test_type(1.0f), zero, zero,
                zero, Cos(angle), Sin(angle),
                zero, Sin(-angle), Cos(angle)
                );

            ref.Set(angle, zero, zero);

            r = EulerXYZFromMatrix33(m);

            Validate(IsSimilar(r, ref));
        }

      ]]>
      </TEST>


      <TEST NAME="test88">
      <![CDATA[

        SetFunctionName("EulerXYZFromMatrix33(const Matrix33& m)");

        Matrix33 m;
        Vector3 r, ref;
        float_test_type angle = -PI + 0.001f;
        float_test_type zero = 0.0f;

        for (; angle < (float_test_type)PI; angle += float_test_type(0.25f))
        {
            m.Set(
                Cos(angle), Sin(angle), zero,
                Sin(-angle), Cos(angle), zero,
                zero, zero, float_test_type(1.0f)
                );

            ref.Set(zero, zero, angle);

            r = EulerXYZFromMatrix33(m);

            Validate(IsSimilar(r, ref));
        }

      ]]>
      </TEST>


      <TEST NAME="test89">
      <![CDATA[

        SetFunctionName("EulerXYZFromMatrix33(const Matrix33& m)");

        Matrix33 m;
        Vector3 r, ref;
        float_test_type angle = -HALF_PI;
        float_test_type zero = 0.0f;

        for (; angle < (float_test_type)HALF_PI; angle += float_test_type(0.25f))
        {
            m.Set(
                Cos(angle), zero, Sin(-angle),
                zero, 1, zero,
                Sin(angle), zero, Cos(angle)
                );

            ref.Set(zero, angle, zero);

            r = EulerXYZFromMatrix33(m);

            Validate(IsSimilar(r, ref));
        }

      ]]>
      </TEST>


      <TEST NAME="test90">
      <![CDATA[

        SetFunctionName("EulerXYZFromMatrix33(const Matrix33& m)");

        float_basic_type angle;
        float_basic_type zero = 0.0f;
        Matrix33 m;
        Vector3 r, ref;


        for (angle = - PI + float_basic_type(0.001f); angle < PI; angle += float_basic_type(0.25f))
        {
            m.Set(
                Cos(angle),  Sin(angle),  zero,
                Sin(-angle),  Cos(angle),  zero,
                zero, zero,  float_test_type(1.0f)
                );

            ref.Set(zero, zero, angle);

            r = EulerXYZFromMatrix33(m);

            Validate(IsSimilar(r, ref));
        }

      ]]>
      </TEST>


      <TEST NAME="test91">
      <![CDATA[

        SetFunctionName("Matrix33FromAxisRotationAngle(const Vector3 &axis, float_t angle)");

        Vector3 axis;
        float_basic_type angle;
        Matrix33 r, ref;

        axis.Set(1, 0, 0);
        ref.Set(
            1, 0, 0,
            0, 0, 1,
            0,-1, 0
            );
        angle = HALF_PI;

        r = Matrix33FromAxisRotationAngle(axis, angle);

        Validate(IsSimilar(r, ref));

      ]]>
      </TEST>


      <TEST NAME="test92">
      <![CDATA[

        SetFunctionName("Matrix33FromAxisRotationAngle(const Vector3 &axis, float_t angle)");

        Vector3 axis;
        float_basic_type angle;
        Matrix33 r, ref;
        axis.Set(1, 0, 0);

        for (angle = -PI; angle < PI; angle += float_basic_type(0.25f))
        {
            ref.Set(
                1, 0, 0,
                0, Cos(angle), Sin(angle),
                0, Sin(-angle), Cos(angle)
                );

            r = Matrix33FromAxisRotationAngle(axis, angle);

            Validate(IsSimilar(r, ref));
        }

      ]]>
      </TEST>


      <TEST NAME="test93">
      <![CDATA[

        SetFunctionName("Matrix33FromAxisRotationAngle(const Vector3 &axis, float_t angle)");

        Vector3 axis;
        float_basic_type angle;
        Matrix33 r, ref;
        axis.Set(0, 1, 0);

        for (angle = -PI; angle < PI; angle += float_basic_type(0.25f))
        {
            ref.Set(
                Cos(angle), 0, Sin(-angle),
                0, 1, 0,
                Sin(angle), 0, Cos(angle)
                );

            r = Matrix33FromAxisRotationAngle(axis, angle);

            Validate(IsSimilar(r, ref));
        }

      ]]>
      </TEST>


      <TEST NAME="test94">
      <![CDATA[

        SetFunctionName("Matrix33FromAxisRotationAngle(const Vector3 &axis, float_t angle)");

        Vector3 axis;
        float_basic_type angle;
        Matrix33 r, ref;
        axis.Set(0, 0, 1);

        for (angle = -PI; angle < PI; angle += float_basic_type(0.25f))
        {
            ref.Set(
                Cos(angle),  Sin(angle),  0,
                Sin(-angle),  Cos(angle),  0,
                0, 0,  1
                );

            r = Matrix33FromAxisRotationAngle(axis, angle);

            Validate(IsSimilar(r, ref));
        }

      ]]>
      </TEST>


      <TEST NAME="test95">
      <![CDATA[

        SetFunctionName("Matrix33FromXRotationAngle(angle)");

        Matrix33 r, ref;
        float_basic_type angle = 1.3f;
#ifdef HOST_TESTING
        r = Matrix33FromXRotationAngle( angle );
#else
        r = Matrix33FromXRotationAngle<FloatType>( angle );
#endif
        ref = Matrix33FromAxisRotationAngle(Vector3(1.0f, 0.0f, 0.0f), angle);

        Validate(IsSimilar(r, ref));

      ]]>
      </TEST>


      <TEST NAME="test96">
      <![CDATA[

        SetFunctionName("Matrix33FromXRotationAngle(angle)");

        Matrix33 r, ref;
        float_test_type angle = -PI + 0.0001f;

        for(; angle < float_test_type(PI); angle += float_test_type(0.25f))
        {
#ifdef HOST_TESTING
            r = Matrix33FromXRotationAngle( angle );
#else
            r = Matrix33FromXRotationAngle<FloatType>( angle );
#endif
            ref = Matrix33FromAxisRotationAngle(Vector3(1.0f, 0.0f, 0.0f), angle);

            Validate(IsSimilar(r, ref));
        }

      ]]>
      </TEST>


      <TEST NAME="test97">
      <![CDATA[

        SetFunctionName("Matrix33FromYRotationAngle(angle)");

        Matrix33 r, ref;
        float_basic_type angle = 1.3f;

#ifdef HOST_TESTING
        r = Matrix33FromYRotationAngle( angle );
#else
        r = Matrix33FromYRotationAngle<FloatType>( angle );
#endif
        ref = Matrix33FromAxisRotationAngle(Vector3(0.0f, 1.0f, 0.0f), angle);

        Validate(IsSimilar(r, ref));

      ]]>
      </TEST>


      <TEST NAME="test98">
      <![CDATA[

        SetFunctionName("Matrix33FromYRotationAngle(angle)");

        Matrix33 r, ref;
        float_test_type angle = -PI + 0.0001f;

        for(; angle < float_test_type(PI); angle += float_test_type(0.25f))
        {

#ifdef HOST_TESTING
            r = Matrix33FromYRotationAngle( angle );
#else
            r = Matrix33FromYRotationAngle<FloatType>( angle );
#endif
            ref = Matrix33FromAxisRotationAngle(Vector3(0.0f, 1.0f, 0.0f), angle);

            Validate(IsSimilar(r, ref));
        }

      ]]>
      </TEST>


      <TEST NAME="test99">
      <![CDATA[

        SetFunctionName("Matrix33FromZRotationAngle(angle)");

        Matrix33 r, ref;
        float_basic_type angle = 1.3f;

#ifdef HOST_TESTING
        r = Matrix33FromZRotationAngle( angle );
#else
        r = Matrix33FromZRotationAngle<FloatType>( angle );
#endif
        ref = Matrix33FromAxisRotationAngle(Vector3(0.0f, 0.0f, 1.0f), angle);

        Validate(IsSimilar(r, ref));

      ]]>
      </TEST>


      <TEST NAME="test100">
      <![CDATA[

        SetFunctionName("Matrix33FromZRotationAngle(angle)");

        Matrix33 r, ref;
        float_test_type angle = -PI + 0.0001f;

        for(; angle < float_test_type(PI); angle += float_test_type(0.25f))
        {

#ifdef HOST_TESTING
            r = Matrix33FromZRotationAngle( angle );
#else
            r = Matrix33FromZRotationAngle<FloatType>( angle );
#endif
            ref = Matrix33FromAxisRotationAngle(Vector3(0.0f, 0.0f, 1.0f), angle);

            Validate(IsSimilar(r, ref));
        }

      ]]>
      </TEST>


      <TEST NAME="test101">
      <![CDATA[

        SetFunctionName("RotateAroundXAxis(angle, matrix33)");
        Matrix33 initialMat = Matrix33FromEulerXYZ(Vector3(1.0f, 2.3f, -1.4f));
        Matrix33 r, ref;
        float_basic_type angle = 1.3f;
#ifdef HOST_TESTING
        ref = Mult( Matrix33FromXRotationAngle( angle ), initialMat );
#else
        ref = Mult( Matrix33FromXRotationAngle<FloatType>( angle ), initialMat );
#endif
        r = RotateAroundXAxis(initialMat, angle);

        Validate(IsSimilar(r, ref));

      ]]>
      </TEST>


      <TEST NAME="test102">
      <![CDATA[

        SetFunctionName("RotateAroundXAxis(angle, matrix33)");
        Matrix33 initialMat = Matrix33FromEulerXYZ(Vector3(1.0f, 2.3f, -1.4f));
        Matrix33 r, ref;
        float_test_type angle = -PI + 0.0001f;

        for(; angle < float_test_type(PI); angle += float_test_type(0.25f))
        {

#ifdef HOST_TESTING
            ref = Mult( Matrix33FromXRotationAngle( angle ), initialMat );
#else
            ref = Mult( Matrix33FromXRotationAngle<FloatType>( angle ), initialMat );
#endif
            r = RotateAroundXAxis(initialMat, angle);

            Validate(IsSimilar(r, ref));
        }

      ]]>
      </TEST>


      <TEST NAME="test103">
      <![CDATA[

        SetFunctionName("RotateAroundYAxis(angle, matrix33)");
        Matrix33 initialMat = Matrix33FromEulerXYZ(Vector3(1.0f, 2.3f, -1.4f));
        Matrix33 r, ref;
        float_basic_type angle = 1.3f;

#ifdef HOST_TESTING
        ref = Mult( Matrix33FromYRotationAngle( angle ), initialMat );
#else
        ref = Mult( Matrix33FromYRotationAngle<FloatType>( angle ), initialMat );
#endif
        r = RotateAroundYAxis(initialMat, angle);

        Validate(IsSimilar(r, ref));

      ]]>
      </TEST>


      <TEST NAME="test104">
      <![CDATA[

        SetFunctionName("RotateAroundYAxis(angle, matrix33)");
        Matrix33 initialMat = Matrix33FromEulerXYZ(Vector3(1.0f, 2.3f, -1.4f));
        Matrix33 r, ref;
        float_test_type angle = -PI + 0.0001f;

        for(; angle < float_test_type(PI); angle += float_test_type(0.25f))
        {

#ifdef HOST_TESTING
            ref = Mult( Matrix33FromYRotationAngle( angle ), initialMat );
#else
            ref = Mult( Matrix33FromYRotationAngle<FloatType>( angle ), initialMat );
#endif
            r = RotateAroundYAxis(initialMat, angle);

            Validate(IsSimilar(r, ref));
        }

      ]]>
      </TEST>


      <TEST NAME="test105">
      <![CDATA[

        SetFunctionName("RotateAroundZAxis(angle, matrix33)");
        Matrix33 initialMat = Matrix33FromEulerXYZ(Vector3(1.0f, 2.3f, -1.4f));
        Matrix33 r, ref;
        float_basic_type angle = 1.3f;

#ifdef HOST_TESTING
        ref = Mult( Matrix33FromZRotationAngle( angle ), initialMat );
#else
        ref = Mult( Matrix33FromZRotationAngle<FloatType>( angle ), initialMat );
#endif
        r = RotateAroundZAxis(initialMat, angle);

        Validate(IsSimilar(r, ref));

      ]]>
      </TEST>


      <TEST NAME="test106">
      <![CDATA[

        SetFunctionName("RotateAroundZAxis(angle, matrix33)");
        Matrix33 initialMat = Matrix33FromEulerXYZ(Vector3(1.0f, 2.3f, -1.4f));
        Matrix33 r, ref;
        float_test_type angle = -PI + 0.0001f;

        for(; angle < float_test_type(PI); angle += float_test_type(0.25f))
        {

#ifdef HOST_TESTING
            ref = Mult( Matrix33FromZRotationAngle( angle ), initialMat );
#else
            ref = Mult( Matrix33FromZRotationAngle<FloatType>( angle ), initialMat );
#endif
            r = RotateAroundZAxis(initialMat, angle);

            Validate(IsSimilar(r, ref));
        }

      ]]>
      </TEST>


      <TEST NAME="test107">
      <![CDATA[

        SetFunctionName("ScaleRow(r0, r1, r2, m)");
        Matrix33 initialMat(
                1.0f, 1.0f, 1.0f,
                1.0f, 1.0f, 1.0f,
                1.0f, 1.0f, 1.0f );

        Matrix33 ref(
                2.0f, 2.0f, 2.0f,
                3.0f, 3.0f, 3.0f,
                4.0f, 4.0f, 4.0f );

        Matrix33 r = ScaleRow(initialMat, (float_basic_type) 2.0f, (float_basic_type) 3.0f, (float_basic_type) 4.0f );

        Validate(IsSimilar(r, ref));

      ]]>
      </TEST>


      <TEST NAME="test108">
      <![CDATA[

        SetFunctionName("ScaleColumn(r0, r1, r2, m)");
        Matrix33 initialMat(
                1.0f, 1.0f, 1.0f,
                1.0f, 1.0f, 1.0f,
                1.0f, 1.0f, 1.0f );

        Matrix33 ref(
                2.0f, 3.0f, 4.0f,
                2.0f, 3.0f, 4.0f,
                2.0f, 3.0f, 4.0f );

        Matrix33 r = ScaleColumn(initialMat, (float_basic_type) 2.0f, (float_basic_type) 3.0f, (float_basic_type) 4.0f );

        Validate(IsSimilar(r, ref));

      ]]>
      </TEST>


      <TEST NAME="test109">
      <![CDATA[

        SetFunctionName("Matrix33FromDiagonal(float_t a)");

        Matrix33 r, ref;
        float s = 3.0f;
        ref.Set(
            s, 0, 0,
            0, s, 0,
            0, 0, s
            );

#ifdef HOST_TESTING
        r = Matrix33FromDiagonal(s);
#else
        r = Matrix33FromDiagonal<FloatType>(s);
#endif
        Validate(IsSimilar(r, ref));

      ]]>
      </TEST>


      <TEST NAME="test110">
      <![CDATA[

        SetFunctionName("QueryRotateDegenerateUnitAxis(Matrix33 matrix, Vector3 unitAxis)");
        Matrix33 mat(
            1.1f, 0.0f, 0.1f,
            0.1f, 1.0f, 0.0f,
            0.0f, 0.0f, 1.0f
        );

#ifdef HOST_TESTING
        Vector3 r = QueryRotateDegenerateUnitAxis(mat);
#else
        Vector3 r = QueryRotateDegenerateUnitAxis<FloatType>(mat);
#endif

        // TODO : Add further testing.
        Validate(IsSimilar(Magnitude(r), (float_basic_type) 1.0f));

      ]]>
      </TEST>


      <TEST NAME="test111">
      <![CDATA[

        SetFunctionName("QueryRotateDegenerateUnitAxis(Matrix33 matrix, Vector3 unitAxis)");
        Matrix33 mat(
            2.0f, 0.0f, 0.1f,
            0.1f, 3.0f, 0.0f,
            0.0f, 0.0f, 1.0f
        );

        Vector3 ref = Vector3(0.006249878f,0.99998f,0);
#ifdef HOST_TESTING
        Vector3 r = QueryRotateDegenerateUnitAxis(mat);
#else
        Vector3 r = QueryRotateDegenerateUnitAxis<FloatType>(mat);
#endif

        Validate(IsSimilar(Magnitude(r), (float_basic_type) 1.0f) &&
            IsSimilar(r, ref));

      ]]>
      </TEST>


      <TEST NAME="test112">
      <![CDATA[

        SetFunctionName("QueryRotateDegenerateUnitAxis(Matrix33 matrix, Vector3 unitAxis)");
        Matrix33 mat(
            2.0f, 0.0f, 0.1f,
            0.1f, 1.0f, 0.0f,
            0.0f, 0.0f, 3.0f
        );

        Vector3 ref = Vector3(0.006249878f,0,0.99998f);
#ifdef HOST_TESTING
        Vector3 r = QueryRotateDegenerateUnitAxis(mat);
#else
        Vector3 r = QueryRotateDegenerateUnitAxis<FloatType>(mat);
#endif

        Validate(IsSimilar(Magnitude(r), (float_basic_type) 1.0f) &&
            IsSimilar(r, ref));

      ]]>
      </TEST>


      <TEST NAME="test113">
      <![CDATA[

        SetFunctionName("QueryRotateDegenerateUnitAxis(Matrix33 matrix, Vector3 unitAxis)");
        Matrix33 mat(
            1.0f, 0.0f, 0.1f,
            0.1f, 2.0f, 0.0f,
            0.0f, 0.0f, 3.0f
        );

        Vector3 ref = Vector3(0.006249878f,0,0.99998f);
#ifdef HOST_TESTING
        Vector3 r = QueryRotateDegenerateUnitAxis(mat);
#else
        Vector3 r = QueryRotateDegenerateUnitAxis<FloatType>(mat);
#endif

        Validate(IsSimilar(Magnitude(r), (float_basic_type) 1.0f) &&
            IsSimilar(r, ref));

      ]]>
      </TEST>


      <TEST NAME="test114">
      <![CDATA[

        SetFunctionName("void QueryRotate(Matrix33 matrix, Vector3 VecFloat::OutParam angle)");
        Vector3 axis = Normalize(Vector3(1,2,3));
        Matrix33 mat = Matrix33FromAxisRotationAngle(axis, (float_basic_type) 1.0f);

        Vector3 r;
        float_test_type angle;
        QueryRotate(mat, r, angle);

        Validate(IsSimilar(Magnitude(r), (float_basic_type) 1.0f) &&
                 IsSimilar(r, axis)
                 );

      ]]>
      </TEST>


      <TEST NAME="test115">
      <![CDATA[

        SetFunctionName("SLerp(Matrix33 lFrom, Matrix33 lTo, float lrParam, float lprAngle)");
        Vector3 axis = Normalize(Vector3(1.0f, -1.0f, 0.05f));
        Matrix33 from = Matrix33FromAxisRotationAngle( axis, (float_basic_type) 0.25f );
        Matrix33 to = Matrix33FromAxisRotationAngle( axis, (float_basic_type) 0.75f );
        Matrix33 ref = Matrix33FromAxisRotationAngle( axis, (float_basic_type) 0.5f );
        float_test_type angle;
        Matrix33 result = SLerp( from, to, (float_basic_type) (float_basic_type) 0.5f, angle );

        Validate( IsSimilar(result, ref, (float_basic_type) 0.001f) );

      ]]>
      </TEST>


      <TEST NAME="test116">
      <![CDATA[

        SetFunctionName("SLerpByAngle(Matrix33 lFrom, Matrix33 lTo, float lrMaxAngle, float lprAngle)");
        Vector3 axis = Normalize(Vector3(1.0f, -1.0f, 0.05f));
        Matrix33 from = Matrix33FromAxisRotationAngle( axis, (float_basic_type) 0.25f );
        Matrix33 to = Matrix33FromAxisRotationAngle( axis, (float_basic_type) 0.75f );
        Matrix33 ref = Matrix33FromAxisRotationAngle( axis, (float_basic_type) 0.5f );
        float_test_type angle=0.0f;
        Matrix33 result = SLerpByAngle( from, to, (float_test_type)0.25f, angle );

        Validate( IsSimilar(result, ref, (float_basic_type) 0.001f) &&
                  IsSimilar(angle, (float_basic_type)0.25f) );

      ]]>
      </TEST>


      <TEST NAME="test117">
      <![CDATA[

        SetFunctionName("Multiple conversion routine Test");

        // This test converts as follows:
        //  1. Euler => Matrix33
        //  2. Matrix33 => Quaternion
        //  3. Quaternion => Matrix33
        //  3. Matrix33 => Euler angles
        float halfPi = 0.5f * 3.14159265359f;
        for( int za=0; za<4; ++za )
        {
            for( int ya=0; ya<4; ++ya )
            {
                for( int xa=0; xa<4; ++xa )
                {
                    // Create eulerAngles
                    Vector3 eulerAngles(xa * halfPi, ya * halfPi, za * halfPi);
                    Matrix33 rotMatrix = Matrix33FromEulerXYZ(eulerAngles);
                    Quaternion quat = QuaternionFromMatrix33(rotMatrix);

                    Matrix33 rotMatrix2 = Matrix33FromQuaternion(quat);
                    Vector3 eulerAngles2 = EulerXYZFromMatrix33(rotMatrix);
                    // Validate rotation matrix
                    Validate(IsSimilar(rotMatrix, rotMatrix2));
                    // Validate euler angles
                    // Note: the euler angles can't be directly compared
                    // because conversion from matrix to euler is not 1-to-1.
                    Matrix33 rotMatrix3 = Matrix33FromEulerXYZ(eulerAngles2);
                    Validate(IsSimilar(rotMatrix, rotMatrix3));
                }
            }
        }

      ]]>
      </TEST>


      <TEST NAME="test118">
      <![CDATA[

        SetFunctionName("Transform(Vector3* vecs, int numVectors, Matrix33 matrix, Vector3 *transformedVecs)");
        Matrix33 a(
            -0.8149562f,   0.5008597f,   0.2915235f,
            -0.4312790f,  -0.1881537f,  -0.8823812f,
            -0.3870979f,  -0.8448300f,   0.3693473f
            );
        Vector3 vec[3] =
        {
            Vector3( 1.0f, 2.0f, 3.0f ),
                Vector3( 3.0f, -2.0f, 1.0f ),
                Vector3( 9.0f, -2.0f, 8.0f )
        };
        Vector3 ref[3] =
        {
            Vector3(-2.83880798f, -2.40993783f, -0.36519710f),
                Vector3(-1.9694085f, 1.0340564f, 3.0086801f ),
                Vector3(-9.5688305f, -1.8745952f, 7.3432522f )
        };
        Vector3 res[3];
        Transform( vec, 3, a, res );
        Validate(   IsSimilar(res[0], ref[0]) &&
            IsSimilar(res[1], ref[1]) &&
            IsSimilar(res[2], ref[2]) );

      ]]>
      </TEST>


      <TEST NAME="test119">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Negate(const Matrix33 &m, Matrix33 &result)");

        Matrix33 m, r, ref;
        m.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        Negate(m, r);

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = -(m.GetElem(i));
        }

        Validate(IsSimilar(r, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test120">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Mult(const Matrix33 &m, const float_t a, Matrix33 &result)");

        Matrix33 m, r, ref;
        m.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        float_basic_type s = 2.0f;
        Mult(m, s, r);

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = m.GetElem(i) * (float_test_type)s;
        }

        Validate(IsSimilar(r, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test121">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Divide(const Matrix33 &m, const float_t a, Matrix33 &result)");

        Matrix33 m, r, ref;
        m.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        float_basic_type s = 2.0f;
        Divide(m, s, r);

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = m.GetElem(i) / (float_test_type)s;
        }

        Validate(IsSimilar(r, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test122">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API
#ifdef HOST_TESTING

        SetFunctionName("Divide(const Matrix33 &m, VecFloatRef, Matrix33 &result)");

        Matrix33 m, r, ref;
        m.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        float s = 2.0f;
        MakeVectorIntrinsic(vi, s, s, s, s);

        Divide(m, VecFloatRefY(vi), r);

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = m.GetElem(i) / (float_test_type)s;
        }

        Validate(IsSimilar(r, ref));

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test123">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API
#ifdef HOST_TESTING

        SetFunctionName("Divide(const Matrix33 &m, VecFloatRefIndex, Matrix33 &result)");

        Matrix33 m, r, ref;
        m.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        float s = 2.0f;
        MakeVectorIntrinsic(vi, s, s, s, s);

        Divide(m, VecFloatRefIndex(vi, 2), r);

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = m.GetElem(i) / (float_test_type)s;
        }

        Validate(IsSimilar(r, ref));

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test124">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API
#ifdef HOST_TESTING

        SetFunctionName("Mult(const Matrix33 &m, VecFloatRef, Matrix33 &result)");

        Matrix33 m, r, ref;
        m.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        float s = 2.0f;
        MakeVectorIntrinsic(vi, s, s, s, s);

        Mult(m, VecFloatRefY(vi), r);

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = m.GetElem(i) * (float_test_type)s;
        }

        Validate(IsSimilar(r, ref));

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test125">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API
#ifdef HOST_TESTING

        SetFunctionName("Mult(const Matrix33 &m, VecFloatRefIndex, Matrix33 &result)");

        Matrix33 m, r, ref;
        m.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        float s = 2.0f;
        MakeVectorIntrinsic(vi, s, s, s, s);

        Mult(m, VecFloatRefIndex(vi, 2),r);

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = m.GetElem(i) * (float_test_type)s;
        }

        Validate(IsSimilar(r, ref));

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test126">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Add(const Matrix33 &a, const Matrix33 &b, Matrix33 &result)");

        Matrix33 a, b, r, ref;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        b.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);
        Add(a, b, r);

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = a.GetElem(i) + b.GetElem(i);
        }
        Validate(IsSimilar(r, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test127">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Subtract(const Matrix33 &a, const Matrix33 &b, Matrix33 &result)");

        Matrix33 a, b, r, ref;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        b.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);
        Subtract(a, b, r);

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = a.GetElem(i) - b.GetElem(i);
        }
        Validate(IsSimilar(r, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test128">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Mult(const Vector3 &v, const Matrix33 &m, Vector3 &result)");

        Matrix33 m;
        Vector3 v3, r, ra;
        v3.Set(6.0f, -1.0f, -3.0f);
        m.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        Mult(v3, m, r); // test with non-aliasing

        ra.Set(6.0f, -1.0f, -3.0f);
        Mult(ra, m, ra);  // test with aliasing

        Vector3 ref(
                  m.GetElem(0, 0) * v3.X() + m.GetElem(1, 0) * v3.Y() + m.GetElem(2, 0) * v3.Z(),
                  m.GetElem(0, 1) * v3.X() + m.GetElem(1, 1) * v3.Y() + m.GetElem(2, 1) * v3.Z(),
                  m.GetElem(0, 2) * v3.X() + m.GetElem(1, 2) * v3.Y() + m.GetElem(2, 2) * v3.Z());

        Validate(IsSimilar(r, ref) && IsSimilar(ra, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test129">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Mult(const Matrix33 &a, const Matrix33 &b, Matrix33 &result)");

        Matrix33 a, b, r, ra, ref;

        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        b.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);
        ra.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);


        Mult(a, b, r); // test with non-aliasing

        Mult(ra, b, ra);  // test with aliasing

        for (int32_t i = 0; i < 3; ++i)
        {
            ref.SetElem(i, 0, a.GetElem(i, 0) * b.GetElem(0, 0) + a.GetElem(i, 1) * b.GetElem(1, 0) + a.GetElem(i, 2) * b.GetElem(2, 0) );
            ref.SetElem(i, 1, a.GetElem(i, 0) * b.GetElem(0, 1) + a.GetElem(i, 1) * b.GetElem(1, 1) + a.GetElem(i, 2) * b.GetElem(2, 1) );
            ref.SetElem(i, 2, a.GetElem(i, 0) * b.GetElem(0, 2) + a.GetElem(i, 1) * b.GetElem(1, 2) + a.GetElem(i, 2) * b.GetElem(2, 2) );
        }

        Validate(IsSimilar(r, ref) && IsSimilar(ra, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test130">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Transpose(const Matrix33 &m, Matrix33 &result)");

        Matrix33 m, r, ref;

        m.Set(
            1, 2, 3,
            4, 5, 6,
            7, 8, 9
            );
        ref.Set(
            1, 4, 7,
            2, 5, 8,
            3, 6, 9
            );

        Transpose(m, r);

        Validate(IsSimilar(r, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test131">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Inverse(const Matrix33 &m, Matrix33 &result)");

        Matrix33 m, r, ref;

        m.Set(
            1, 2, 0,
            -1, 1, 1,
            1, 2, 3
            );

        ref.Set(
            1.0f/9.0f, -6.0f/9.0f,  2.0f/9.0f,
            4.0f/9.0f,  3.0f/9.0f, -1.0f/9.0f,
            -3.0f/9.0f,          0,  3.0f/9.0f
            );

        Inverse(m, r);

        Validate(IsSimilar(r, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test132">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Matrix33FromQuaternion(const Quaternion &q, Matrix33 &result)");

        Quaternion q;
        Matrix33 r, ref;

        q.Set(SQRT_HALF, 0, 0, SQRT_HALF);

        ref.Set(
            1, 0, 0,
            0, 0, 1,
            0,-1, 0
            );

        Matrix33FromQuaternion(q, r);

        Validate(IsSimilar(r, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test133">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Matrix33FromAxisAngle(const Vector3 &axis, float_t angle, Matrix33 &result)");

        Vector3 axis;
        float_basic_type angle;
        Matrix33 r, ref;

        axis.Set(1, 0, 0);
        ref.Set(
            1, 0, 0,
            0, 0, 1,
            0,-1, 0
            );
        angle = HALF_PI;

        Matrix33FromAxisAngle(axis, angle, r);

        Validate(IsSimilar(r, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test134">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Matrix33FromEulerXYZ(const Vector3 &euler, Matrix33 &result)");

        Vector3 euler;
        Matrix33 r, ref;

        euler.Set(HALF_PI, 0.0f, 0.0f);
        ref.Set(
            1,  0,  0,
            0,  0,  1,
            0, -1,  0
            );

        Matrix33FromEulerXYZ(euler, r);

        Validate(IsSimilar(r, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test135">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("EulerXYZFromMatrix33(const Matrix33& m, Vector3 &result)");

        Matrix33 m;
        Vector3 r, ref;

        m.Set(
            1,  0,  0,
            0,  0,  1,
            0, -1,  0
            );

        ref.Set(HALF_PI, 0, 0);

        EulerXYZFromMatrix33(m, r);

        Validate(IsSimilar(r, ref));

#endif

      ]]>
      </TEST>

      <TEST NAME="getxcolumn">
      <![CDATA[

        SetFunctionName("Vector3 GetXColumn()");

        Matrix33 m(
             2.0f,  3.0f,  4.0f,
             6.0f,  7.0f,  8.0f,
            10.0f, 11.0f, 12.0f
            );
        Vector3 r = m.GetXColumn();
        Vector3 ref( 2.0f, 6.0f, 10.0f );


        Validate( r == ref );

      ]]>
      </TEST>

      <TEST NAME="getycolumn">
      <![CDATA[

        SetFunctionName("Vector3 GetYColumn()");

        Matrix33 m(
             2.0f,  3.0f,  4.0f,
             6.0f,  7.0f,  8.0f,
            10.0f, 11.0f, 12.0f
            );
        Vector3 r = m.GetYColumn();
        Vector3 ref( 3.0f, 7.0f, 11.0f );


        Validate( r == ref );

      ]]>
      </TEST>

      <TEST NAME="getzcolumn">
      <![CDATA[

        SetFunctionName("Vector3 GetZColumn()");

        Matrix33 m(
             2.0f,  3.0f,  4.0f,
             6.0f,  7.0f,  8.0f,
            10.0f, 11.0f, 12.0f
            );
        Vector3 r = m.GetZColumn();
        Vector3 ref( 4.0f, 8.0f, 12.0f );


        Validate( r == ref );

      ]]>
      </TEST>

      <TEST NAME="setxcolumn">
      <![CDATA[

        SetFunctionName("SetXColumn(Vector3 &)");

        Matrix33 m(
             2.0f,  3.0f,  4.0f,
             6.0f,  7.0f,  8.0f,
            10.0f, 11.0f, 12.0f
            );
        Vector3 v3(1.0f, 2.0f, 3.0f );
        Matrix33 ref(
            1.0f,  3.0f,  4.0f,
            2.0f,  7.0f,  8.0f,
            3.0f, 11.0f, 12.0f
            );
        m.SetXColumn(v3);

        Validate( m == ref );

      ]]>
      </TEST>

      <TEST NAME="setycolumn">
      <![CDATA[

        SetFunctionName("SetYColumn(Vector3 &)");

        Matrix33 m(
             2.0f,  3.0f,  4.0f,
             6.0f,  7.0f,  8.0f,
            10.0f, 11.0f, 12.0f
            );
        Vector3 v3(1.0f, 2.0f, 3.0f);
        Matrix33 ref(
             2.0f, 1.0f,  4.0f,
             6.0f, 2.0f,  8.0f,
            10.0f, 3.0f, 12.0f
            );
        m.SetYColumn(v3);

        Validate( m == ref );

      ]]>
      </TEST>

      <TEST NAME="setzcolumn">
      <![CDATA[

        SetFunctionName("SetZColumn(Vector3 &)");

        Matrix33 m(
             2.0f,  3.0f,  4.0f,
             6.0f,  7.0f,  8.0f,
            10.0f, 11.0f, 12.0f
            );
        Vector3 v3(1.0f, 2.0f, 3.0f);
        Matrix33 ref(
             2.0f,  3.0f, 1.0f,
             6.0f,  7.0f, 2.0f,
            10.0f, 11.0f, 3.0f
            );
        m.SetZColumn(v3);

        Validate( m == ref );

      ]]>
      </TEST>
    </TYPE>

    <TYPE NAME="performance">

      <TEST NAME="test136">
      <![CDATA[

        SetFunctionName("Negate(const Matrix33 &m)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                retValueM33 = Negate(m33_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="perf_inverse">
      <![CDATA[

        SetFunctionName("Inverse(const Matrix33 &m)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                retValueM33 = Inverse(m33_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test137">
      <![CDATA[

        SetFunctionName("Mult(const Matrix33 &m, const float_t a)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                retValueM33 = Mult(m33_array[i], x_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test138">
      <![CDATA[

        SetFunctionName("Divide(const Matrix33 &m, const float_t a)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                retValueM33 = Divide(m33_array[i], x_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test139">
      <![CDATA[

        SetFunctionName("Add(const Matrix33 &a, const Matrix33 &b)");

        Matrix33 a;
        a = m33_array[0];

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                retValueM33 = Add(a, m33_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test140">
      <![CDATA[

        SetFunctionName("Subtract(const Matrix33 &a, const Matrix33 &b)");

        Matrix33 a;
        a = m33_array[0];

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                retValueM33 = Subtract(a, m33_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test141">
      <![CDATA[

        SetFunctionName("SelfAdd(Matrix33 &a, const Matrix33 &b)");

        retValueM33 = m33_array[1];

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                SelfAdd(retValueM33, m33_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test142">
      <![CDATA[

        SetFunctionName("SelfSubtract(Matrix33 &a, const Matrix33 &b)");

        retValueM33 = m33_array[1];

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                SelfSubtract(retValueM33, m33_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test143">
      <![CDATA[

        SetFunctionName("SelfMult(Matrix33 &m, const float_t a)");

        retValueM33 = m33_array[1];

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                SelfMult(m33_array[i], x_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test144">
      <![CDATA[

        SetFunctionName("SelfDivide(Matrix33 &m, const float_t a)");

        retValueM33 = m33_array[1];

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                SelfDivide(m33_array[i], x_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test145">
      <![CDATA[

        SetFunctionName("Mult(const Vector3 &v, const Matrix33 &m)");

        Vector3 v3;
        v3.Set(6.0f, -1.0f, -3.0f);

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                retValueV3 = Mult(v3, m33_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test146">
      <![CDATA[

        SetFunctionName("Mult(const Matrix33 &a, const Matrix33 &b)");

        Matrix33 a;

        a = m33_array[1];

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                retValueM33 = Mult(a, m33_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test147">
      <![CDATA[

        SetFunctionName("Transpose(const Matrix33 &m)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                retValueM33 = Transpose(m33_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test148">
      <![CDATA[

        SetFunctionName("Determinant(const Matrix33 &m)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                retValueFloat = Determinant(m33_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test149">
      <![CDATA[

        SetFunctionName("IsSimilar(const Matrix33 &a, const Matrix33 &b, float_t epsilon = rw::math::kSmallFloat)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);


        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                retValueBool = IsSimilar(m33_array[i], m33_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE - i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test150">
      <![CDATA[

        SetFunctionName("Matrix33FromQuaternion(const Quaternion &q)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                retValueM33 = Matrix33FromQuaternion(q_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test151">
      <![CDATA[

        SetFunctionName("Matrix33FromAxisRotationAngle(const Vector3 &axis, float_t angle)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                retValueM33 = Matrix33FromAxisRotationAngle(v3_array[i], (float_test_type)2.0f);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test152">
      <![CDATA[

        SetFunctionName("Matrix33FromXRotationAngle(float_t angle)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
#if defined HOST_TESTING
                retValueM33 = Matrix33FromXRotationAngle( 1.3f );
#else
                retValueM33 = Matrix33FromXRotationAngle<FloatType>( 1.3f );
#endif
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test153">
      <![CDATA[

        SetFunctionName("Matrix33FromYRotationAngle(float_t angle)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
#if defined HOST_TESTING
                retValueM33 = Matrix33FromYRotationAngle( 1.3f );
#else
                retValueM33 = Matrix33FromYRotationAngle<FloatType>( 1.3f );
#endif
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test154">
      <![CDATA[

        SetFunctionName("Matrix33FromZRotationAngle(float_t angle)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
#if defined HOST_TESTING
                retValueM33 = Matrix33FromZRotationAngle( 1.3f );
#else
                retValueM33 = Matrix33FromZRotationAngle<FloatType>( 1.3f );
#endif
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test155">
      <![CDATA[

        SetFunctionName("Matrix33FromEulerXYZ(const Vector3 &euler)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                retValueM33 = Matrix33FromEulerXYZ(v3_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test156">
      <![CDATA[

        SetFunctionName("EulerXYZFromMatrix33(const Matrix33& m)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                retValueV3 = EulerXYZFromMatrix33(m33_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>

    </TYPE>

  </TYPE>


  <TYPE NAME="operator">

    <TYPE NAME="correctness">

      <TEST NAME="test157">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator *= (Matrix33 &m, float_t a)");

        Matrix33 m, ref;
        float_basic_type s = 2.0f;
        m.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = m.GetElem(i) * (float_test_type)s;
        }

        m *= s;


        Validate(IsSimilar(m, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test158">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator /= (Matrix33 &m, float_t a)");

        Matrix33 m, ref;
        float_basic_type s = 2.0f;
        m.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = m.GetElem(i) / (float_test_type)s;
        }

        m /= s;

        Validate(IsSimilar(m, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test159">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator * (const Matrix33 &m, const float_t a)");

        Matrix33 a, r, ref;
        float_basic_type s = 2.0f;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        for (int32_t i = 0; i < 3; ++i)
        {
            ref.SetElem(i, 0, a.GetElem(i, 0) * (float_test_type)s );
            ref.SetElem(i, 1, a.GetElem(i, 1) * (float_test_type)s );
            ref.SetElem(i, 2, a.GetElem(i, 2) * (float_test_type)s );
        }

        r = a * s;

        Validate(IsSimilar(r, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test159b">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator * (const float_t a, const Matrix33 &m)");

        Matrix33 a, r, ref;
        float_basic_type s = 2.0f;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        for (int32_t i = 0; i < 3; ++i)
        {
            ref.SetElem(i, 0, a.GetElem(i, 0) * (float_test_type)s );
            ref.SetElem(i, 1, a.GetElem(i, 1) * (float_test_type)s );
            ref.SetElem(i, 2, a.GetElem(i, 2) * (float_test_type)s );
        }

        r = s * a;

        Validate(IsSimilar(r, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test159c">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator / (const Matrix33 &m, const float_t a)");

        Matrix33 a, r, ref;
        float_basic_type s = 2.0f;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        for (int32_t i = 0; i < 3; ++i)
        {
            ref.SetElem(i, 0, a.GetElem(i, 0) / (float_test_type)s );
            ref.SetElem(i, 1, a.GetElem(i, 1) / (float_test_type)s );
            ref.SetElem(i, 2, a.GetElem(i, 2) / (float_test_type)s );
        }

        r = a / s;

        Validate(IsSimilar(r, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test160">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator * (const float_t a, const Matrix33 &b)");

        Matrix33 a, r, ref;
        float_basic_type s = 2.0f;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        for (int32_t i = 0; i < 3; ++i)
        {
            ref.SetElem(i, 0, a.GetElem(i, 0) * (float_test_type)s );
            ref.SetElem(i, 1, a.GetElem(i, 1) * (float_test_type)s );
            ref.SetElem(i, 2, a.GetElem(i, 2) * (float_test_type)s );
        }

        r = (float_test_type)s * a;

        Validate(IsSimilar(r, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test161">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator / (const Matrix33 &m, const float_t a)");

        Matrix33 a, r, ref;
        float_basic_type s = 2.0f;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        for (int32_t i = 0; i < 3; ++i)
        {
            ref.SetElem(i, 0, a.GetElem(i, 0) / (float_test_type)s );
            ref.SetElem(i, 1, a.GetElem(i, 1) / (float_test_type)s );
            ref.SetElem(i, 2, a.GetElem(i, 2) / (float_test_type)s );
        }

        r = a / (float_test_type)s;

        Validate(IsSimilar(r, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test162">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        SetFunctionName("operator *= (Matrix33 &m, VecFloatRef<INDEX> a)");

        Matrix33 m, ref;
        float_basic_type s = 2.0f;
        Vector3 svec(s, s, s);
        m.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = m.GetElem(i) * (float_test_type)s;
        }

        m *= svec.X();


        Validate(IsSimilar(m, ref));

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test163">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        SetFunctionName("operator /= (Matrix33 &m, VecFloatRef<INDEX> a)");

        Matrix33 m, ref;
        float_basic_type s = 2.0f;
        Vector3 svec(s, s, s);
        m.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = m.GetElem(i) / (float_test_type)s;
        }

        m /= svec.X();

        Validate(IsSimilar(m, ref));

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test164">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        SetFunctionName("operator * (const Matrix33 &m, const VecFloatRef<INDEX> a)");

        Matrix33 a, r, ref;
        float_basic_type s = 2.0f;
        Vector3 svec(s, s, s);
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        for (int32_t i = 0; i < 3; ++i)
        {
            ref.SetElem(i, 0, a.GetElem(i, 0) * (float_test_type)s );
            ref.SetElem(i, 1, a.GetElem(i, 1) * (float_test_type)s );
            ref.SetElem(i, 2, a.GetElem(i, 2) * (float_test_type)s );
        }

        r = a * svec.X();

        Validate(IsSimilar(r, ref));

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test165">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        SetFunctionName("operator * (const VecFloatRef<INDEX> a, const Matrix33 &b)");

        Matrix33 a, r, ref;
        float_basic_type s = 2.0f;
        Vector3 svec(s, s, s);
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        for (int32_t i = 0; i < 3; ++i)
        {
            ref.SetElem(i, 0, a.GetElem(i, 0) * (float_test_type)s );
            ref.SetElem(i, 1, a.GetElem(i, 1) * (float_test_type)s );
            ref.SetElem(i, 2, a.GetElem(i, 2) * (float_test_type)s );
        }

        r = svec.X() * a;

        Validate(IsSimilar(r, ref));

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test166">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        SetFunctionName("operator / (const Matrix33 &m, const VecFloatRef<INDEX> a)");

        Matrix33 a, r, ref;
        float_basic_type s = 2.0f;
        Vector3 svec(s, s, s);
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        for (int32_t i = 0; i < 3; ++i)
        {
            ref.SetElem(i, 0, a.GetElem(i, 0) / (float_test_type)s );
            ref.SetElem(i, 1, a.GetElem(i, 1) / (float_test_type)s );
            ref.SetElem(i, 2, a.GetElem(i, 2) / (float_test_type)s );
        }

        r = a / svec.X();

        Validate(IsSimilar(r, ref));

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test167">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        SetFunctionName("operator *= (Matrix33 &m, VecFloatRefIndex a)");

        Matrix33 m, ref;
        float_basic_type s = 2.0f;
        Vector3 svec(s, s, s);
        m.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = m.GetElem(i) * (float_test_type)s;
        }

        m *= svec.GetComponent(0);


        Validate(IsSimilar(m, ref));

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test168">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        SetFunctionName("operator /= (Matrix33 &m, VecFloatRefIndex a)");

        Matrix33 m, ref;
        float_basic_type s = 2.0f;
        Vector3 svec(s, s, s);
        m.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        for (int i = 0; i < 9; i++)
        {
            ref.GetElem(i) = m.GetElem(i) / (float_test_type)s;
        }

        m /= svec.GetComponent(0);

        Validate(IsSimilar(m, ref));

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test169">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        SetFunctionName("operator * (const Matrix33 &m, const VecFloatRefIndex a)");

        Matrix33 a, r, ref;
        float_basic_type s = 2.0f;
        Vector3 svec(s, s, s);
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        for (int32_t i = 0; i < 3; ++i)
        {
            ref.SetElem(i, 0, a.GetElem(i, 0) * (float_test_type)s );
            ref.SetElem(i, 1, a.GetElem(i, 1) * (float_test_type)s );
            ref.SetElem(i, 2, a.GetElem(i, 2) * (float_test_type)s );
        }

        r = a * svec.GetComponent(0);

        Validate(IsSimilar(r, ref));

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test170">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        SetFunctionName("operator * (const VecFloatRefIndex a, const Matrix33 &b)");

        Matrix33 a, r, ref;
        float_basic_type s = 2.0f;
        Vector3 svec(s, s, s);
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        for (int32_t i = 0; i < 3; ++i)
        {
            ref.SetElem(i, 0, a.GetElem(i, 0) * (float_test_type)s );
            ref.SetElem(i, 1, a.GetElem(i, 1) * (float_test_type)s );
            ref.SetElem(i, 2, a.GetElem(i, 2) * (float_test_type)s );
        }

        r = svec.GetComponent(0) * a;

        Validate(IsSimilar(r, ref));

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test171">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        SetFunctionName("operator / (const Matrix33 &m, const VecFloatRefIndex a)");

        Matrix33 a, r, ref;
        float_basic_type s = 2.0f;
        Vector3 svec(s, s, s);
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        for (int32_t i = 0; i < 3; ++i)
        {
            ref.SetElem(i, 0, a.GetElem(i, 0) / (float_test_type)s );
            ref.SetElem(i, 1, a.GetElem(i, 1) / (float_test_type)s );
            ref.SetElem(i, 2, a.GetElem(i, 2) / (float_test_type)s );
        }

        r = a / svec.GetComponent(0);

        Validate(IsSimilar(r, ref));

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test172">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator * (const Vector3 &v, const Matrix33 &m)");

        Matrix33 m;
        Vector3 v3, r;
        m.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        v3.Set(2.0f, 3.0f, 4.0f);

        Vector3 ref(
                  m.GetElem(0, 0) * v3.X() + m.GetElem(1, 0) * v3.Y() + m.GetElem(2, 0) * v3.Z(),
                  m.GetElem(0, 1) * v3.X() + m.GetElem(1, 1) * v3.Y() + m.GetElem(2, 1) * v3.Z(),
                  m.GetElem(0, 2) * v3.X() + m.GetElem(1, 2) * v3.Y() + m.GetElem(2, 2) * v3.Z());

        r = v3 * m;

        Validate(IsSimilar(r, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test173">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator *= (Matrix33 &m, const Matrix33 &b)");

        Matrix33 a, b, ref;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        b.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);

        for (int32_t i = 0; i < 3; ++i)
        {
            ref.SetElem(i, 0, a.GetElem(i, 0) * b.GetElem(0, 0) + a.GetElem(i, 1) * b.GetElem(1, 0) + a.GetElem(i, 2) * b.GetElem(2, 0) );
            ref.SetElem(i, 1, a.GetElem(i, 0) * b.GetElem(0, 1) + a.GetElem(i, 1) * b.GetElem(1, 1) + a.GetElem(i, 2) * b.GetElem(2, 1) );
            ref.SetElem(i, 2, a.GetElem(i, 0) * b.GetElem(0, 2) + a.GetElem(i, 1) * b.GetElem(1, 2) + a.GetElem(i, 2) * b.GetElem(2, 2) );
        }

        a *= b;

        Validate(IsSimilar(a, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test174">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator += (Matrix33 &m, const Matrix33 &b)");

        Matrix33 a, b, ref;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        b.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);

        for (int32_t i = 0; i < 3; ++i)
        {
            ref.SetElem(i, 0, a.GetElem(i, 0) + b.GetElem(i, 0) );
            ref.SetElem(i, 1, a.GetElem(i, 1) + b.GetElem(i, 1) );
            ref.SetElem(i, 2, a.GetElem(i, 2) + b.GetElem(i, 2) );
        }

        a += b;

        Validate(IsSimilar(a, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test175">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator -= (Matrix33 &m, const Matrix33 &b)");

        Matrix33 a, b, ref;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        b.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);

        for (int32_t i = 0; i < 3; ++i)
        {
            ref.SetElem(i, 0, a.GetElem(i, 0) - b.GetElem(i, 0) );
            ref.SetElem(i, 1, a.GetElem(i, 1) - b.GetElem(i, 1) );
            ref.SetElem(i, 2, a.GetElem(i, 2) - b.GetElem(i, 2) );
        }

        a -= b;

        Validate(IsSimilar(a, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test176">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator - (const Matrix33 &m)");

        Matrix33 a, r, ref;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        for (int32_t i = 0; i < 3; ++i)
        {
            ref.SetElem(i, 0, -a.GetElem(i, 0) );
            ref.SetElem(i, 1, -a.GetElem(i, 1) );
            ref.SetElem(i, 2, -a.GetElem(i, 2) );
        }

        r = -a;

        Validate(IsSimilar(r, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test177">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator + (const Matrix33 &a, const Matrix33 &b)");

        Matrix33 a, b, r, ref;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        b.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);

        for (int32_t i = 0; i < 3; ++i)
        {
            ref.SetElem(i, 0, a.GetElem(i, 0) + b.GetElem(i, 0) );
            ref.SetElem(i, 1, a.GetElem(i, 1) + b.GetElem(i, 1) );
            ref.SetElem(i, 2, a.GetElem(i, 2) + b.GetElem(i, 2) );
        }

        r = a + b;

        Validate(IsSimilar(r, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test178">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator - (const Matrix33 &a, const Matrix33 &b)");

        Matrix33 a, b, r, ref;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        b.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);

        for (int32_t i = 0; i < 3; ++i)
        {
            ref.SetElem(i, 0, a.GetElem(i, 0) - b.GetElem(i, 0) );
            ref.SetElem(i, 1, a.GetElem(i, 1) - b.GetElem(i, 1) );
            ref.SetElem(i, 2, a.GetElem(i, 2) - b.GetElem(i, 2) );
        }

        r = a - b;

        Validate(IsSimilar(r, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test179">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator * (const Matrix33 &a, const Matrix33 &b)");

        Matrix33 a, b, r, ref;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        b.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);

        for (int32_t i = 0; i < 3; ++i)
        {
            ref.SetElem(i, 0, a.GetElem(i, 0) * b.GetElem(0, 0) + a.GetElem(i, 1) * b.GetElem(1, 0) + a.GetElem(i, 2) * b.GetElem(2, 0) );
            ref.SetElem(i, 1, a.GetElem(i, 0) * b.GetElem(0, 1) + a.GetElem(i, 1) * b.GetElem(1, 1) + a.GetElem(i, 2) * b.GetElem(2, 1) );
            ref.SetElem(i, 2, a.GetElem(i, 0) * b.GetElem(0, 2) + a.GetElem(i, 1) * b.GetElem(1, 2) + a.GetElem(i, 2) * b.GetElem(2, 2) );
        }

        r = a * b;

        Validate(IsSimilar(r, ref));

#endif

      ]]>
      </TEST>


      <TEST NAME="test180">
      <![CDATA[

        SetFunctionName("operator == (const Matrix33 &a, const Matrix33 &b)");

        Matrix33 a, b, c;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        b.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        c.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);

        Validate(a == b && !(a == c));

      ]]>
      </TEST>


      <TEST NAME="test181">
      <![CDATA[

        SetFunctionName("operator != (const Matrix33 &a, const Matrix33 &b)");

        Matrix33 a, b, c;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        b.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);
        c.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);

        Validate(!(a != b) && a != c);

      ]]>
      </TEST>

      <TEST NAME="IsOrthogonalTest1">
      <![CDATA[

        SetFunctionName("Test for BUG#17316: IsOrthogonal(const Matrix33& a) should return false for zero matrix");

        Matrix33 zero;
        zero.SetZero();

        Validate(!IsOrthogonal(zero));

      ]]>
      </TEST>

      <TEST NAME="GetOrthogonalErrorTest">
      <![CDATA[

        SetFunctionName("GetOrthogonalError(Matrix33 matrix)");
        Matrix33 mat(
            1.1f, 0.0f, 0.1f,
            0.1f, 1.0f, 0.0f,
            0.0f, 0.0f, 1.0f
        );

        float_test_type r = GetOrthogonalError(mat);

        Validate(IsSimilar(r, (float_test_type) 0.00521909f));

      ]]>
      </TEST>

      <TEST NAME="IsOrthogonalTest2">
      <![CDATA[

        SetFunctionName("IsOrthogonal(Matrix33 matrix)");

        Matrix33 mat1(
            0.2672612f, 0.5345225f,    0.8017837f,
            0.0f,       1.0f,          0.0f,
            0.0f,       0.0f,          1.0f
        );

        Matrix33 mat2(
            1.0f, 0.3f, 0.0f,
            0.0f, 1.0f, 0.0f,
            0.0f, 0.0f, 1.0f
        );

        // orthogonal matrix
        Matrix33 mat3(
             0.3333333f,  0.6666667f,  0.6666667f,
            -0.8944272f,  0.4472136f,  0.0f,
            -0.2981424f, -0.5962848f,  0.7453560f
        );

        Validate(
            !IsOrthogonal(mat1, (float_test_type) 0.001f) &&
            !IsOrthogonal(mat2, (float_test_type) 0.001f) &&
             IsOrthogonal(mat3, (float_test_type) 0.001f) );

      ]]>
      </TEST>

      <TEST NAME="isrotation">
      <![CDATA[

        SetFunctionName("IsRotation(m)");
        Matrix33 testMat1(Matrix33FromEulerXYZ(Vector3(1.0f, 2.0f, 3.0f)));
        Matrix33 testMat2(-1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f);
        Matrix33 testMat3(2.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f);

        bool isRot1 = IsRotation(testMat1, float_test_type(SMALL_FLOAT));
        bool isRot2 = IsRotation(testMat2, float_test_type(SMALL_FLOAT));
        bool isRot3 = IsRotation(testMat3, float_test_type(SMALL_FLOAT));


        Validate( isRot1 &&
                 !isRot2 &&
                 !isRot3 );
      ]]>
      </TEST>

    </TYPE>

    <TYPE NAME="performance">

      <TEST NAME="test182">
      <![CDATA[

        SetFunctionName("operator == (const Matrix33 &a, const Matrix33 &b)");

        Matrix33 a;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                retValueBool = a == m33_operator_array[i];
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test183">
      <![CDATA[

        SetFunctionName("operator != (const Matrix33 &a, const Matrix33 &b)");

        Matrix33 a;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                retValueBool = a != m33_operator_array[i];
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test184">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator *= (Matrix33 &m, float_t a)");

        float_test_type s = 2.1f;

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                m33_operator_array[i] *= s;
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


      <TEST NAME="test185">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator /= (Matrix33 &m, float_t a)");

        float_test_type s = 2.1f;

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                m33_operator_array[i] /= s;
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


      <TEST NAME="test186">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator /= (Matrix33 &m, float_t a)");

        float_test_type s = 2.1f;

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                m33_operator_array[i] /= s;
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


      <TEST NAME="test187">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator *= (Matrix33 &m, const Matrix33 &b)");

        Matrix33 a;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                m33_operator_array[i] *= a;
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


      <TEST NAME="test188">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator += (Matrix33 &m, const Matrix33 &b)");

        Matrix33 a;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                m33_operator_array[i] += a;
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


      <TEST NAME="test189">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator -= (Matrix33 &m, const Matrix33 &b)");

        Matrix33 a;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                m33_operator_array[i] -= a;
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


      <TEST NAME="test190">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator - (const Matrix33 &m)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                matResult = -m33_operator_array[i];
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


      <TEST NAME="test191">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator * (const Matrix33 &m, const float_t a)");

        float_test_type s = 2.1f;

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                matResult = m33_operator_array[i] * s;
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


      <TEST NAME="test192">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator / (const Matrix33 &m, const float_t a)");

        float_test_type s = 2.1f;

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                matResult = m33_operator_array[i] / s;
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


      <TEST NAME="test193">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator + (const Matrix33 &a, const Matrix33 &b)");

        Matrix33 a;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                matResult = m33_operator_array[i] + a;
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


      <TEST NAME="test194">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator - (const Matrix33 &a, const Matrix33 &b)");

        Matrix33 a;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                matResult = m33_operator_array[i] - a;
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


      <TEST NAME="test195">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator * (const Matrix33 &a, const Matrix33 &b)");

        Matrix33 a;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f);

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                matResult = m33_operator_array[i] * a;
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


      <TEST NAME="test196">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator * (const Vector3 &v, const Matrix33 &m)");

        Vector3 v3;
        v3.Set(1.2f, 2.1f, 5.3f);

        StartTimer(testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE; i++)
            {
                vecResult = v3 * m33_operator_array[i];
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>

     </TYPE>

   </TYPE>

</CLASS>

</TESTCLASS>
