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

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

  <TYPE NAME="class">

    <TYPE NAME="correctness">

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



        SetFunctionName("Matrix44(float m0, ..., float m15)");
        Matrix44 m(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.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) &&
                m.GetElem( 9) == float_test_type(11.0f) &&
                m.GetElem(10) == float_test_type(12.0f) &&
                m.GetElem(11) == float_test_type(13.0f) &&
                m.GetElem(12) == float_test_type(14.0f) &&
                m.GetElem(13) == float_test_type(15.0f) &&
                m.GetElem(14) == float_test_type(16.0f) &&
                m.GetElem(15) == float_test_type(17.0f)
                );



      ]]>
      </TEST>


      <TEST NAME="matrix44_vecfloat_construction">
      <![CDATA[
        #ifdef HOST_TESTING

        SetFunctionName("Matrix44(VecFloat m0, ..., VecFloat m15)");
        Matrix44 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), VecFloat(11.0f), VecFloat(12.0f), VecFloat(13.0f), VecFloat(14.0f), VecFloat(15.0f), VecFloat(16.0f), VecFloat(17.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) &&
                m.GetElem( 9) == VecFloat(11.0f) &&
                m.GetElem(10) == VecFloat(12.0f) &&
                m.GetElem(11) == VecFloat(13.0f) &&
                m.GetElem(12) == VecFloat(14.0f) &&
                m.GetElem(13) == VecFloat(15.0f) &&
                m.GetElem(14) == VecFloat(16.0f) &&
                m.GetElem(15) == VecFloat(17.0f)
                );

        #endif
      ]]>
      </TEST>


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



        SetFunctionName("Matrix44(Matrix44&)");
        Matrix44 m(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
    Matrix44 mat(m);
        Validate(
                mat.GetElem( 0) == float_test_type( 2.0f) &&
                mat.GetElem( 1) == float_test_type( 3.0f) &&
                mat.GetElem( 2) == float_test_type( 4.0f) &&
                mat.GetElem( 3) == float_test_type( 5.0f) &&
                mat.GetElem( 4) == float_test_type( 6.0f) &&
                mat.GetElem( 5) == float_test_type( 7.0f) &&
                mat.GetElem( 6) == float_test_type( 8.0f) &&
                mat.GetElem( 7) == float_test_type( 9.0f) &&
                mat.GetElem( 8) == float_test_type(10.0f) &&
                mat.GetElem( 9) == float_test_type(11.0f) &&
                mat.GetElem(10) == float_test_type(12.0f) &&
                mat.GetElem(11) == float_test_type(13.0f) &&
                mat.GetElem(12) == float_test_type(14.0f) &&
                mat.GetElem(13) == float_test_type(15.0f) &&
                mat.GetElem(14) == float_test_type(16.0f) &&
                mat.GetElem(15) == float_test_type(17.0f)
                );



      ]]>
      </TEST>


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



        SetFunctionName("Matrix44(Matrix44Affine&)");
        Matrix44Affine m(2.0f, 3.0f, 4.0f, 6.0f, 7.0f, 8.0f, 10.0f, 11.0f, 12.0f, 14.0f, 15.0f, 16.0f);
        Matrix44 mat(m);
        Validate(
                mat.GetElem( 0) == float_test_type( 2.0f) &&
                mat.GetElem( 1) == float_test_type( 3.0f) &&
                mat.GetElem( 2) == float_test_type( 4.0f) &&
                mat.GetElem( 3) == float_test_type( 0.0f) &&

                mat.GetElem( 4) == float_test_type( 6.0f) &&
                mat.GetElem( 5) == float_test_type( 7.0f) &&
                mat.GetElem( 6) == float_test_type( 8.0f) &&
                mat.GetElem( 7) == float_test_type( 0.0f) &&

                mat.GetElem( 8) == float_test_type(10.0f) &&
                mat.GetElem( 9) == float_test_type(11.0f) &&
                mat.GetElem(10) == float_test_type(12.0f) &&
                mat.GetElem(11) == float_test_type( 0.0f) &&

                mat.GetElem(12) == float_test_type(14.0f) &&
                mat.GetElem(13) == float_test_type(15.0f) &&
                mat.GetElem(14) == float_test_type(16.0f) &&
                mat.GetElem(15) == float_test_type( 1.0f)
                );



      ]]>
      </TEST>


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



        SetFunctionName("Matrix44(Matrix44AffinePacked&)");
        Matrix44AffinePacked m(2.0f, 3.0f, 4.0f, 6.0f, 7.0f, 8.0f, 10.0f, 11.0f, 12.0f, 14.0f, 15.0f, 16.0f);
        Matrix44 mat(m);
        Validate(
                mat.GetElem( 0) == float_test_type( 2.0f) &&
                mat.GetElem( 1) == float_test_type( 3.0f) &&
                mat.GetElem( 2) == float_test_type( 4.0f) &&
                mat.GetElem( 3) == float_test_type( 0.0f) &&

                mat.GetElem( 4) == float_test_type( 6.0f) &&
                mat.GetElem( 5) == float_test_type( 7.0f) &&
                mat.GetElem( 6) == float_test_type( 8.0f) &&
                mat.GetElem( 7) == float_test_type( 0.0f) &&

                mat.GetElem( 8) == float_test_type(10.0f) &&
                mat.GetElem( 9) == float_test_type(11.0f) &&
                mat.GetElem(10) == float_test_type(12.0f) &&
                mat.GetElem(11) == float_test_type( 0.0f) &&

                mat.GetElem(12) == float_test_type(14.0f) &&
                mat.GetElem(13) == float_test_type(15.0f) &&
                mat.GetElem(14) == float_test_type(16.0f) &&
                mat.GetElem(15) == float_test_type( 1.0f)
                );



      ]]>
      </TEST>


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


#ifdef HOST_TESTING

        SetFunctionName("Matrix44(const fpu::Matrix44Template<FloatClassRHS> &_m)");

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

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

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

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

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

#endif


      ]]>
      </TEST>


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

        SetFunctionName("Matrix44(const FloatClass m[16])");
#ifdef HOST_TESTING

        MakeVectorIntrinsic(fVec0, 2.0f, 3.0f, 4.0f, 5.0f);
        MakeVectorIntrinsic(fVec1, 6.0f, 7.0f, 8.0f, 9.0f);
        MakeVectorIntrinsic(fVec2, 10.0f, 11.0f, 12.0f, 13.0f);
        MakeVectorIntrinsic(fVec3, 14.0f, 15.0f, 16.0f, 17.0f);
        union FourVectorIntrinsicUnion
        {
            VectorIntrinsic vectors[4];
            float floatData[16];
        };
        FourVectorIntrinsicUnion data;
        data.vectors[0] = fVec0;
        data.vectors[1] = fVec1;
        data.vectors[2] = fVec2;
        data.vectors[3] = fVec3;
        float *fPtr = &data.floatData[0];
        Matrix44 m(fPtr);
#else
        float_basic_type fArray[16]={2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f};
        Matrix44 m(fArray);
#endif
        
        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) &&
                m.GetElem( 9) == float_test_type(11.0f) &&
                m.GetElem(10) == float_test_type(12.0f) &&
                m.GetElem(11) == float_test_type(13.0f) &&
                m.GetElem(12) == float_test_type(14.0f) &&
                m.GetElem(13) == float_test_type(15.0f) &&
                m.GetElem(14) == float_test_type(16.0f) &&
                m.GetElem(15) == float_test_type(17.0f)
                );

      ]]>
      </TEST>


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



        SetFunctionName("Matrix44(Vector4&, Vector4&, Vector4&, Vector4&)");
        Vector4 v1(2.0f, 3.0f, 4.0f, 5.0f);
        Vector4 v2(6.0f, 7.0f, 8.0f, 9.0f);
        Vector4 v3(10.0f, 11.0f, 12.0f, 13.0f);
        Vector4 v4(14.0f, 15.0f, 16.0f, 17.0f);
        Matrix44 m(v1, v2, v3, v4);
        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) &&
                m.GetElem( 9) == float_test_type(11.0f) &&
                m.GetElem(10) == float_test_type(12.0f) &&
                m.GetElem(11) == float_test_type(13.0f) &&
                m.GetElem(12) == float_test_type(14.0f) &&
                m.GetElem(13) == float_test_type(15.0f) &&
                m.GetElem(14) == float_test_type(16.0f) &&
                m.GetElem(15) == float_test_type(17.0f)
                );



      ]]>
      </TEST>


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



        SetFunctionName("SetZero()");

        Matrix44 m;
        m.SetZero();

        Validate(IsSimilar(m, GetMatrix44_Zero()));



      ]]>
      </TEST>


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



        SetFunctionName("SetIdentity()");

        Matrix44 m;
        m.SetIdentity();

        Validate(IsSimilar(m, GetMatrix44_Identity()));



      ]]>
      </TEST>


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



        SetFunctionName("Set(float m0, ... float m15)");

        Matrix44 m;
        m.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.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) &&
                m.GetElem( 9) == float_test_type(11.0f) &&
                m.GetElem(10) == float_test_type(12.0f) &&
                m.GetElem(11) == float_test_type(13.0f) &&
                m.GetElem(12) == float_test_type(14.0f) &&
                m.GetElem(13) == float_test_type(15.0f) &&
                m.GetElem(14) == float_test_type(16.0f) &&
                m.GetElem(15) == float_test_type(17.0f)
                );



      ]]>
      </TEST>


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



        SetFunctionName("Set(Vector4, Vector4, Vector4, Vector4)");

        Vector4 v1( 2.0f,  3.0f,  4.0f,  5.0f);
        Vector4 v2( 6.0f,  7.0f,  8.0f,  9.0f);
        Vector4 v3(10.0f, 11.0f, 12.0f, 13.0f);
        Vector4 v4(14.0f, 15.0f, 16.0f, 17.0f);

        Matrix44 m;
        m.Set(v1,v2,v3,v4);

        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) &&
            m.GetElem( 9) == float_test_type(11.0f) &&
            m.GetElem(10) == float_test_type(12.0f) &&
            m.GetElem(11) == float_test_type(13.0f) &&
            m.GetElem(12) == float_test_type(14.0f) &&
            m.GetElem(13) == float_test_type(15.0f) &&
            m.GetElem(14) == float_test_type(16.0f) &&
            m.GetElem(15) == float_test_type(17.0f)
            );



      ]]>
      </TEST>


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



        SetFunctionName("SetElem(int, float), GetElem(int i)");

        Matrix44 m;
        m.SetZero();
        m.SetElem( 0,float_test_type( 2.0f) );
        m.SetElem( 1,float_test_type( 3.0f) );
        m.SetElem( 2,float_test_type( 4.0f) );
        m.SetElem( 3,float_test_type( 5.0f) );
        m.SetElem( 4,float_test_type( 6.0f) );
        m.SetElem( 5,float_test_type( 7.0f) );
        m.SetElem( 6,float_test_type( 8.0f) );
        m.SetElem( 7,float_test_type( 9.0f) );
        m.SetElem( 8,float_test_type(10.0f) );
        m.SetElem( 9,float_test_type(11.0f) );
        m.SetElem(10,float_test_type(12.0f) );
        m.SetElem(11,float_test_type(13.0f) );
        m.SetElem(12,float_test_type(14.0f) );
        m.SetElem(13,float_test_type(15.0f) );
        m.SetElem(14,float_test_type(16.0f) );
        m.SetElem(15,float_test_type(17.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) &&
            m.GetElem( 9) == float_test_type(11.0f) &&
            m.GetElem(10) == float_test_type(12.0f) &&
            m.GetElem(11) == float_test_type(13.0f) &&
            m.GetElem(12) == float_test_type(14.0f) &&
            m.GetElem(13) == float_test_type(15.0f) &&
            m.GetElem(14) == float_test_type(16.0f) &&
            m.GetElem(15) == float_test_type(17.0f)
            );



      ]]>
      </TEST>


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



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

        Matrix44 m;
        m.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);

        Validate(
            ((const Matrix44*)(&m))->GetElem( 0) ==float_test_type(  2.0f) &&
            ((const Matrix44*)(&m))->GetElem( 1) ==float_test_type(  3.0f) &&
            ((const Matrix44*)(&m))->GetElem( 2) ==float_test_type(  4.0f) &&
            ((const Matrix44*)(&m))->GetElem( 3) ==float_test_type(  5.0f) &&
            ((const Matrix44*)(&m))->GetElem( 4) ==float_test_type(  6.0f) &&
            ((const Matrix44*)(&m))->GetElem( 5) ==float_test_type(  7.0f) &&
            ((const Matrix44*)(&m))->GetElem( 6) ==float_test_type(  8.0f) &&
            ((const Matrix44*)(&m))->GetElem( 7) ==float_test_type(  9.0f) &&
            ((const Matrix44*)(&m))->GetElem( 8) ==float_test_type( 10.0f) &&
            ((const Matrix44*)(&m))->GetElem( 9) ==float_test_type( 11.0f) &&
            ((const Matrix44*)(&m))->GetElem(10) ==float_test_type( 12.0f) &&
            ((const Matrix44*)(&m))->GetElem(11) ==float_test_type( 13.0f) &&
            ((const Matrix44*)(&m))->GetElem(12) ==float_test_type( 14.0f) &&
            ((const Matrix44*)(&m))->GetElem(13) ==float_test_type( 15.0f) &&
            ((const Matrix44*)(&m))->GetElem(14) ==float_test_type( 16.0f) &&
            ((const Matrix44*)(&m))->GetElem(15) ==float_test_type( 17.0f)
            );



      ]]>
      </TEST>


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



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

        Matrix44 m;
        m.SetZero();
        m.SetElem(0,0,float_test_type( 2.0f) );
        m.SetElem(0,1,float_test_type( 3.0f) );
        m.SetElem(0,2,float_test_type( 4.0f) );
        m.SetElem(0,3,float_test_type( 5.0f) );
        m.SetElem(1,0,float_test_type( 6.0f) );
        m.SetElem(1,1,float_test_type( 7.0f) );
        m.SetElem(1,2,float_test_type( 8.0f) );
        m.SetElem(1,3,float_test_type( 9.0f) );
        m.SetElem(2,0,float_test_type(10.0f) );
        m.SetElem(2,1,float_test_type(11.0f) );
        m.SetElem(2,2,float_test_type(12.0f) );
        m.SetElem(2,3,float_test_type(13.0f) );
        m.SetElem(3,0,float_test_type(14.0f) );
        m.SetElem(3,1,float_test_type(15.0f) );
        m.SetElem(3,2,float_test_type(16.0f) );
        m.SetElem(3,3,float_test_type(17.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(0, 3) == float_test_type( 5.0f) &&
            m.GetElem(1, 0) == float_test_type( 6.0f) &&
            m.GetElem(1, 1) == float_test_type( 7.0f) &&
            m.GetElem(1, 2) == float_test_type( 8.0f) &&
            m.GetElem(1, 3) == float_test_type( 9.0f) &&
            m.GetElem(2, 0) == float_test_type(10.0f) &&
            m.GetElem(2, 1) == float_test_type(11.0f) &&
            m.GetElem(2, 2) == float_test_type(12.0f) &&
            m.GetElem(2, 3) == float_test_type(13.0f) &&
            m.GetElem(3, 0) == float_test_type(14.0f) &&
            m.GetElem(3, 1) == float_test_type(15.0f) &&
            m.GetElem(3, 2) == float_test_type(16.0f) &&
            m.GetElem(3, 3) == float_test_type(17.0f)
            );



      ]]>
      </TEST>


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



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

        Matrix44 m;
        m.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);

        Validate(
            ((const Matrix44*)(&m))->GetElem(0, 0) == float_test_type( 2.0f) &&
            ((const Matrix44*)(&m))->GetElem(0, 1) == float_test_type( 3.0f) &&
            ((const Matrix44*)(&m))->GetElem(0, 2) == float_test_type( 4.0f) &&
            ((const Matrix44*)(&m))->GetElem(0, 3) == float_test_type( 5.0f) &&
            ((const Matrix44*)(&m))->GetElem(1, 0) == float_test_type( 6.0f) &&
            ((const Matrix44*)(&m))->GetElem(1, 1) == float_test_type( 7.0f) &&
            ((const Matrix44*)(&m))->GetElem(1, 2) == float_test_type( 8.0f) &&
            ((const Matrix44*)(&m))->GetElem(1, 3) == float_test_type( 9.0f) &&
            ((const Matrix44*)(&m))->GetElem(2, 0) == float_test_type(10.0f) &&
            ((const Matrix44*)(&m))->GetElem(2, 1) == float_test_type(11.0f) &&
            ((const Matrix44*)(&m))->GetElem(2, 2) == float_test_type(12.0f) &&
            ((const Matrix44*)(&m))->GetElem(2, 3) == float_test_type(13.0f) &&
            ((const Matrix44*)(&m))->GetElem(3, 0) == float_test_type(14.0f) &&
            ((const Matrix44*)(&m))->GetElem(3, 1) == float_test_type(15.0f) &&
            ((const Matrix44*)(&m))->GetElem(3, 2) == float_test_type(16.0f) &&
            ((const Matrix44*)(&m))->GetElem(3, 3) == float_test_type(17.0f)
            );



      ]]>
      </TEST>


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



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

        Matrix44 m;
        m.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.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()(0, 3) == float_test_type( 5.0f) &&
            m.operator()(1, 0) == float_test_type( 6.0f) &&
            m.operator()(1, 1) == float_test_type( 7.0f) &&
            m.operator()(1, 2) == float_test_type( 8.0f) &&
            m.operator()(1, 3) == float_test_type( 9.0f) &&
            m.operator()(2, 0) == float_test_type(10.0f) &&
            m.operator()(2, 1) == float_test_type(11.0f) &&
            m.operator()(2, 2) == float_test_type(12.0f) &&
            m.operator()(2, 3) == float_test_type(13.0f) &&
            m.operator()(3, 0) == float_test_type(14.0f) &&
            m.operator()(3, 1) == float_test_type(15.0f) &&
            m.operator()(3, 2) == float_test_type(16.0f) &&
            m.operator()(3, 3) == float_test_type(17.0f)
            );



      ]]>
      </TEST>


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



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

        Matrix44 m;
        m.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);

        Validate(
            ((const Matrix44*)(&m))->operator()(0, 0) == float_test_type( 2.0f) &&
            ((const Matrix44*)(&m))->operator()(0, 1) == float_test_type( 3.0f) &&
            ((const Matrix44*)(&m))->operator()(0, 2) == float_test_type( 4.0f) &&
            ((const Matrix44*)(&m))->operator()(0, 3) == float_test_type( 5.0f) &&
            ((const Matrix44*)(&m))->operator()(1, 0) == float_test_type( 6.0f) &&
            ((const Matrix44*)(&m))->operator()(1, 1) == float_test_type( 7.0f) &&
            ((const Matrix44*)(&m))->operator()(1, 2) == float_test_type( 8.0f) &&
            ((const Matrix44*)(&m))->operator()(1, 3) == float_test_type( 9.0f) &&
            ((const Matrix44*)(&m))->operator()(2, 0) == float_test_type(10.0f) &&
            ((const Matrix44*)(&m))->operator()(2, 1) == float_test_type(11.0f) &&
            ((const Matrix44*)(&m))->operator()(2, 2) == float_test_type(12.0f) &&
            ((const Matrix44*)(&m))->operator()(2, 3) == float_test_type(13.0f) &&
            ((const Matrix44*)(&m))->operator()(3, 0) == float_test_type(14.0f) &&
            ((const Matrix44*)(&m))->operator()(3, 1) == float_test_type(15.0f) &&
            ((const Matrix44*)(&m))->operator()(3, 2) == float_test_type(16.0f) &&
            ((const Matrix44*)(&m))->operator()(3, 3) == float_test_type(17.0f)
            );



      ]]>
      </TEST>


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



        SetFunctionName("GetRow(0)");

        Matrix44 m(
            1.0f, 1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f, 3.0f,
            4.0f, 4.0f, 4.0f, 4.0f
            );
        Vector4 &r = m.GetRow(0);

        float rf = 1.0f;
        Validate( r == Vector4(rf, rf, rf, rf));



      ]]>
      </TEST>


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



        Matrix44 m(
            1.0f, 1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f, 3.0f,
            4.0f, 4.0f, 4.0f, 4.0f
            );

        SetFunctionName("GetRow(1)");
        Vector4 &r2 = m.GetRow(1);
        Validate(r2 == Vector4(2.0f, 2.0f, 2.0f, 2.0f));



      ]]>
      </TEST>


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



        Matrix44 m(
            1.0f, 1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f, 3.0f,
            4.0f, 4.0f, 4.0f, 4.0f
            );

        SetFunctionName("GetRow(2)");
        Vector4 &r3 = m.GetRow(2);
        Validate(r3 == Vector4(3.0f, 3.0f, 3.0f, 3.0f));



      ]]>
      </TEST>


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



        Matrix44 m(
            1.0f, 1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f, 3.0f,
            4.0f, 4.0f, 4.0f, 4.0f
            );

        SetFunctionName("GetRow(3)");
        Vector4 &r4 = m.GetRow(3);
        Validate(r4 == Vector4(4.0f, 4.0f, 4.0f, 4.0f));



      ]]>
      </TEST>


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



        Matrix44 m;
        Vector4 v1(2.0f, 3.0f, 4.0f, 5.0f);

        SetFunctionName("SetRow(0)");
        m.SetRow(0, v1);
        Validate(m.GetRow(0) == v1);



      ]]>
      </TEST>


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



        Matrix44 m;
        Vector4 v2(6.0f, 7.0f, 8.0f, 9.0f);

        SetFunctionName("XAxis() = vector4");
        m.XAxis() = v2;
        Validate(m.GetRow(0) == v2);



      ]]>
      </TEST>


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



        Matrix44 m;
        Vector4 v2(6.0f, 7.0f, 8.0f, 9.0f);

        SetFunctionName("SetRow(1)");
        m.SetRow(1, v2);
        Validate(m.GetRow(1) == v2);



      ]]>
      </TEST>


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



        Matrix44 m;
        Vector4 v1(2.0f, 3.0f, 4.0f, 5.0f);

        SetFunctionName("YAxis() = vector4");
        m.YAxis() = v1;

        Validate(m.GetRow(1) == v1);



      ]]>
      </TEST>


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



        Matrix44 m;
        Vector4 v3(10.0f, 11.0f, 12.0f, 13.0f);

        SetFunctionName("SetRow(2)");
        m.SetRow(2, v3);
        Validate(m.GetRow(2) == v3);



      ]]>
      </TEST>


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



        Matrix44 m;
        Vector4 v2(6.0f, 7.0f, 8.0f, 9.0f);

        SetFunctionName("ZAxis() = vector4");
        m.ZAxis() = v2;
        Validate(m.GetRow(2) == v2);



      ]]>
      </TEST>


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



        Matrix44 m;
        Vector4 v4(14.0f, 15.0f, 16.0f, 17.0f);

        SetFunctionName("SetRow(3)");
        m.SetRow(3, v4);
        Validate(m.GetRow(3) == v4);



      ]]>
      </TEST>


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



        Matrix44 m;
        Vector4 v2(6.0f, 7.0f, 8.0f, 9.0f);

        SetFunctionName("WAxis() = vector4");
        m.WAxis() = v2;
        Validate(m.GetRow(3) == v2);



      ]]>
      </TEST>


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



        SetFunctionName("GetRow(0) const");

        const Matrix44 m(
            1.0f, 1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f, 3.0f,
            4.0f, 4.0f, 4.0f, 4.0f
            );
        const Vector4 &r = m.GetRow(0);

        float rf = 1.0f;
        Validate( r == Vector4(rf, rf, rf, rf));



      ]]>
      </TEST>


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



        const Matrix44 m(
            1.0f, 1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f, 3.0f,
            4.0f, 4.0f, 4.0f, 4.0f
            );

        SetFunctionName("GetRow(1) const");
        const Vector4 &r2 = m.GetRow(1);
        Validate(r2 == Vector4(2.0f, 2.0f, 2.0f, 2.0f));



      ]]>
      </TEST>


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



        const Matrix44 m(
            1.0f, 1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f, 3.0f,
            4.0f, 4.0f, 4.0f, 4.0f
            );

        SetFunctionName("GetRow(2) const");
        const Vector4 &r3 = m.GetRow(2);
        Validate(r3 == Vector4(3.0f, 3.0f, 3.0f, 3.0f));



      ]]>
      </TEST>


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



        const Matrix44 m(
            1.0f, 1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f, 3.0f,
            4.0f, 4.0f, 4.0f, 4.0f
            );

        SetFunctionName("GetRow(3) const");
        const Vector4 &r4 = m.GetRow(3);
        Validate(r4 == Vector4(4.0f, 4.0f, 4.0f, 4.0f));



      ]]>
      </TEST>


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



        SetFunctionName("XAxis()");

        Matrix44 m(
            1.0f, 1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f, 3.0f,
            4.0f, 4.0f, 4.0f, 4.0f
            );
        Vector4 &r = m.XAxis();

        float rf = 1.0f;
        Validate( r == Vector4(rf, rf, rf, rf));



      ]]>
      </TEST>


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



        SetFunctionName("YAxis()");

        Matrix44 m(
            1.0f, 1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f, 3.0f,
            4.0f, 4.0f, 4.0f, 4.0f
            );
        Vector4 &r = m.YAxis();

        float rf = 2.0f;
        Validate( r == Vector4(rf, rf, rf, rf));



      ]]>
      </TEST>


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



        SetFunctionName("ZAxis()");

        Matrix44 m(
            1.0f, 1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f, 3.0f,
            4.0f, 4.0f, 4.0f, 4.0f
            );
        Vector4 &r = m.ZAxis();

        float rf = 3.0f;
        Validate( r == Vector4(rf, rf, rf, rf));



      ]]>
      </TEST>


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



        SetFunctionName("WAxis()");

        Matrix44 m(
            1.0f, 1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f, 3.0f,
            4.0f, 4.0f, 4.0f, 4.0f
            );
        Vector4 &r = m.WAxis();

        float rf = 4.0f;
        Validate( r == Vector4(rf, rf, rf, rf));



      ]]>
      </TEST>


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



        SetFunctionName("XAxis() const");

        const Matrix44 m(
            1.0f, 1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f, 3.0f,
            4.0f, 4.0f, 4.0f, 4.0f
            );
        const Vector4 &r = m.XAxis();

        float rf = 1.0f;
        Validate( r == Vector4(rf, rf, rf, rf));



      ]]>
      </TEST>


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



        SetFunctionName("YAxis() const");

        const Matrix44 m(
            1.0f, 1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f, 3.0f,
            4.0f, 4.0f, 4.0f, 4.0f
            );
        const Vector4 &r = m.YAxis();

        float rf = 2.0f;
        Validate( r == Vector4(rf, rf, rf, rf));



      ]]>
      </TEST>


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



        SetFunctionName("ZAxis() const");

        const Matrix44 m(
            1.0f, 1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f, 3.0f,
            4.0f, 4.0f, 4.0f, 4.0f
            );
        const Vector4 &r = m.ZAxis();

        float rf = 3.0f;
        Validate( r == Vector4(rf, rf, rf, rf));



      ]]>
      </TEST>


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



        SetFunctionName("WAxis() const");

        const Matrix44 m(
            1.0f, 1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f, 3.0f,
            4.0f, 4.0f, 4.0f, 4.0f
            );
        const Vector4 &r = m.WAxis();

        float rf = 4.0f;
        Validate( r == Vector4(rf, rf, rf, rf));



      ]]>
      </TEST>

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

        Vector4 v2(6.0f, 7.0f, 8.0f, 9.0f);
        Matrix44 m(
            1.0f, 1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f, 3.0f,
            4.0f, 4.0f, 4.0f, 4.0f
            );

        SetFunctionName("Right() = vector4");
        m.Right() = v2;
        Validate(m.GetRow(0) == v2);

      ]]>
      </TEST>

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

        Vector4 v1(2.0f, 3.0f, 4.0f, 5.0f);
        Matrix44 m(
            1.0f, 1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f, 3.0f,
            4.0f, 4.0f, 4.0f, 4.0f
            );

        SetFunctionName("Up() = vector4");
        m.Up() = v1;
        Validate(m.GetRow(1) == v1);

      ]]>
      </TEST>

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

        Vector4 v2(6.0f, 7.0f, 8.0f, 9.0f);
        Matrix44 m(
            1.0f, 1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f, 3.0f,
            4.0f, 4.0f, 4.0f, 4.0f
            );

        SetFunctionName("At() = vector4");
        m.At() = v2;
        Validate(m.GetRow(2) == v2);

      ]]>
      </TEST>

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

        Vector4 v2(6.0f, 7.0f, 8.0f, 9.0f);
        Matrix44 m(
            1.0f, 1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f, 3.0f,
            4.0f, 4.0f, 4.0f, 4.0f
            );

        SetFunctionName("Pos() = vector4");
        m.Pos() = v2;
        Validate(m.GetRow(3) == v2);

      ]]>
      </TEST>



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

        SetFunctionName("Right()");

        Matrix44 m(
            1.0f, 1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f, 3.0f,
            4.0f, 4.0f, 4.0f, 4.0f
            );
        Vector4 &r = m.Right();

        float rf = 1.0f;
        Validate( r == Vector4(rf, rf, rf, rf));

      ]]>
      </TEST>


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

        SetFunctionName("Up()");

        Matrix44 m(
            1.0f, 1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f, 3.0f,
            4.0f, 4.0f, 4.0f, 4.0f
            );
        Vector4 &r = m.Up();

        float rf = 2.0f;
        Validate( r == Vector4(rf, rf, rf, rf));

      ]]>
      </TEST>


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

        SetFunctionName("At()");

        Matrix44 m(
            1.0f, 1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f, 3.0f,
            4.0f, 4.0f, 4.0f, 4.0f
            );
        Vector4 &r = m.At();

        float rf = 3.0f;
        Validate( r == Vector4(rf, rf, rf, rf));

      ]]>
      </TEST>


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

        SetFunctionName("Pos()");

        Matrix44 m(
            1.0f, 1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f, 3.0f,
            4.0f, 4.0f, 4.0f, 4.0f
            );
        Vector4 &r = m.Pos();

        float rf = 4.0f;
        Validate( r == Vector4(rf, rf, rf, rf));

      ]]>
      </TEST>


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

        SetFunctionName("Right() const");

        const Matrix44 m(
            1.0f, 1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f, 3.0f,
            4.0f, 4.0f, 4.0f, 4.0f
            );
        const Vector4 &r = m.Right();

        float rf = 1.0f;
        Validate( r == Vector4(rf, rf, rf, rf));

      ]]>
      </TEST>


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

        SetFunctionName("Up() const");

        const Matrix44 m(
            1.0f, 1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f, 3.0f,
            4.0f, 4.0f, 4.0f, 4.0f
            );
        const Vector4 &r = m.Up();

        float rf = 2.0f;
        Validate( r == Vector4(rf, rf, rf, rf));

      ]]>
      </TEST>


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

        SetFunctionName("At() const");

        const Matrix44 m(
            1.0f, 1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f, 3.0f,
            4.0f, 4.0f, 4.0f, 4.0f
            );
        const Vector4 &r = m.At();

        float rf = 3.0f;
        Validate( r == Vector4(rf, rf, rf, rf));

      ]]>
      </TEST>


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

        SetFunctionName("Pos() const");

        const Matrix44 m(
            1.0f, 1.0f, 1.0f, 1.0f,
            2.0f, 2.0f, 2.0f, 2.0f,
            3.0f, 3.0f, 3.0f, 3.0f,
            4.0f, 4.0f, 4.0f, 4.0f
            );
        const Vector4 &r = m.Pos();

        float rf = 4.0f;
        Validate( r == Vector4(rf, rf, rf, rf));

      ]]>
      </TEST>

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

#ifdef HOST_TESTING

        Matrix44 m(
            2.0f, 3.0f, 4.0f, 5.0f,
            6.0f, 7.0f, 8.0f, 9.0f,
            10.0f, 11.0f, 12.0f, 13.0f,
            14.0f, 15.0f, 16.0f, 17.0f
            );

        SetFunctionName("Matrix44Template( const rw::math::Matrix44& m)");

        ::rw::math::fpu::Matrix44Template<double> doubleUnalignedMatrix(m);

        Validate(
            doubleUnalignedMatrix.GetElem( 0) == double( 2.0) &&
            doubleUnalignedMatrix.GetElem( 1) == double( 3.0) &&
            doubleUnalignedMatrix.GetElem( 2) == double( 4.0) &&
            doubleUnalignedMatrix.GetElem( 3) == double( 5.0) &&
            doubleUnalignedMatrix.GetElem( 4) == double( 6.0) &&
            doubleUnalignedMatrix.GetElem( 5) == double( 7.0) &&
            doubleUnalignedMatrix.GetElem( 6) == double( 8.0) &&
            doubleUnalignedMatrix.GetElem( 7) == double( 9.0) &&
            doubleUnalignedMatrix.GetElem( 8) == double(10.0) &&
            doubleUnalignedMatrix.GetElem( 9) == double(11.0) &&
            doubleUnalignedMatrix.GetElem(10) == double(12.0) &&
            doubleUnalignedMatrix.GetElem(11) == double(13.0) &&
            doubleUnalignedMatrix.GetElem(12) == double(14.0) &&
            doubleUnalignedMatrix.GetElem(13) == double(15.0) &&
            doubleUnalignedMatrix.GetElem(14) == double(16.0) &&
            doubleUnalignedMatrix.GetElem(15) == double(17.0)
            );

#endif

      ]]>
      </TEST>

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

#ifdef HOST_TESTING

        Matrix44 m(
            2.0f, 3.0f, 4.0f, 5.0f,
            6.0f, 7.0f, 8.0f, 9.0f,
            10.0f, 11.0f, 12.0f, 13.0f,
            14.0f, 15.0f, 16.0f, 17.0f
            );

        SetFunctionName("Matrix44Template( const rw::math::Matrix44& m)");

        ::rw::math::fpu::Matrix44Template<float> floatUnalignedMatrix(m);

        Validate(
            floatUnalignedMatrix.GetElem( 0) == ( 2.0f) &&
            floatUnalignedMatrix.GetElem( 1) == ( 3.0f) &&
            floatUnalignedMatrix.GetElem( 2) == ( 4.0f) &&
            floatUnalignedMatrix.GetElem( 3) == ( 5.0f) &&
            floatUnalignedMatrix.GetElem( 4) == ( 6.0f) &&
            floatUnalignedMatrix.GetElem( 5) == ( 7.0f) &&
            floatUnalignedMatrix.GetElem( 6) == ( 8.0f) &&
            floatUnalignedMatrix.GetElem( 7) == ( 9.0f) &&
            floatUnalignedMatrix.GetElem( 8) == (10.0f) &&
            floatUnalignedMatrix.GetElem( 9) == (11.0f) &&
            floatUnalignedMatrix.GetElem(10) == (12.0f) &&
            floatUnalignedMatrix.GetElem(11) == (13.0f) &&
            floatUnalignedMatrix.GetElem(12) == (14.0f) &&
            floatUnalignedMatrix.GetElem(13) == (15.0f) &&
            floatUnalignedMatrix.GetElem(14) == (16.0f) &&
            floatUnalignedMatrix.GetElem(15) == (17.0f)
            );

#endif

      ]]>
      </TEST>


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

#ifdef HOST_TESTING

        Matrix44 m(
            2.0f, 3.0f, 4.0f, 5.0f,
            6.0f, 7.0f, 8.0f, 9.0f,
            10.0f, 11.0f, 12.0f, 13.0f,
            14.0f, 15.0f, 16.0f, 17.0f
            );

        SetFunctionName("Matrix44Template( const rw::math::Matrix44& m)");

        ::rw::math::fpu::Matrix44Template<double> doubleAlignedMatrix(m);

        Validate(
            doubleAlignedMatrix.GetElem( 0) == double( 2.0) &&
            doubleAlignedMatrix.GetElem( 1) == double( 3.0) &&
            doubleAlignedMatrix.GetElem( 2) == double( 4.0) &&
            doubleAlignedMatrix.GetElem( 3) == double( 5.0) &&
            doubleAlignedMatrix.GetElem( 4) == double( 6.0) &&
            doubleAlignedMatrix.GetElem( 5) == double( 7.0) &&
            doubleAlignedMatrix.GetElem( 6) == double( 8.0) &&
            doubleAlignedMatrix.GetElem( 7) == double( 9.0) &&
            doubleAlignedMatrix.GetElem( 8) == double(10.0) &&
            doubleAlignedMatrix.GetElem( 9) == double(11.0) &&
            doubleAlignedMatrix.GetElem(10) == double(12.0) &&
            doubleAlignedMatrix.GetElem(11) == double(13.0) &&
            doubleAlignedMatrix.GetElem(12) == double(14.0) &&
            doubleAlignedMatrix.GetElem(13) == double(15.0) &&
            doubleAlignedMatrix.GetElem(14) == double(16.0) &&
            doubleAlignedMatrix.GetElem(15) == double(17.0)
            );

#endif

      ]]>
      </TEST>

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

#ifdef HOST_TESTING

        Matrix44 m(
            2.0f, 3.0f, 4.0f, 5.0f,
            6.0f, 7.0f, 8.0f, 9.0f,
            10.0f, 11.0f, 12.0f, 13.0f,
            14.0f, 15.0f, 16.0f, 17.0f
            );

        SetFunctionName("Matrix44Template( const rw::math::Matrix44& m)");

        ::rw::math::fpu::Matrix44Template<float> floatAlignedMatrix(m);

        Validate(
            floatAlignedMatrix.GetElem( 0) == ( 2.0f) &&
            floatAlignedMatrix.GetElem( 1) == ( 3.0f) &&
            floatAlignedMatrix.GetElem( 2) == ( 4.0f) &&
            floatAlignedMatrix.GetElem( 3) == ( 5.0f) &&
            floatAlignedMatrix.GetElem( 4) == ( 6.0f) &&
            floatAlignedMatrix.GetElem( 5) == ( 7.0f) &&
            floatAlignedMatrix.GetElem( 6) == ( 8.0f) &&
            floatAlignedMatrix.GetElem( 7) == ( 9.0f) &&
            floatAlignedMatrix.GetElem( 8) == (10.0f) &&
            floatAlignedMatrix.GetElem( 9) == (11.0f) &&
            floatAlignedMatrix.GetElem(10) == (12.0f) &&
            floatAlignedMatrix.GetElem(11) == (13.0f) &&
            floatAlignedMatrix.GetElem(12) == (14.0f) &&
            floatAlignedMatrix.GetElem(13) == (15.0f) &&
            floatAlignedMatrix.GetElem(14) == (16.0f) &&
            floatAlignedMatrix.GetElem(15) == (17.0f)
            );

#endif

      ]]>
      </TEST>

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

        SetFunctionName("Vector4 GetXColumn()");

        Matrix44 m(
             2.0f,  3.0f,  4.0f,  5.0f,
             6.0f,  7.0f,  8.0f,  9.0f,
            10.0f, 11.0f, 12.0f, 13.0f,
            14.0f, 15.0f, 16.0f, 17.0f
            );
        Vector4 r = m.GetXColumn();
        Vector4 ref( 2.0f, 6.0f, 10.0f, 14.0f );


        Validate( r == ref );

      ]]>
      </TEST>

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

        SetFunctionName("Vector4 GetYColumn()");

        Matrix44 m(
             2.0f,  3.0f,  4.0f,  5.0f,
             6.0f,  7.0f,  8.0f,  9.0f,
            10.0f, 11.0f, 12.0f, 13.0f,
            14.0f, 15.0f, 16.0f, 17.0f
            );
        Vector4 r = m.GetYColumn();
        Vector4 ref( 3.0f, 7.0f, 11.0f, 15.0f );


        Validate( r == ref );

      ]]>
      </TEST>

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

        SetFunctionName("Vector4 GetZColumn()");

        Matrix44 m(
             2.0f,  3.0f,  4.0f,  5.0f,
             6.0f,  7.0f,  8.0f,  9.0f,
            10.0f, 11.0f, 12.0f, 13.0f,
            14.0f, 15.0f, 16.0f, 17.0f
            );
        Vector4 r = m.GetZColumn();
        Vector4 ref( 4.0f, 8.0f, 12.0f, 16.0f );


        Validate( r == ref );

      ]]>
      </TEST>

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

        SetFunctionName("Vector4 GetWColumn()");

        Matrix44 m(
             2.0f,  3.0f,  4.0f,  5.0f,
             6.0f,  7.0f,  8.0f,  9.0f,
            10.0f, 11.0f, 12.0f, 13.0f,
            14.0f, 15.0f, 16.0f, 17.0f
            );
        Vector4 r = m.GetWColumn();
        Vector4 ref( 5.0f, 9.0f, 13.0f, 17.0f );


        Validate( r == ref );

      ]]>
      </TEST>

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

        SetFunctionName("SetXColumn(Vector4 &)");

        Matrix44 m(
             2.0f,  3.0f,  4.0f,  5.0f,
             6.0f,  7.0f,  8.0f,  9.0f,
            10.0f, 11.0f, 12.0f, 13.0f,
            14.0f, 15.0f, 16.0f, 17.0f
            );
        Vector4 v4(1.0f, 2.0f, 3.0f, 4.0f);
        Matrix44 ref(
            1.0f,  3.0f,  4.0f,  5.0f,
            2.0f,  7.0f,  8.0f,  9.0f,
            3.0f, 11.0f, 12.0f, 13.0f,
            4.0f, 15.0f, 16.0f, 17.0f
            );
        m.SetXColumn(v4);

        Validate( m == ref );

      ]]>
      </TEST>

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

        SetFunctionName("SetYColumn(Vector4 &)");

        Matrix44 m(
             2.0f,  3.0f,  4.0f,  5.0f,
             6.0f,  7.0f,  8.0f,  9.0f,
            10.0f, 11.0f, 12.0f, 13.0f,
            14.0f, 15.0f, 16.0f, 17.0f
            );
        Vector4 v4(1.0f, 2.0f, 3.0f, 4.0f);
        Matrix44 ref(
             2.0f, 1.0f,  4.0f,  5.0f,
             6.0f, 2.0f,  8.0f,  9.0f,
            10.0f, 3.0f, 12.0f, 13.0f,
            14.0f, 4.0f, 16.0f, 17.0f
            );
        m.SetYColumn(v4);

        Validate( m == ref );

      ]]>
      </TEST>

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

        SetFunctionName("SetZColumn(Vector4 &)");

        Matrix44 m(
             2.0f,  3.0f,  4.0f,  5.0f,
             6.0f,  7.0f,  8.0f,  9.0f,
            10.0f, 11.0f, 12.0f, 13.0f,
            14.0f, 15.0f, 16.0f, 17.0f
            );
        Vector4 v4(1.0f, 2.0f, 3.0f, 4.0f);
        Matrix44 ref(
             2.0f,  3.0f, 1.0f,  5.0f,
             6.0f,  7.0f, 2.0f,  9.0f,
            10.0f, 11.0f, 3.0f, 13.0f,
            14.0f, 15.0f, 4.0f, 17.0f
            );
        m.SetZColumn(v4);

        Validate( m == ref );

      ]]>
      </TEST>

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

        SetFunctionName("SetWColumn(Vector4 &)");

        Matrix44 m(
             2.0f,  3.0f,  4.0f,  5.0f,
             6.0f,  7.0f,  8.0f,  9.0f,
            10.0f, 11.0f, 12.0f, 13.0f,
            14.0f, 15.0f, 16.0f, 17.0f
            );
        Vector4 v4(1.0f, 2.0f, 3.0f, 4.0f);
        Matrix44 ref(
             2.0f,  3.0f,  4.0f, 1.0f,
             6.0f,  7.0f,  8.0f, 2.0f,
            10.0f, 11.0f, 12.0f, 3.0f,
            14.0f, 15.0f, 16.0f, 4.0f
            );
        m.SetWColumn(v4);

        Validate( m == ref );

      ]]>
      </TEST>

      <TEST NAME="select_maskscalar">
      <![CDATA[
      
        SetFunctionName("Matrix44 Select(MaskScalar mask, Matrix44 a, Matrix44 b)");
        Matrix44 m1(
             2.0f,  3.0f,  4.0f,  5.0f,
             6.0f,  7.0f,  8.0f,  9.0f,
            10.0f, 11.0f, 12.0f, 13.0f,
            14.0f, 15.0f, 16.0f, 17.0f
            );
        Matrix44 m2((float_test_type)2.0f * m1);

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

      ]]>
      </TEST>

    </TYPE>


    <TYPE NAME="performance">

      <TEST NAME="test39">
      <![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++)
            {
                m44_array[i].SetZero();
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test40">
      <![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++)
            {
                m44_array[i].SetIdentity();
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test41">
      <![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++)
            {
                m44_array[i].Set(x_array[i], y_array[i], z_array[i], w_array[i],
                                 x_array[i], y_array[i], z_array[i], w_array[i],
                                 x_array[i], y_array[i], z_array[i], w_array[i],
                                 x_array[i], y_array[i], z_array[i], w_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test42">
      <![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 = m44_array[i].GetElem(0);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test43">
      <![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 Matrix44*)&(m44_array[i]))->GetElem(0);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test44">
      <![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 = m44_array[i].GetElem(0, 0);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test45">
      <![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 Matrix44*)&(m44_array[i]))->GetElem(0, 0);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test46">
      <![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 = m44_array[i].operator()(0, 0);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test47">
      <![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 Matrix44*)&(m44_array[i]))->operator()(0, 0);
            }
        }

        StopTimer();

      ]]>
      </TEST>

    </TYPE>

  </TYPE>


  <TYPE NAME="function">

    <TYPE NAME="correctness">

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



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

        Matrix44 m, r, ref;
        m.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        r = Negate(m);

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

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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



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

        Matrix44 m, r, ref;
        m.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        float_test_type s = 2.0f;
        r = Mult(m, s);

        for (int i = 0; i < 16; i++)
        {
            ref.SetElem(i, m.GetElem(i) * s);
        }

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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



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

        Matrix44 m, r, ref;
        m.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        float_test_type s = 2.0f;
        r = Divide(m, s);

        for (int i = 0; i < 16; i++)
        {
            ref.SetElem(i, m.GetElem(i) / s);
        }

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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



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

        Matrix44 a, b, r, ref;
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        b.Set(4.0f, 3.0f, 4.0f, 1.0f, 6.0f, 7.0f, 8.0f, 1.0f, 10.0f, 11.0f, 12.0f, 1.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        r = Add(a, b);

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



      ]]>
      </TEST>


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



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

        Matrix44 a, b, r, ref;
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        b.Set(4.0f, 3.0f, 4.0f, 1.0f, 6.0f, 7.0f, 8.0f, 1.0f, 10.0f, 11.0f, 12.0f, 1.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        r = Subtract(a, b);

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



      ]]>
      </TEST>


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



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

        Matrix44 a, b, r, ref;
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        b.Set(4.0f, 3.0f, 4.0f, 1.0f, 6.0f, 7.0f, 8.0f, 1.0f, 10.0f, 11.0f, 12.0f, 1.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        r = a;
        SelfAdd(r, b);

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



      ]]>
      </TEST>


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



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

        Matrix44 a, b, r, ref;
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        b.Set(4.0f, 3.0f, 4.0f, 1.0f, 6.0f, 7.0f, 8.0f, 1.0f, 10.0f, 11.0f, 12.0f, 1.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        r = a;
        SelfSubtract(r, b);

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



      ]]>
      </TEST>


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



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

        Matrix44 a, r, ref;
        float_test_type s = 2.0f;
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        r = a;
        SelfMult(r, s);

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




      ]]>
      </TEST>


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


#ifdef HOST_TESTING

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

        Matrix44 a, r, ref;
        Vector4 vec(1.0f, 2.0f, 3.0f, 4.0f);
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        r = a;
        SelfMult(r, vec.Y());

        for (int i = 0; i < 16; i++)
        {
            ref.GetElem(i) = a.GetElem(i) * vec.Y();
        }
        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#ifdef HOST_TESTING

        SetFunctionName("SelfMult(Matrix44 &m, const VecFloatRefIndex a)");

        Matrix44 a, r, ref;
        Vector4 vec(1.0f, 2.0f, 3.0f, 4.0f);
        VecFloatRefIndex zRef = vec.GetComponent(2);
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        r = a;
        SelfMult(r, zRef);

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

#endif


      ]]>
      </TEST>


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



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

        Matrix44 a, r, ref;
        float_test_type s = 2.0f;
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        r = a;
        SelfDivide(r, s);

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




      ]]>
      </TEST>


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


#ifdef HOST_TESTING

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

        Matrix44 a, r, ref;
        Vector4 vec(1.0f, 2.0f, 3.0f, 4.0f);
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        r = a;
        SelfDivide(r, vec.Y());

        for (int i = 0; i < 16; i++)
        {
            ref.GetElem(i) = a.GetElem(i) / vec.Y();
        }
        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#ifdef HOST_TESTING

        SetFunctionName("SelfDivide(Matrix44 &m, const VecFloatRefIndex a)");

        Matrix44 a, r, ref;
    Vector4 vec(1.0f, 2.0f, 3.0f, 4.0f);
        VecFloatRefIndex zRef = vec.GetComponent(2);
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        r = a;
        SelfDivide(r, zRef);

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

#endif



      ]]>
      </TEST>


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



        SetFunctionName("Mult(const Vector4 &v, const Matrix44 &m)");

        Matrix44 m;
        Vector4 v4, ra;
        v4.Set(6.0f, -1.0f, -3.0f, 1.0f);
        m.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        Vector4 r = Mult(v4, m); // test with non-aliasing

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

        Vector4 ref(
                  m.GetElem(0, 0) * v4.X() + m.GetElem(1, 0) * v4.Y() + m.GetElem(2, 0) * v4.Z() + m.GetElem(3, 0) * v4.W(),
                  m.GetElem(0, 1) * v4.X() + m.GetElem(1, 1) * v4.Y() + m.GetElem(2, 1) * v4.Z() + m.GetElem(3, 1) * v4.W(),
                  m.GetElem(0, 2) * v4.X() + m.GetElem(1, 2) * v4.Y() + m.GetElem(2, 2) * v4.Z() + m.GetElem(3, 2) * v4.W(),
                  m.GetElem(0, 3) * v4.X() + m.GetElem(1, 3) * v4.Y() + m.GetElem(2, 3) * v4.Z() + m.GetElem(3, 3) * v4.W());

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



      ]]>
      </TEST>


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



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

        Matrix44 a, b, r, ra, ref;

        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        b.Set(4.0f, 3.0f, 4.0f, 1.0f, 6.0f, 7.0f, 8.0f, 1.0f, 10.0f, 11.0f, 12.0f, 1.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        ra.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);


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

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

        for (int32_t i = 0; i < 4; ++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) + a.GetElem(i, 3) * b.GetElem(3, 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) + a.GetElem(i, 3) * b.GetElem(3, 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.GetElem(i, 3) * b.GetElem(3, 2) );
            ref.SetElem(i, 3, a.GetElem(i, 0) * b.GetElem(0, 3) + a.GetElem(i, 1) * b.GetElem(1, 3) + a.GetElem(i, 2) * b.GetElem(2, 3) + a.GetElem(i, 3) * b.GetElem(3, 3) );
        }

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



      ]]>
      </TEST>


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

        SetFunctionName("Mult(const Matrix44Affine &a, const Matrix44 &b)");

        Matrix44Affine a;
        Matrix44 b, r, ref;

        a.Set(2.0f, 3.0f, 4.0f,
              6.0f, 7.0f, 8.0f,
              10.0f, 11.0f, 12.0f,
              14.0f, 15.0f, 16.0f);
        b.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        ref.Set( 62.0f,  71.0f,  80.0f,  89.0f,
                134.0f, 155.0f, 176.0f, 197.0f,
                206.0f, 239.0f, 272.0f, 305.0f,
                292.0f, 338.0f, 384.0f, 430.0f); 

        r = Mult(a, b);

        Validate(IsSimilar(r, ref));

      ]]>
      </TEST>


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



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

        Matrix44 m, r, ref;

        m.Set(
            1,  2,  3,  4,
            5,  6,  7,  8,
            9, 10, 11, 12,
           13, 14, 15, 16
             );
        ref.Set(
            1,  5,  9, 13,
            2,  6, 10, 14,
            3,  7, 11, 15,
            4,  8, 12, 16
            );

        r = Transpose(m);

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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



        SetFunctionName("OrthoNormalize(Matrix44 &m)");
        Matrix44 mat1(
                0.98854077f, 0.30964674f, 0.61170041f, 0.51744682f,
                0.73956566f, 0.25522057f, 0.67839563f, 0.39168732f,
                0.00371731f, 0.62518794f, 0.33200953f, 0.24135384f,
                0.59005729f, 0.11574174f, 0.02587099f, 0.50644349f
            );

        Matrix44 r1 = OrthoNormalize(mat1);

        Matrix44 mat2 = Matrix44FromEulerXYZ(Vector3(1.0f, 2.0f, 3.0f));
        Matrix44 r2 = OrthoNormalize(mat2);

        bool r1Ortho = IsOrthogonal(r1);
        bool r1Normal = IsNormal(r1);
        bool r2Ortho = IsOrthogonal(r2);
        bool r2Normal = IsNormal(r2);
        bool r2Similar = IsSimilar(mat2, r2);
        Validate( r1Ortho && r1Normal &&
                  r2Ortho && r2Normal && r2Similar );



      ]]>
      </TEST>


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



        SetFunctionName("InverseOrthonormal(Matrix44 &m)");
        Matrix44 mat =
            OrthoNormalize(Matrix44(
                0.98854077f, 0.30964674f, 0.61170041f, 0.51744682f,
                0.73956566f, 0.25522057f, 0.67839563f, 0.39168732f,
                0.00371731f, 0.62518794f, 0.33200953f, 0.24135384f,
                0.59005729f, 0.11574174f, 0.02587099f, 0.50644349f
            ));

        Matrix44 r = InverseOrthonormal(mat);
        // See if mat * InverseOrthonormal(mat) gives the identity matrix.
        Matrix44 matProduct = Mult(mat, r);
        Validate(IsSimilar(matProduct, GetMatrix44_Identity() ) );



      ]]>
      </TEST>


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



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

        Matrix44 m;

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

        float_test_type r = Determinant(m);

        Validate(IsEqualWithEpsilon(r, (float_test_type)5.0f));



      ]]>
      </TEST>


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



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

        Matrix44 m;

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

        float_test_type r = Determinant(m);

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



      ]]>
      </TEST>


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



        SetFunctionName("Inverse(const Matrix44 &m, float& determinant)");

        Matrix44 m, r, ref;

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

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

        float_test_type d;
        r = Inverse(m, d);
        float_test_type dRef = Determinant(m);

        Validate(IsSimilar(r, ref) &&
                 IsSimilar((float_test_type)d, (float_test_type)dRef, (float_test_type)0.001f));



      ]]>
      </TEST>


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



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

        Matrix44 m, r, ref;

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

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

        r = Inverse(m);

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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



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

        Matrix44 a, b, c, d, e, f;

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

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

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

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

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

        f.Set(
            2.0f,  2.0f,  0.0f, 1.0f,
           -2.0f,  1.0f,  1.0f, 1.0f,
            2.0f,  2.0f,  3.0f, 1.0f,
            3.0f,  4.0f,  5.0f, 1.0f
            );
        bool isSimilarTest1 = IsSimilar(a, b);
        bool isSimilarTest2 = !IsSimilar(a, c);
        bool isSimilarTest3 = !IsSimilar(a, d);
        bool isSimilarTest4 = !IsSimilar(a, e);
        bool isSimilarTest5 = !IsSimilar(a, f);

        bool isSimilarTest6 = true;
        for(int row=0;row<4;row++)
        {
            for(int col=0;col<4;col++)
            {
                Matrix44 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) )
                {
                    isSimilarTest6 = false;
                    break;
                }
            }
        }

        Validate( isSimilarTest1 &&  isSimilarTest2 &&  isSimilarTest3 &&  isSimilarTest4 && isSimilarTest5 && isSimilarTest6 );




      ]]>
      </TEST>


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


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

        float zero = 0.0f;
        float_test_type nan = float_test_type(zero / zero);
        int numPermutations = 1 << Matrix44::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++)
        {
            Matrix44 mat;
            mat.SetZero();
            for( int elem = 0; elem < Matrix44::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="test71">
      <![CDATA[

    
// on SPU, NaN operations evaluates to 0
#if !defined EA_PLATFORM_PS3_SPU
    {
        SetFunctionName("IsValid(Matrix44 m)");

        Matrix44 a, b;

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

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

        Validate(IsValid(a) && !IsValid(b));
    }
#endif  

      ]]>
      </TEST>


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



        SetFunctionName("GetNormalError(Matrix44 mat)");
        Matrix44 mat1(
            0.65048856f, 0.66919908f, 0.24229341f, 0.26520016f,
            0.76274424f, 0.27178493f, 0.51883797f, 0.27415567f,
            0.66170558f, 0.67715591f, 0.15113503f, 0.28418972f,
            0.52521767f, 0.63691807f, 0.04064778f, 0.56287613f
        );
        Matrix44 mat2(
            0.20171727f, 0.48291793f, 0.28553642f, 0.99312099f,
            0.39115739f, 0.22328650f, 0.86075146f, 0.64885629f,
            0.83003166f, 0.84008857f, 0.84941017f, 0.99231909f,
            0.58787202f, 0.12059959f, 0.52570608f, 0.05004198f
        );

        Validate(   IsSimilar( GetNormalError(mat1), (float_test_type)0.0f ) &&
                    IsSimilar( GetNormalError(mat2), (float_test_type)4.7939081f ) );



      ]]>
      </TEST>


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



        SetFunctionName("IsNormal(a, tolerance)");
        Matrix44 mat1(
            0.65048856f, 0.66919908f, 0.24229341f, 0.26520016f,
            0.76274424f, 0.27178493f, 0.51883797f, 0.27415567f,
            0.66170558f, 0.67715591f, 0.15113503f, 0.28418972f,
            0.52521767f, 0.63691807f, 0.04064778f, 0.56287613f
        );
        Matrix44 mat2(
            0.20171727f, 0.48291793f, 0.28553642f, 0.99312099f,
            0.39115739f, 0.22328650f, 0.86075146f, 0.64885629f,
            0.83003166f, 0.84008857f, 0.84941017f, 0.99231909f,
            0.58787202f, 0.12059959f, 0.52570608f, 0.05004198f
        );

        bool r1 = IsNormal(mat1);
        bool r2 = IsNormal(mat2);
        Validate( r1 && !r2 );



      ]]>
      </TEST>


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



        SetFunctionName("GetOrthogonalRowSetError(Matrix44 mat)");
        Matrix44 mat1(
                -0.59360691f, -0.20664442f, 0.12884683f, -0.76702504f,
                -0.28311901f, 0.83020230f, -0.47281585f, -0.08398173f,
                -0.36414570f, 0.36190092f, 0.79698055f, 0.31819433f,
                -0.65944853f, -0.37025659f, -0.35308025f, 0.55079218f
            );
        Matrix44 mat2(
                0.42361020f, 0.34549845f, 0.65027951f, 0.89767963f,
                0.28937275f, 0.70648676f, 0.08813348f, 0.24278219f,
                0.08879322f, 0.52114725f, 0.44987633f, 0.43377211f,
                0.62128818f, 0.28704009f, 0.72272531f, 0.96770532f
            );
        Validate(   IsSimilar( GetOrthogonalRowSetError(mat1), (float_test_type)0.0f ) &&
                    IsSimilar( GetOrthogonalRowSetError(mat2), (float_test_type)5.7710619f ) );



      ]]>
      </TEST>


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



        SetFunctionName("GetOrthogonalError(Matrix44 mat)");
        Matrix44 mat1(
                -0.59360691f, -0.20664442f, 0.12884683f, -0.76702504f,
                -0.28311901f, 0.83020230f, -0.47281585f, -0.08398173f,
                -0.36414570f, 0.36190092f, 0.79698055f, 0.31819433f,
                -0.65944853f, -0.37025659f, -0.35308025f, 0.55079218f
            );
        Matrix44 mat2(
                0.42361020f, 0.34549845f, 0.65027951f, 0.89767963f,
                0.28937275f, 0.70648676f, 0.08813348f, 0.24278219f,
                0.08879322f, 0.52114725f, 0.44987633f, 0.43377211f,
                0.62128818f, 0.28704009f, 0.72272531f, 0.96770532f
            );
        Validate(   IsSimilar( GetOrthogonalError(mat1), (float_test_type)0.0f ) &&
                    IsSimilar( GetOrthogonalError(mat2), (float_test_type)51.619335f, (float_test_type)0.0001f ) );



      ]]>
      </TEST>

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

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

        Matrix44 zero;
        zero.SetZero();

        Validate(!IsOrthogonal(zero));

      ]]>
      </TEST>

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



        SetFunctionName("IsOrthogonal(Matrix44 mat)");
        Matrix44 mat1(
                -0.59360691f, -0.20664442f, 0.12884683f, -0.76702504f,
                -0.28311901f, 0.83020230f, -0.47281585f, -0.08398173f,
                -0.36414570f, 0.36190092f, 0.79698055f, 0.31819433f,
                -0.65944853f, -0.37025659f, -0.35308025f, 0.55079218f
            );
        Matrix44 mat2(
                0.42361020f, 0.34549845f, 0.65027951f, 0.89767963f,
                0.28937275f, 0.70648676f, 0.08813348f, 0.24278219f,
                0.08879322f, 0.52114725f, 0.44987633f, 0.43377211f,
                0.62128818f, 0.28704009f, 0.72272531f, 0.96770532f
            );
        bool r1 = IsOrthogonal(mat1);
        bool r2 = IsOrthogonal(mat2);
        Validate( r1 && !r2 );



      ]]>
      </TEST>

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

        SetFunctionName("IsRotation(m)");
        Matrix44 testMat1(Matrix44FromEulerXYZ(Vector3(1.0f, 2.0f, 3.0f)));
        Matrix44 testMat2(-1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f);
        Matrix44 testMat3(2.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f);
        Matrix44 testMat4(testMat1);
        testMat4.wAxis = Vector4(1.0f, 2.0f, 3.0f, 0.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));
        bool isRot4 = IsRotation(testMat4, float_test_type(SMALL_FLOAT));


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

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

        SetFunctionName("IsRotation3x3(m)");
        Matrix44 testMat1(Matrix44FromEulerXYZ(Vector3(1.0f, 2.0f, 3.0f)));
        Matrix44 testMat2(-1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f);
        Matrix44 testMat3(2.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f);
        Matrix44 testMat4(testMat1);
        testMat4.wAxis = Vector4(1.0f, 2.0f, 3.0f, 0.0f );
        testMat4.xAxis.W() = (float_test_type)9.0f;

        bool isRot1 = IsRotation3x3(testMat1, float_test_type(SMALL_FLOAT));
        bool isRot2 = IsRotation3x3(testMat2, float_test_type(SMALL_FLOAT));
        bool isRot3 = IsRotation3x3(testMat3, float_test_type(SMALL_FLOAT));
        bool isRot4 = IsRotation3x3(testMat4, float_test_type(SMALL_FLOAT));


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

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



        SetFunctionName("IsOrthogonalRowSet(Matrix44 mat)");
        Matrix44 mat1(
                -0.59360691f, -0.20664442f, 0.12884683f, -0.76702504f,
                -0.28311901f, 0.83020230f, -0.47281585f, -0.08398173f,
                -0.36414570f, 0.36190092f, 0.79698055f, 0.31819433f,
                -0.65944853f, -0.37025659f, -0.35308025f, 0.55079218f
            );
        Matrix44 mat2(
                0.42361020f, 0.34549845f, 0.65027951f, 0.89767963f,
                0.28937275f, 0.70648676f, 0.08813348f, 0.24278219f,
                0.08879322f, 0.52114725f, 0.44987633f, 0.43377211f,
                0.62128818f, 0.28704009f, 0.72272531f, 0.96770532f
            );
        bool r1 = IsOrthogonalRowSet(mat1);
        bool r2 = IsOrthogonalRowSet(mat2);
        Validate( r1 && !r2 );



      ]]>
      </TEST>


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



    
#if !defined EA_PLATFORM_PS3_SPU
    {

        SetFunctionName("IsValid3x3(Matrix44 m)");

        Matrix44 a, b;

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

        b.Set(
            1.0f,  2.0f,  0.0f, 1.0f,
           -1.0f,  1.0f,  1.0f, 1.0f,
            1.0f,  (float)testing::GetNaN(),  3.0f, 1.0f,
            3.0f,  4.0f,  5.0f, 1.0f
            );
        Validate(IsValid3x3(a) && !IsValid3x3(b));
    }
#endif  

      ]]>
      </TEST>


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



        SetFunctionName("Vector3 TransformPoint(Vector3::InParam pt, Matrix44::InParam matrix)");
        Matrix44 a(
            -0.8149562f,   0.5008597f,   0.2915235f,    0.0f,
            -0.4312790f,  -0.1881537f,  -0.8823812f,    0.0f,
            -0.3870979f,  -0.8448300f,   0.3693473f,    0.0f,
             3.0000000f,   2.5000000f,   6.0000000f,    1.0f
            );
        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( 0.1611920f, 0.0900622f, 5.6348029f),
            Vector3( 1.0305913f, 3.5340564f, 9.0086802f),
            Vector3(-6.5688316f, 0.6254043f, 13.343252f)
        };
        Vector3 res[3];
        for( int i=0; i<3; ++i)
        {
            res[i] = TransformPoint( vec[i], a );
        }
        Validate(   IsSimilar(res[0], ref[0]) &&
                    IsSimilar(res[1], ref[1]) &&
                    IsSimilar(res[2], ref[2]) );



      ]]>
      </TEST>


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



        SetFunctionName("void TransformPoints(const Vector3* const pts, int numPoints, Matrix44::InParam matrix, Vector3* transformedPts)");
        Matrix44 a(
            -0.8149562f,   0.5008597f,   0.2915235f,    0.0f,
            -0.4312790f,  -0.1881537f,  -0.8823812f,    0.0f,
            -0.3870979f,  -0.8448300f,   0.3693473f,    0.0f,
             3.0000000f,   2.5000000f,   6.0000000f,    1.0f
            );
        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( 0.1611920f, 0.0900622f, 5.6348029f),
            Vector3( 1.0305913f, 3.5340564f, 9.0086802f),
            Vector3(-6.5688316f, 0.6254043f, 13.343252f)
        };
        Vector3 res[3];
        TransformPoints( vec, 3, a, res );
        Validate(   IsSimilar(res[0], ref[0]) &&
                    IsSimilar(res[1], ref[1]) &&
                    IsSimilar(res[2], ref[2]) );



      ]]>
      </TEST>


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



        SetFunctionName("Vector3 TransformVector(Vector3::InParam vec, Matrix44::InParam matrix)");
        Matrix44 a(
            -0.8149562f,   0.5008597f,   0.2915235f,    0.0f,
            -0.4312790f,  -0.1881537f,  -0.8823812f,    0.0f,
            -0.3870979f,  -0.8448300f,   0.3693473f,    0.0f,
             3.0000000f,   2.5000000f,   6.0000000f,    1.0f
            );
        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.96940866f, 1.03405643f, 3.00868025f),
            Vector3(-9.56883155f, -1.87459570f, 7.34325225f)
        };
        Vector3 res[3];
        for( int i=0; i<3; ++i)
        {
            res[i] = TransformVector( vec[i], a );
        }
        Validate(   IsSimilar(res[0], ref[0]) &&
                    IsSimilar(res[1], ref[1]) &&
                    IsSimilar(res[2], ref[2]) );



      ]]>
      </TEST>


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



        SetFunctionName("TransformVectors(const Vector3* const vecs, int numVectors, Matrix44::InParam matrix, Vector3 * transformedVecs)");
        Matrix44 a(
            -0.8149562f,   0.5008597f,   0.2915235f,    0.0f,
            -0.4312790f,  -0.1881537f,  -0.8823812f,    0.0f,
            -0.3870979f,  -0.8448300f,   0.3693473f,    0.0f,
             3.0000000f,   2.5000000f,   6.0000000f,    1.0f
            );
        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.96940866f, 1.03405643f, 3.00868025f),
            Vector3(-9.56883155f, -1.87459570f, 7.34325225f)
        };
        Vector3 res[3];
        TransformVectors( vec, 3, a, res );
        Validate(   IsSimilar(res[0], ref[0]) &&
                    IsSimilar(res[1], ref[1]) &&
                    IsSimilar(res[2], ref[2]) );



      ]]>
      </TEST>


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



        SetFunctionName("Vector3 Transform(Vector4::InParam vec, Matrix44::InParam matrix)");
        Matrix44 a(
            -0.8149562f,   0.5008597f,   0.2915235f,    0.0f,
            -0.4312790f,  -0.1881537f,  -0.8823812f,    0.0f,
            -0.3870979f,  -0.8448300f,   0.3693473f,    0.0f,
             3.0000000f,   2.5000000f,   6.0000000f,    1.0f
            );
        Vector4 vec[3] =
        {
            Vector4( 1.0f, 2.0f, 3.0f, 0.0f ),
            Vector4( 3.0f, -2.0f, 1.0f, 1.0f ),
            Vector4( 9.0f, -2.0f, 8.0f, 0.5f )
        };
        Vector3 ref[3] =
        {
            Vector3(-2.83880798f, -2.40993783f, -0.36519710f),
            Vector3(1.03059134f, 3.53405643f, 9.00868025f),
            Vector3(-8.06883155f, -0.62459570f, 10.34325225f)
        };
        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="test84">
      <![CDATA[



        SetFunctionName("void Transform(const Vector4* const vecs, int numVectors, Matrix44::InParam matrix, Vector3 * transformedVecs)");
        Matrix44 a(
            -0.8149562f,   0.5008597f,   0.2915235f,    0.0f,
            -0.4312790f,  -0.1881537f,  -0.8823812f,    0.0f,
            -0.3870979f,  -0.8448300f,   0.3693473f,    0.0f,
             3.0000000f,   2.5000000f,   6.0000000f,    1.0f
            );
        Vector4 vec[3] =
        {
            Vector4( 1.0f, 2.0f, 3.0f, 0.0f ),
            Vector4( 3.0f, -2.0f, 1.0f, 1.0f ),
            Vector4( 9.0f, -2.0f, 8.0f, 0.5f )
        };
        Vector3 ref[3] =
        {
            Vector3(-2.83880798f, -2.40993783f, -0.36519710f),
            Vector3(1.03059134f, 3.53405643f, 9.00868025f),
            Vector3(-8.06883155f, -0.62459570f, 10.34325225f)
        };
        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="test85">
      <![CDATA[



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

        Quaternion q;
        Matrix44 r, ref;

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

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

        r = Matrix44FromQuaternion(q);

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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



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

        Quaternion q;
        Matrix44 r, ref;
        float_test_type angle = -PI + 0.000f;
        float_test_type zero = 0.0f;
        float_test_type half = 0.5f;

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

            ref.Set(
                 1, 0, 0, 0,
                 0, Cos(angle), Sin(angle), 0,
                 0, Sin(-angle), Cos(angle), 0,
                 0, 0, 0, 1
             );

            r = Matrix44FromQuaternion(q);

            Validate(IsSimilar(r, ref));
        }



      ]]>
      </TEST>


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



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

        Quaternion q;
        Matrix44 r, ref;
        float_test_type angle = -PI + 0.000f;
        float_test_type zero = 0.0f;
        float_test_type half = 0.5f;

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

            ref.Set(
                 Cos(angle), 0, Sin(-angle), 0,
                 0, 1, 0, 0,
                 Sin(angle), 0, Cos(angle), 0,
                 0, 0, 0, 1
             );

            r = Matrix44FromQuaternion(q);

            Validate(IsSimilar(r, ref));
        }



      ]]>
      </TEST>


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



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

        Quaternion q;
        Matrix44 r, ref;
        float_test_type angle = -PI + 0.000f;
        float_test_type zero = 0.0f;
        float_test_type half = 0.5f;

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

            ref.Set(
                 Cos(angle), Sin(angle), 0, 0,
                 Sin(-angle), Cos(angle), 0, 0,
                 0, 0, 1, 0,
                 0, 0, 0, 1
             );

            r = Matrix44FromQuaternion(q);

            Validate(IsSimilar(r, ref));
        }



      ]]>
      </TEST>


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



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

        Vector3 axis;
        float_test_type angle;
        Matrix44 r, ref;

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

        r = Matrix44FromAxisRotationAngle(axis, angle);

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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



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

        Vector3 axis;
        float_test_type angle = -PI + 0.0001f;
        Matrix44 r, ref;
        axis.Set(1, 0, 0);

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

            r = Matrix44FromAxisRotationAngle(axis, angle);

            Validate(IsSimilar(r, ref));
        }



      ]]>
      </TEST>


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



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

        Vector3 axis;
        float_test_type angle = -PI + 0.0001f;
        Matrix44 r, ref;
        axis.Set(0, 1, 0);

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

            r = Matrix44FromAxisRotationAngle(axis, angle);

            Validate(IsSimilar(r, ref));
        }



      ]]>
      </TEST>


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



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

        Vector3 axis;
        float_test_type angle = -PI + 0.0001f;
        Matrix44 r, ref;
        axis.Set(0, 0, 1);

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

            r = Matrix44FromAxisRotationAngle(axis, angle);

            Validate(IsSimilar(r, ref));
        }



      ]]>
      </TEST>


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



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

        Vector3 euler;
        Matrix44 r, ref;

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

        r = Matrix44FromEulerXYZ(euler);

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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



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

        Vector3 euler;
        Matrix44 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, zero, zero);
            ref.Set(
                1, 0, 0, 0,
                0, Cos(angle), Sin(angle), 0,
                0, Sin(-angle), Cos(angle), 0,
                0, 0, 0, 1
                );

            r = Matrix44FromEulerXYZ(euler);

            Validate(IsSimilar(r, ref));
        }



      ]]>
      </TEST>


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



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

        Vector3 euler;
        Matrix44 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(zero, angle, zero);
            ref.Set(
                Cos(angle), 0, Sin(-angle), 0,
                0, 1, 0, 0,
                Sin(angle), 0, Cos(angle), 0,
                0, 0, 0, 1
                );

            r = Matrix44FromEulerXYZ(euler);

            Validate(IsSimilar(r, ref));
        }



      ]]>
      </TEST>


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



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

        Vector3 euler;
        Matrix44 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(zero, zero, angle);
            ref.Set(
                Cos(angle), Sin(angle), 0, 0,
                Sin(-angle), Cos(angle), 0, 0,
                0, 0, 1, 0,
                0, 0, 0, 1
                );

            r = Matrix44FromEulerXYZ(euler);

            Validate(IsSimilar(r, ref));
        }



      ]]>
      </TEST>


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



        SetFunctionName("Mult3x3(const Vector4 &v, const Matrix44 &m)");

        Matrix44 m;
        Vector4 v4, r;

        m.Set(
                2.0f,  3.0f,  4.0f,  5.0f,
                6.0f,  7.0f,  8.0f,  9.0f,
               10.0f, 11.0f, 12.0f, 13.0f,
               14.0f, 15.0f, 16.0f, 17.0f
             );
        v4.Set(6, -1, -3, 2);

        Vector4 ref(
                  m.GetElem(0, 0) * v4.X() + m.GetElem(1, 0) * v4.Y() + m.GetElem(2, 0) * v4.Z(),
                  m.GetElem(0, 1) * v4.X() + m.GetElem(1, 1) * v4.Y() + m.GetElem(2, 1) * v4.Z(),
                  m.GetElem(0, 2) * v4.X() + m.GetElem(1, 2) * v4.Y() + m.GetElem(2, 2) * v4.Z(),
                  v4.W());

        r = Mult3x3(v4, m);

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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



        SetFunctionName("Mult3x3(const Vector4 &v, const Matrix44 &m)");

        Matrix44 m;
        Vector3 v3, r;

        m.Set(
            2.0f,  3.0f,  4.0f,  5.0f,
            6.0f,  7.0f,  8.0f,  9.0f,
            10.0f, 11.0f, 12.0f, 13.0f,
            14.0f, 15.0f, 16.0f, 17.0f
            );
        v3.Set(6, -1, -3);

        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 = Mult3x3(v3, m);

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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



        SetFunctionName("Matrix44InverseRotationalComponent(const Matrix44 &src)");

        Matrix44 a, r, ref;
        Vector4 va, vb;

        a.Set(
             0, 1, 0, 0,
            -1, 0, 0, 0,
             0, 0, 1, 0,
             0, 0, 4, 1
             );

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

        va.Set(0.507092552837f, 0.845154254729f, 0.169030850946f, 1.0f);

        r = Matrix44InverseRotationalComponent(a);

        vb = Mult3x3(Mult3x3(va,  a), r);

        Validate(IsSimilar(r, ref) && IsSimilar(va, vb));



      ]]>
      </TEST>


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



        SetFunctionName("Inverse3x3(const Matrix44 &src, &determinant)");

        Matrix44 a, r, ref;
        Vector4 va, vb;

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

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

        va.Set(1.0f, 0.0f, 0.0f, 0.0f);

        float_test_type determinant;
        r = Inverse3x3(a, determinant);

        vb = Mult3x3(Mult3x3(va,  a), r);

        Validate(IsSimilar(r, ref) && IsSimilar(va, vb));



      ]]>
      </TEST>


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



        SetFunctionName("Inverse3x3(const Matrix44 &src, &determinant)");

        Matrix44 a, r, ref;
        Vector4 va, vb;

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

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

        va.Set(1.0f, 0.0f, 0.0f, 0.0f);

        float_test_type determinant;
        r = Inverse3x3(a, determinant);

        vb = Mult3x3(Mult3x3(va,  a), r);

        Validate(IsSimilar(r, ref) && IsSimilar(va, vb));



      ]]>
      </TEST>


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



        SetFunctionName("Determinant3x3(const Matrix44 &result)");

        Matrix44 a;

        a.Set(
             2,-1, 0, 0,
            -1, 2,-1, 0,
             0,-1, 2,-1,
             0, 0,-1, 2
            );

        float_test_type r = Determinant3x3(a);

        Validate(IsEqualWithEpsilon(r, (float_test_type)4.0f));



      ]]>
      </TEST>


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



        SetFunctionName("Matrix44FromScale(const Vector3 &scale)");

        Matrix44 m, r;
        Vector3 s;
        s.Set(3, 5, 1);

        r.Set(
            3, 0, 0, 0,
            0, 5, 0, 0,
            0, 0, 1, 0,
            0, 0, 0, 1
            );

        m = Matrix44FromScale(s);

        Validate(IsSimilar(m, r));



      ]]>
      </TEST>


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



        SetFunctionName("Matrix44FromTranslation(const Vector3 &trans)");

        Matrix44 m, r;
        Vector3 t;
        t.Set(3, 5, 1);

        r.Set(
            1, 0, 0, 0,
            0, 1, 0, 0,
            0, 0, 1, 0,
            3, 5, 1, 1
            );

        m = Matrix44FromTranslation(t);

        Validate(IsSimilar(m, r));



      ]]>
      </TEST>


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



        SetFunctionName("Matrix44FromScaleQuaternion(const Vector3 &scale, const Quaternion &q)");

        Matrix44 r, ref;
        Vector3 t;
        Quaternion q;
        t.Set(3, 5, 1);
        q.Set(0, 0, SQRT_HALF, SQRT_HALF);

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

        r = Matrix44FromScaleQuaternion(t, q);

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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



        SetFunctionName("Matrix44FromScaleTranslation(const Vector3 &scale, const Vector3 &trans)");

        Matrix44 r, ref;
        Vector3 s, t;
        s.Set(3, 5, 1);
        t.Set(2, 1 ,3);

        ref.Set(
            3, 0, 0, 0,
            0, 5, 0, 0,
            0, 0, 1, 0,
            2, 1, 3, 1
            );

        r = Matrix44FromScaleTranslation(s, t);

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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



        SetFunctionName("Matrix44FromDiagonal(float_t a)");

        Matrix44 r, ref;
        float_test_type s = 3.0f;
        ref.Set(
            s, 0, 0, 0,
            0, s, 0, 0,
            0, 0, s, 0,
            0, 0, 0, s
            );
#if defined HOST_TESTING
        r = Matrix44FromDiagonal(s);
#else
        r = Matrix44FromDiagonal<FloatType>(s);
#endif
        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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



        SetFunctionName("Matrix44FromXRotationAngle(angle)");

        Matrix44 r, ref;
        float_test_type angle = 1.3f;

#if defined HOST_TESTING
        r = Matrix44FromXRotationAngle( angle );
#else
        r = Matrix44FromXRotationAngle<FloatType>( angle );
#endif
        ref = Matrix44FromAxisRotationAngle(Vector3(1.0f, 0.0f, 0.0f), angle);

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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



        SetFunctionName("Matrix44FromXRotationAngle(angle)");

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

        for (; angle < float_test_type(PI); angle += float_test_type(0.25f))
        {
    #if defined HOST_TESTING
            r = Matrix44FromXRotationAngle( angle );
    #else
            r = Matrix44FromXRotationAngle<FloatType>( angle );
    #endif
            ref = Matrix44FromAxisRotationAngle(Vector3(1.0f, 0.0f, 0.0f), angle);

        Validate(IsSimilar(r, ref));
        }



      ]]>
      </TEST>


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



        SetFunctionName("Matrix44FromYRotationAngle(angle)");

        Matrix44 r, ref;
        float_test_type angle = 1.3f;

#if defined HOST_TESTING
        r = Matrix44FromYRotationAngle( angle );
#else
        r = Matrix44FromYRotationAngle<FloatType>( angle );
#endif

        ref = Matrix44FromAxisRotationAngle(Vector3(0.0f, 1.0f, 0.0f), angle);

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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



        SetFunctionName("Matrix44FromYRotationAngle(angle)");

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

        for (; angle < float_test_type(PI); angle += float_test_type(0.25f))
        {
    #if defined HOST_TESTING
            r = Matrix44FromYRotationAngle( angle );
    #else
            r = Matrix44FromYRotationAngle<FloatType>( angle );
    #endif
            ref = Matrix44FromAxisRotationAngle(Vector3(0.0f, 1.0f, 0.0f), angle);

        Validate(IsSimilar(r, ref));
        }



      ]]>
      </TEST>


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



        SetFunctionName("Matrix44FromZRotationAngle(angle)");

        Matrix44 r, ref;
        float_test_type angle = 1.3f;

#if defined HOST_TESTING
        r = Matrix44FromZRotationAngle( angle );
#else
        r = Matrix44FromZRotationAngle<FloatType>( angle );
#endif


        ref = Matrix44FromAxisRotationAngle(Vector3(0.0f, 0.0f, 1.0f), angle);

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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



        SetFunctionName("Matrix44FromZRotationAngle(angle)");

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

        for (; angle < float_test_type(PI); angle += float_test_type(0.25f))
        {
    #if defined HOST_TESTING
            r = Matrix44FromZRotationAngle( angle );
    #else
            r = Matrix44FromZRotationAngle<FloatType>( angle );
    #endif
            ref = Matrix44FromAxisRotationAngle(Vector3(0.0f, 0.0f, 1.0f), angle);

        Validate(IsSimilar(r, ref));
        }



      ]]>
      </TEST>


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



        SetFunctionName("RotateAroundXAxis(angle, matrix44)");
        Matrix44 initialMat(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        Matrix44 r, ref;
        float_test_type angle = 1.3f;

#if defined HOST_TESTING
        ref = Mult( Matrix44FromXRotationAngle( angle ), initialMat );
#else
        ref = Mult( Matrix44FromXRotationAngle<FloatType>( angle ), initialMat );
#endif
        r = RotateAroundXAxis(initialMat, angle);


        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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



        SetFunctionName("RotateAroundYAxis(angle, matrix44)");
        Matrix44 initialMat(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        Matrix44 r, ref;
        float_test_type angle = 1.3f;

#if defined HOST_TESTING
        ref = Mult( Matrix44FromYRotationAngle( angle ), initialMat );
#else
        ref = Mult( Matrix44FromYRotationAngle<FloatType>( angle ), initialMat );
#endif
        r = RotateAroundYAxis(initialMat, angle);


        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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



        SetFunctionName("RotateAroundZAxis(angle, matrix44)");
        Matrix44 initialMat(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        Matrix44 r, ref;
        float_test_type angle = 1.3f;

#if defined HOST_TESTING
        ref = Mult( Matrix44FromZRotationAngle( angle ), initialMat );
#else
        ref = Mult( Matrix44FromZRotationAngle<FloatType>( angle ), initialMat );
#endif
        r = RotateAroundZAxis(initialMat, angle);


        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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

        SetFunctionName("Matrix44FromPerspectiveLH(w, h, zn, zf)");

        bool success = true;
        float_test_type w = 10.0f;
        float_test_type h = 16.0f;
        float_test_type zn = 10.0f;
        float_test_type zf = 80.0f;

#if defined HOST_TESTING
        Matrix44 mat(Matrix44FromPerspectiveLH(w, h, zn, zf));
#else
        Matrix44 mat(Matrix44FromPerspectiveLH<FloatType>(w, h, zn, zf));
#endif

        Vector4 minVec(-w/(float_test_type)2.0f, -h/(float_test_type)2.0f, zn, (float_test_type)1.0f);
        Vector4 maxVec(w/(float_test_type)2.0f, h/(float_test_type)2.0f, zf, (float_test_type)1.0f);
        for(int i=0;i<8;i++)
        {
            bool xBool = (i&1)!=0;
            bool yBool = (i&2)!=0;
            bool zBool = (i&4)!=0;
            Vector4 testVector( Select(Mask4(xBool, yBool, zBool, true), maxVec, minVec ) );
            Vector4 result = DivideByW(testVector * mat);

            // Only test x or y values when at the near plane.
            if( !zBool )
            {
                success &= IsSimilar((float)result.X(), xBool ? 1.0f : -1.0f );
                success &= IsSimilar((float)result.Y(), yBool ? 1.0f : -1.0f );
            }
            success &= IsSimilar((float)result.Z(), zBool ? 1.0f: 0.0f );
        }

        Validate(success);

      ]]>
      </TEST>


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

        SetFunctionName("Matrix44FromPerspectiveRH(w, h, zn, zf)");

        bool success = true;
        float_test_type w = 10.0f;
        float_test_type h = 16.0f;
        float_test_type zn = 10.0f;
        float_test_type zf = 80.0f;

#if defined HOST_TESTING
        Matrix44 mat(Matrix44FromPerspectiveRH(w, h, zn, zf));
#else
        Matrix44 mat(Matrix44FromPerspectiveRH<FloatType>(w, h, zn, zf));
#endif

        Vector4 minVec(-w/(float_test_type)2.0f, -h/(float_test_type)2.0f, -zn, (float_test_type)1.0f);
        Vector4 maxVec(w/(float_test_type)2.0f, h/(float_test_type)2.0f, -zf, (float_test_type)1.0f);
        for(int i=0;i<8;i++)
        {
            bool xBool = (i&1)!=0;
            bool yBool = (i&2)!=0;
            bool zBool = (i&4)!=0;
            Vector4 testVector( Select(Mask4(xBool, yBool, zBool, true), maxVec, minVec ) );
            Vector4 result = DivideByW(testVector * mat);

            // Only test x or y values when at the near plane.
            if( !zBool )
            {
                success &= IsSimilar((float)result.X(), xBool ? 1.0f : -1.0f );
                success &= IsSimilar((float)result.Y(), yBool ? 1.0f : -1.0f );
            }
            success &= IsSimilar((float)result.Z(), zBool ? 1.0f: 0.0f );
        }

        Validate(success);

      ]]>
      </TEST>


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



        SetFunctionName("Matrix44FromPerspective(w, h, zn, zf)");
        // Note: These numbers were generated by running Matrix44Perspective on the input.
        // This test case will only ensure future changes don't modify the results generated.
        Matrix44 ref(
                    0.0125f,    0.0f,            0.0f,      0.0f,
                       0.0f,    0.0222222f,      0.0f,      0.0f,
                       0.0f,    0.0f,         -1.001f,     -1.0f,
                       0.0f,    0.0f,        -0.1001f,      0.0f
                );

        Matrix44 r;

#if defined HOST_TESTING
        r = Matrix44FromPerspective(16.0f, 9.0f, 0.1f, 100.0f);
#else
        r = Matrix44FromPerspective<FloatType>(16.0f, 9.0f, 0.1f, 100.0f);
#endif

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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

        SetFunctionName("Matrix44FromOrthoLH(w, h, zn, zf)");

        bool success = true;
        float_test_type w = 10.0f;
        float_test_type h = 16.0f;
        float_test_type zn = 10.0f;
        float_test_type zf = 80.0f;

#if defined HOST_TESTING
        Matrix44 mat(Matrix44FromOrthoLH(w, h, zn, zf));
#else
        Matrix44 mat(Matrix44FromOrthoLH<FloatType>(w, h, zn, zf));
#endif

        Vector4 minVec(-w/2.0f, -h/2.0f, zn, (float_test_type)1.0f);
        Vector4 maxVec(w/2.0f, h/2.0f, zf, (float_test_type)1.0f);
        for(int i=0;i<8;i++)
        {
            bool xBool = (i&1)!=0;
            bool yBool = (i&2)!=0;
            bool zBool = (i&4)!=0;
            Vector4 testVector( Select(Mask4(xBool, yBool, zBool, true), maxVec, minVec ) );
            Vector4 result = testVector * mat;

            success &= IsSimilar((float)result.X(), xBool ? 1.0f : -1.0f );
            success &= IsSimilar((float)result.Y(), yBool ? 1.0f : -1.0f );
            success &= IsSimilar((float)result.Z(), zBool ? 1.0f: 0.0f );
        }

        Validate(success);

      ]]>
      </TEST>


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

        SetFunctionName("Matrix44FromOrthoRH(w, h, zn, zf)");

        bool success = true;
        float_test_type w = 10.0f;
        float_test_type h = 16.0f;
        float_test_type zn = 10.0f;
        float_test_type zf = 80.0f;

#if defined HOST_TESTING
        Matrix44 mat(Matrix44FromOrthoRH(w, h, zn, zf));
#else
        Matrix44 mat(Matrix44FromOrthoRH<FloatType>(w, h, zn, zf));
#endif

        Vector4 minVec(-w/(float_test_type)2.0f, -h/2.0f, -zn, (float_test_type)1.0f);
        Vector4 maxVec(w/(float_test_type)2.0f, h/2.0f, -zf, (float_test_type)1.0f);
        for(int i=0;i<8;i++)
        {
            bool xBool = (i&1)!=0;
            bool yBool = (i&2)!=0;
            bool zBool = (i&4)!=0;
            Vector4 testVector( Select(Mask4(xBool, yBool, zBool, true), maxVec, minVec ) );
            Vector4 result = testVector * mat;

            success &= IsSimilar((float)result.X(), xBool ? 1.0f : -1.0f );
            success &= IsSimilar((float)result.Y(), yBool ? 1.0f : -1.0f );
            success &= IsSimilar((float)result.Z(), zBool ? 1.0f: 0.0f );
        }

        Validate(success);

      ]]>
      </TEST>


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



        SetFunctionName("Matrix44FromOrtho(w, h, zn, zf)");
        // Note: These numbers were generated by running Matrix44Ortho on the input.
        // This test case will only ensure future changes don't modify the results generated.
        Matrix44 ref(
                0.125f, 0.0f,       0.0f,       0.0f,
                0.0f,   0.222222f,  0.0f,       0.0f,
                0.0f,   0.0f,       -0.01001f,  0.0f,
                0.0f,   0.0f,       -0.001001f, 1.0f
                );

        Matrix44 r;

#if defined HOST_TESTING
        r = Matrix44FromOrtho(16.0f, 9.0f, 0.1f, 100.0f);
#else
        r = Matrix44FromOrtho<FloatType>(16.0f, 9.0f, 0.1f, 100.0f);
#endif

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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

        SetFunctionName("Matrix44FromOrthoOffCenterLH(l, r, b, t, zn, zf)");

        bool success = true;
        float_test_type l = -3.0f;
        float_test_type r = 5.0f;
        float_test_type t = 6.0f;
        float_test_type b = -8.0f;
        float_test_type zn = 10.0f;
        float_test_type zf = 80.0f;

#if defined HOST_TESTING
        Matrix44 mat(Matrix44FromOrthoOffCenterLH(l, r, b, t, zn, zf));
#else
        Matrix44 mat(Matrix44FromOrthoOffCenterLH<FloatType>(l, r, b, t, zn, zf));
#endif

        Vector4 minVec(l, b, zn, (float_test_type)1.0f);
        Vector4 maxVec(r, t, zf, (float_test_type)1.0f);
        for(int i=0;i<8;i++)
        {
            bool xBool = (i&1)!=0;
            bool yBool = (i&2)!=0;
            bool zBool = (i&4)!=0;
            Vector4 testVector( Select(Mask4(xBool, yBool, zBool, true), maxVec, minVec ) );
            Vector4 result = testVector * mat;

            success &= IsSimilar((float)result.X(), xBool ? 1.0f : -1.0f );
            success &= IsSimilar((float)result.Y(), yBool ? 1.0f : -1.0f );
            success &= IsSimilar((float)result.Z(), zBool ? 1.0f: 0.0f );
        }

        Validate(success);

      ]]>
      </TEST>


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

        SetFunctionName("Matrix44FromOrthoOffCenterRH(l, r, b, t, zn, zf)");

        bool success = true;
        float_test_type l = -3.0f;
        float_test_type r = 5.0f;
        float_test_type t = 6.0f;
        float_test_type b = -8.0f;
        float_test_type zn = 10.0f;
        float_test_type zf = 80.0f;

#if defined HOST_TESTING
        Matrix44 mat(Matrix44FromOrthoOffCenterRH(l, r, b, t, zn, zf));
#else
        Matrix44 mat(Matrix44FromOrthoOffCenterRH<FloatType>(l, r, b, t, zn, zf));
#endif

        Vector4 minVec(l, b, -zn, (float_test_type)1.0f);
        Vector4 maxVec(r, t, -zf, (float_test_type)1.0f);
        for(int i=0;i<8;i++)
        {
            bool xBool = (i&1)!=0;
            bool yBool = (i&2)!=0;
            bool zBool = (i&4)!=0;
            Vector4 testVector( Select(Mask4(xBool, yBool, zBool, true), maxVec, minVec ) );
            Vector4 result = testVector * mat;

            success &= IsSimilar((float)result.X(), xBool ? 1.0f : -1.0f );
            success &= IsSimilar((float)result.Y(), yBool ? 1.0f : -1.0f );
            success &= IsSimilar((float)result.Z(), zBool ? 1.0f: 0.0f );
        }

        Validate(success);

      ]]>
      </TEST>


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



        SetFunctionName("Matrix44FromOrthoOffCenter(l, r, b, t, zn, zf)");
        // Note: These numbers were generated by running Matrix44OrthoOffCenter on the input.
        // This test case will only ensure future changes don't modify the results generated.
        Matrix44 ref(
                0.12500000f,  0.00000000f,    0.00000000f,   0.00000000f,
                0.00000000f,  0.22222222f,    0.00000000f,   0.00000000f,
                0.00000000f,  0.00000000f,  -0.010010010f,   0.00000000f,
                0.25000000f, -0.11111111f, -0.0010010010f,    1.0000000f
                );

        Matrix44 r;

#if defined HOST_TESTING
        r = Matrix44FromOrthoOffCenter(-10.0f, 6.0f, -4.0f, 5.0f, 0.1f, 100.0f);
#else
        r = Matrix44FromOrthoOffCenter<FloatType>(-10.0f, 6.0f, -4.0f, 5.0f, 0.1f, 100.0f);
#endif

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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



        SetFunctionName("Matrix44FromQuaternionTranslation(q, trans)");
        // Note: These numbers were generated by running Matrix44FromQuaternionTranslation on the input.
        // This test case will only ensure future changes don't modify the results generated.
        Matrix44 ref(
                -0.63003671f,      0.77655685f,    0.0036630034f,      0.00000000f,
                -0.76190484f,     -0.61904776f,      0.19047621f,      0.00000000f,
                0.15018317f,      0.11721613f,      0.98168498f,      0.00000000f,
                1.0000000f,       2.0000000f,       3.0000000f,       1.0000000f
                );

        Matrix44 r;

        r = Matrix44FromQuaternionTranslation(Normalize(Quaternion(0.1f, 0.2f, 2.1f, 1.0f)), Vector3(1.0f, 2.0f, 3.0f));

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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



        SetFunctionName("Matrix44FromQuaternionTranslation(q, trans, r)");
        // Note: These numbers were generated by running Matrix44FromQuaternionTranslation on the input.
        // This test case will only ensure future changes don't modify the results generated.
        Matrix44 ref(
                -0.63003671f,      0.77655685f,    0.0036630034f,      0.00000000f,
                -0.76190484f,     -0.61904776f,      0.19047621f,      0.00000000f,
                0.15018317f,      0.11721613f,      0.98168498f,      0.00000000f,
                1.0000000f,       2.0000000f,       3.0000000f,       1.0000000f
                );

        Matrix44 r;

        r = Matrix44FromQuaternionTranslation(Normalize(Quaternion(0.1f, 0.2f, 2.1f, 1.0f)), Vector3(1.0f, 2.0f, 3.0f));

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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



        SetFunctionName("Matrix44FromScaleQuaternionTranslation(scale, q, trans)");
        // Note: These numbers were generated by running Matrix44FromScaleQuaternionTranslation on the input.
        // This test case will only ensure future changes don't modify the results generated.
        Matrix44 ref(
                    -1.8901101f,       2.3296704f,     0.010989010f,      0.00000000f,
                    -1.5238097f,      -1.2380955f,      0.38095242f,      0.00000000f,
                    0.15018317f,      0.11721613f,      0.98168498f,      0.00000000f,
                     1.0000000f,       2.0000000f,       3.0000000f,       1.0000000f
                );

        Matrix44 r;

        r = Matrix44FromScaleQuaternionTranslation(Vector3(3.0f, 2.0f, 1.0f), Normalize(Quaternion(0.1f, 0.2f, 2.1f, 1.0f)), Vector3(1.0f, 2.0f, 3.0f));

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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



        SetFunctionName("Matrix44FromScaleQuaternionTranslation(scale, q, trans, r)");
        // Note: These numbers were generated by running Matrix44FromScaleQuaternionTranslation on the input.
        // This test case will only ensure future changes don't modify the results generated.
        Matrix44 ref(
                    -1.8901101f,       2.3296704f,     0.010989010f,      0.00000000f,
                    -1.5238097f,      -1.2380955f,      0.38095242f,      0.00000000f,
                    0.15018317f,      0.11721613f,      0.98168498f,      0.00000000f,
                     1.0000000f,       2.0000000f,       3.0000000f,       1.0000000f
                );

        Matrix44 r;

        r = Matrix44FromScaleQuaternionTranslation(Vector3(3.0f, 2.0f, 1.0f), Normalize(Quaternion(0.1f, 0.2f, 2.1f, 1.0f)), Vector3(1.0f, 2.0f, 3.0f));

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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

        SetFunctionName("Matrix44FromPerspectiveFovLH(fov, aspect, zn, zf)");

        bool success = true;
        float_test_type fov = 60.0f * 2.0f * 3.14159265359f / 360.0f;   // Use a 60 degree FOV
        float_test_type aspect = 4.0f/3.0f;
        float_test_type zn = 10.0f;
        float_test_type zf = 40.0f;

        float_test_type halfHeight = zn * 0.577350269f /*tan(fov/2)*/;
        float_test_type halfWidth = aspect * halfHeight;

#if defined HOST_TESTING
        Matrix44 mat(Matrix44FromPerspectiveFovLH(fov, aspect, zn, zf));
#else
        Matrix44 mat(Matrix44FromPerspectiveFovLH<FloatType>(fov, aspect, zn, zf));
#endif

        Vector4 minVec(-halfWidth, -halfHeight, zn, (float_test_type)1.0f);
        Vector4 maxVec( halfWidth,  halfHeight, zf, (float_test_type)1.0f);
        for(int i=0;i<8;i++)
        {
            bool xBool = (i&1)!=0;
            bool yBool = (i&2)!=0;
            bool zBool = (i&4)!=0;
            Vector4 testVector( Select(Mask4(xBool, yBool, zBool, true), maxVec, minVec ) );
            Vector4 result = DivideByW(testVector * mat);

            // Only test x or y values when at the near plane.
            if( !zBool )
            {
                success &= IsSimilar((float)result.X(), xBool ? 1.0f : -1.0f );
                success &= IsSimilar((float)result.Y(), yBool ? 1.0f : -1.0f );
            }
            success &= IsSimilar((float)result.Z(), zBool ? 1.0f: 0.0f );
        }

        Validate(success);

      ]]>
      </TEST>


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

        SetFunctionName("Matrix44FromPerspectiveFovRH(fov, aspect, zn, zf)");

        bool success = true;
        float_test_type fov = 60.0f * 2.0f * 3.14159265359f / 360.0f;   // Use a 60 degree FOV
        float_test_type aspect = 4.0f/3.0f;
        float_test_type zn = 10.0f;
        float_test_type zf = 40.0f;

        float_test_type halfHeight = zn * 0.577350269f /*tan(fov/2)*/;
        float_test_type halfWidth = aspect * halfHeight;

#if defined HOST_TESTING
        Matrix44 mat(Matrix44FromPerspectiveFovRH(fov, aspect, zn, zf));
#else
        Matrix44 mat(Matrix44FromPerspectiveFovRH<FloatType>(fov, aspect, zn, zf));
#endif

        Vector4 minVec(-halfWidth, -halfHeight, -zn, (float_test_type)1.0f);
        Vector4 maxVec( halfWidth,  halfHeight, -zf, (float_test_type)1.0f);
        for(int i=0;i<8;i++)
        {
            bool xBool = (i&1)!=0;
            bool yBool = (i&2)!=0;
            bool zBool = (i&4)!=0;
            Vector4 testVector( Select(Mask4(xBool, yBool, zBool, true), maxVec, minVec ) );
            Vector4 result = DivideByW(testVector * mat);

            // Only test x or y values when at the near plane.
            if( !zBool )
            {
                success &= IsSimilar((float)result.X(), xBool ? 1.0f : -1.0f );
                success &= IsSimilar((float)result.Y(), yBool ? 1.0f : -1.0f );
            }
            success &= IsSimilar((float)result.Z(), zBool ? 1.0f: 0.0f );
        }

        Validate(success);

      ]]>
      </TEST>


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



        SetFunctionName("Matrix44FromPerspectiveFov(fov, aspect, zn, zf)");
        // Note: These numbers were generated by running Matrix44PerspectiveFov on the input.
        // This test case will only ensure future changes don't modify the results generated.
        Matrix44 ref(
                0.89043140f,      0.00000000f,      0.00000000f,      0.00000000f,
                0.00000000f,       1.1872418f,      0.00000000f,      0.00000000f,
                0.00000000f,      0.00000000f,      -1.0001000f,      -1.0000000f,
                0.00000000f,      0.00000000f,    -0.010001000f,      0.00000000f
                );

        Matrix44 r;

#if defined HOST_TESTING
        r = Matrix44FromPerspectiveFov(1.4f, 4.0f/3.0f, 0.01f, 100.0f);
#else
        r = Matrix44FromPerspectiveFov<FloatType>(1.4f, 4.0f/3.0f, 0.01f, 100.0f);
#endif

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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

        SetFunctionName("Matrix44FromLookAt(Vector3 lookAt, Vector3 up, Vector3 eyePosition)");
        // Note: These numbers were generated by running Matrix44LookAt on the input.
        // This test case will only ensure future changes don't modify the results generated.
        Matrix44 ref(
           0.70710677f,     -0.40824825f,      0.57735020f,      0.00000000f,
           0.00000000f,      0.81649649f,      0.57735020f,      0.00000000f,
          -0.70710677f,     -0.40824825f,      0.57735020f,      0.00000000f,
           0.00000000f,      0.00000000f,      -17.320505f,       1.0000000f
        );

        Matrix44 r;

        Vector3 eye(10, 10, 10);
        Vector3 focal(0, 0, 0);
        Vector3 up(0, 1, 0);
        r = Matrix44FromLookAt(focal, up, eye);

        Validate(IsSimilar(r, ref));

      ]]>
      </TEST>


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

        SetFunctionName("Matrix44FromLookAtLH(Vector3 lookAt, Vector3 up, Vector3 eyePosition)");

        Vector3 lookAt(1.0f, 11.0f, 17.0f);
        Vector3 eyePoint(3.0f, -7.0f, 11.0f);
        Matrix44 viewMat(Matrix44FromLookAtLH(lookAt, GetVector3_YAxis(), eyePoint ));
        Vector3 lookResult = TransformPoint(lookAt, viewMat);
        Vector3 eyeResult = TransformPoint(eyePoint, viewMat);

        Vector3 refLook = Vector3((float_test_type)0.0f, (float_test_type)0.0f, Magnitude(lookAt-eyePoint) );
        Vector3 refEye = Vector3((float_test_type)0.0f, (float_test_type)0.0f, (float_test_type)0.0f );

        Validate(
            IsSimilar(lookResult, refLook, (float_test_type)0.001f) &&
            IsSimilar(eyeResult, refEye, (float_test_type)0.001f)
        );

      ]]>
      </TEST>


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

        SetFunctionName("Matrix44FromLookAtRH(Vector3 lookAt, Vector3 up, Vector3 eyePosition)");

        Vector3 lookAt(1.0f, 11.0f, 17.0f);
        Vector3 eyePoint(3.0f, -7.0f, 11.0f);
        Matrix44 viewMat(Matrix44FromLookAtRH(lookAt, GetVector3_YAxis(), eyePoint ));
        Vector3 lookResult = TransformPoint(lookAt, viewMat);
        Vector3 eyeResult = TransformPoint(eyePoint, viewMat);

        Vector3 refLook = Vector3((float_test_type)0.0f, (float_test_type)0.0f, -Magnitude(lookAt-eyePoint) );
        Vector3 refEye = Vector3((float_test_type)0.0f, (float_test_type)0.0f, (float_test_type)0.0f );

        Validate(
            IsSimilar(lookResult, refLook, (float_test_type)0.001f) &&
            IsSimilar(eyeResult, refEye, (float_test_type)0.001f)
        );

      ]]>
      </TEST>


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



        SetFunctionName("Matrix44FromLookAt(Vector3 lookAt, Vector3 up, Vector3 eyePosition)");


        Matrix44 r, ref;
        ref = GetMatrix44_Identity();

        Vector3 eye(0, 0, 0);
        Vector3 focal(0, 0, -10);
        Vector3 up(0, 1, 0);
        r = Matrix44FromLookAt(focal, up, eye);

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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



        SetFunctionName("Matrix44FromPerspectiveOffCenter(l, r, b, t, zn, zf)");
        // Note: These numbers were generated by running Matrix44PerspectiveOffCenter on the input.
        // This test case will only ensure future changes don't modify the results generated.
        Matrix44 ref(
            0.012500000f,  0.00000000f,  0.00000000f, 0.00000000f,
             0.00000000f, 0.022222223f,  0.00000000f, 0.00000000f,
            -0.25000000f,  0.11111111f,  -1.0010010f, -1.0000000f,
             0.00000000f,  0.00000000f, -0.10010010f, 0.00000000f 
        );

        Matrix44 r;

#if defined HOST_TESTING
        r = Matrix44FromPerspectiveOffCenter(-10.0f, 6.0f, -4.0f, 5.0f, 0.1f, 100.0f);
#else
        r = Matrix44FromPerspectiveOffCenter<FloatType>(-10.0f, 6.0f, -4.0f, 5.0f, 0.1f, 100.0f);
#endif

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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

        SetFunctionName("Matrix44FromPerspectiveOffCenterLH(l, r, b, t, zn, zf)");

        bool success = true;
        float_test_type l = -3.0f;
        float_test_type r = 5.0f;
        float_test_type t = 6.0f;
        float_test_type b = -8.0f;
        float_test_type zn = 10.0f;
        float_test_type zf = 80.0f;

#if defined HOST_TESTING
        Matrix44 mat(Matrix44FromPerspectiveOffCenterLH(l, r, b, t, zn, zf));
#else
        Matrix44 mat(Matrix44FromPerspectiveOffCenterLH<FloatType>(l, r, b, t, zn, zf));
#endif

        Vector4 minVec(l, b, zn, (float_test_type)1.0f);
        Vector4 maxVec(r, t, zf, (float_test_type)1.0f);
        for(int i=0;i<8;i++)
        {
            bool xBool = (i&1)!=0;
            bool yBool = (i&2)!=0;
            bool zBool = (i&4)!=0;
            Vector4 testVector( Select(Mask4(xBool, yBool, zBool, true), maxVec, minVec ) );
            Vector4 result = DivideByW(testVector * mat);

            // Only test x or y values when at the near plane.
            if( !zBool )
            {
                success &= IsSimilar((float)result.X(), xBool ? 1.0f : -1.0f );
                success &= IsSimilar((float)result.Y(), yBool ? 1.0f : -1.0f );
            }
            success &= IsSimilar((float)result.Z(), zBool ? 1.0f: 0.0f );
        }

        Validate(success);

      ]]>
      </TEST>


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

        SetFunctionName("Matrix44FromPerspectiveOffCenterRH(l, r, b, t, zn, zf)");

        bool success = true;
        float_test_type l = -3.0f;
        float_test_type r = 5.0f;
        float_test_type t = 6.0f;
        float_test_type b = -8.0f;
        float_test_type zn = 10.0f;
        float_test_type zf = 80.0f;

#if defined HOST_TESTING
        Matrix44 mat(Matrix44FromPerspectiveOffCenterRH(l, r, b, t, zn, zf));
#else
        Matrix44 mat(Matrix44FromPerspectiveOffCenterRH<FloatType>(l, r, b, t, zn, zf));
#endif

        Vector4 minVec(l, b, -zn, (float_test_type)1.0f);
        Vector4 maxVec(r, t, -zf, (float_test_type)1.0f);
        for(int i=0;i<8;i++)
        {
            bool xBool = (i&1)!=0;
            bool yBool = (i&2)!=0;
            bool zBool = (i&4)!=0;
            Vector4 testVector( Select(Mask4(xBool, yBool, zBool, true), maxVec, minVec ) );
            Vector4 result = DivideByW(testVector * mat);

            // Only test x or y values when at the near plane.
            if( !zBool )
            {
                success &= IsSimilar((float)result.X(), xBool ? 1.0f : -1.0f );
                success &= IsSimilar((float)result.Y(), yBool ? 1.0f : -1.0f );
            }
            success &= IsSimilar((float)result.Z(), zBool ? 1.0f: 0.0f );
        }

        Validate(success);

      ]]>
      </TEST>


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



        SetFunctionName("GetNormalError3x3(Matrix44 matrix)");
        Matrix44 mat(
            1.1f, 0.0f, 0.1f, 0.0f,
            0.1f, 1.0f, 0.0f, 0.2f,
            0.0f, 0.0f, 1.0f, 0.0f,
            0.0f, -0.1f, 0.0f, 1.0f
        );

        float_test_type r = GetNormalError3x3(mat);

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



      ]]>
      </TEST>


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



        SetFunctionName("IsNormal3x3(Matrix44 matrix)");
        Matrix44 mat1(
            0.2672612f,    0.5345225f,    0.8017837f, 1.0f,
            0.0f, 1.0f, 0.0f, 2.0f,
            0.0f, 0.0f, 1.0f, 3.0f,
            0.0f, 0.0f, 0.0f, 1.0f
        );
        Matrix44 mat2(
            1.0f, 0.3f, 0.0f, 2.0f,
            0.0f, 1.0f, 0.0f, 2.0f,
            0.0f, 0.0f, 1.0f, 3.0f,
            0.0f, 0.0f, 0.0f, 1.0f
        );

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



      ]]>
      </TEST>


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



        SetFunctionName("GetOrthogonalRowSetError3x3(Matrix44 matrix)");
        Matrix44 mat(
            1.1f, 0.0f, 0.1f, 0.0f,
            0.1f, 1.0f, 0.0f, 0.2f,
            0.0f, 0.0f, 1.0f, 0.0f,
            0.0f, -0.1f, 0.0f, 1.0f
        );

        float_test_type r = GetOrthogonalRowSetError3x3(mat);

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



      ]]>
      </TEST>


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



        SetFunctionName("QueryRotateDegenerateUnitAxis(Matrix44::InParam matrix, Vector3::OutParam unitAxis)");
        Matrix44 mat(
            1.1f, 0.0f, 0.1f, 0.0f,
            0.1f, 1.0f, 0.0f, 0.2f,
            0.0f, 0.0f, 1.0f, 0.0f,
            0.0f, -0.1f, 0.0f, 1.0f
        );

        Vector3 r = QueryRotateDegenerateUnitAxis(mat);

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



      ]]>
      </TEST>


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



        SetFunctionName("void QueryRotate(Matrix44::InParam matrix, Vector3::OutParam unitAxis, VecFloat::OutParam angle, Vector3::OutParam center)");
        Vector3 axis = Normalize(Vector3(1,2,3));
        Vector3 translation(5.0f, 3.0f, 7.0f);
        Matrix44 mat = Matrix44Translate( Matrix44FromAxisRotationAngle(axis, (float_test_type)1.0f), translation);

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

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



      ]]>
      </TEST>


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



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

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



      ]]>
      </TEST>


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



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

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



      ]]>
      </TEST>


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



        SetFunctionName("IsOrthogonalRowSet3x3(Matrix44 matrix)");
        // upper left 3x3 of mat1 is normal but not orthogonal.
        Matrix44 mat1(
            0.2672612f,    0.5345225f,    0.8017837f, 1.0f,
            0.0f, 1.0f, 0.0f, 2.0f,
            0.0f, 0.0f, 1.0f, 3.0f,
            0.0f, 0.0f, 0.0f, 1.0f
        );
        // upper left 3x3 of mat2 is not normal nor orthogonal.
        Matrix44 mat2(
            1.0f, 0.3f, 0.0f, 2.0f,
            0.0f, 1.0f, 0.0f, 2.0f,
            0.0f, 0.0f, 1.0f, 3.0f,
            0.0f, 0.0f, 0.0f, 1.0f
        );

        // upper left 3x3 of mat3 is orthogonal
        Matrix44 mat3(
            -0.5097992f,  0.2732867f, -0.8157323f, 10.0f,
            -1.2839158f, -1.5041522f,  0.2984735f, 10.0f,
            -1.718125f,   1.7992397f,  1.6765389f, 10.0f,
                 10.0f,        10.0f,       10.0f, 10.0f
        );

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



      ]]>
      </TEST>


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



        SetFunctionName("IsOrthogonal3x3(Matrix44 matrix)");

        Matrix44 mat1(
            0.2672612f, 0.5345225f, 0.8017837f, 0.3234234f,
            0.0f, 1.0f, 0.0f, 2.0f,
            0.0f, 0.0f, 1.0f, 1.1f,
            0.0f, 0.0f, 0.0f, 0.1f
        );

        Matrix44 mat2(
            1.0f, 0.3f, 0.0f, 1.0f,
            0.0f, 1.0f, 0.0f, 0.0f,
            0.0f, 0.0f, 1.0f, 0.1f,
            0.0f, 0.0f, 0.0f, 1.0f
        );

        // upper left 3x3 of mat3 is orthogonal
        Matrix44 mat3(
             0.3333333f,  0.6666667f,  0.6666667f, 1.0f,
            -0.8944272f,  0.4472136f,  0.0f,       2.0f,
            -0.2981424f, -0.5962848f,  0.7453560f, 1.1f,
             1.0f,        1.0f,        1.0f,       0.0f
        );

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



      ]]>
      </TEST>


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



        SetFunctionName("OrthoNormalize3x3(m)");
        Matrix44 initialMat(
             0.0683740f,   0.7263507f,   0.2320748f, 1.0f,
             0.5608486f,   0.1985144f,   0.2312237f, 1.0f,
             0.6623569f,   0.5442573f,   0.2164633f, 1.0f,
                  10.0f,        10.0f,       10.0f, 10.0f
            );

        Matrix44 r = OrthoNormalize3x3(initialMat);
        bool isOrtho = IsOrthogonal3x3(r, (float_test_type)0.01f);

        bool isNormal = IsNormal3x3(r, (float_test_type)0.01f);

        Matrix44 mat2 = Matrix44FromEulerXYZ(Vector3(1.0f, 2.0f, 3.0f));
        Matrix44 r2 = OrthoNormalize3x3(mat2);

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



      ]]>
      </TEST>


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



        SetFunctionName("Inverse3x3(m)");
        Matrix44 initialMat(
             0.0683740f,   0.7263507f,   0.2320748f, 1.0f,
             0.5608486f,   0.1985144f,   0.2312237f, 1.0f,
             0.6623569f,   0.5442573f,   0.2164633f, 1.0f,
                  10.0f,        10.0f,       10.0f, 10.0f
            );
        Matrix33 productRef(
            1.0f, 0.0f, 0.0f,
            0.0f, 1.0f, 0.0f,
            0.0f, 0.0f, 1.0f
            );

        Matrix44 r = Inverse3x3(initialMat);
        Matrix33 m33Init(GetXYZ(initialMat.XAxis()), GetXYZ(initialMat.YAxis()), GetXYZ(initialMat.ZAxis()));
        Matrix33 m33R(GetXYZ(r.XAxis()), GetXYZ(r.YAxis()), GetXYZ(r.ZAxis()));
        Matrix33 product = Mult(m33R, m33Init);
        Validate( IsSimilar(product, productRef) &&
                  r.XAxis().W() == initialMat.XAxis().W() &&
                  r.YAxis().W() == initialMat.YAxis().W() &&
                  r.ZAxis().W() == initialMat.ZAxis().W() &&
                  r.WAxis() == initialMat.WAxis()
            );



      ]]>
      </TEST>


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



        SetFunctionName("Matrix44TransposeRotationalComponent(m)");
        Matrix44 initialMat = Matrix44FromEulerXYZ(Vector3(1.0f, 2.3f, -1.4f));
        Matrix44 ref = Transpose(initialMat);

        Matrix44 r;
        r = Matrix44TransposeRotationalComponent(initialMat);

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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



        SetFunctionName("Matrix44Translate(m, trans)");
        Matrix44 initialMat = Matrix44FromEulerXYZ(Vector3(1.0f, 2.3f, -1.4f));

        Matrix44 translationMatrix( 1.0f, 0.0f, 0.0f, 0.0f,
                                    0.0f, 1.0f, 0.0f, 0.0f,
                                    0.0f, 0.0f, 1.0f, 0.0f,
                                    1.0f, 2.0f, 5.0f, 1.0f );
        Vector3 &transVec = *reinterpret_cast<Vector3*>(&translationMatrix.GetRow(3));
        Matrix44 ref = Mult( translationMatrix, initialMat );

        Matrix44 r = Matrix44Translate(initialMat, transVec);

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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



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

        Matrix44 ref(
                2.0f, 2.0f, 2.0f, 1.0f,
                3.0f, 3.0f, 3.0f, 1.0f,
                4.0f, 4.0f, 4.0f, 1.0f,
                1.0f, 1.0f, 1.0f, 1.0f );

        Matrix44 r;
        r = ScaleRow(initialMat, (float_test_type)2.0f, (float_test_type)3.0f, (float_test_type)4.0f);

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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



        SetFunctionName("ScaleColumn(m, c0, c1, c2)");
        Matrix44 initialMat(
                1.0f, 1.0f, 1.0f, 1.0f,
                1.0f, 1.0f, 1.0f, 1.0f,
                1.0f, 1.0f, 1.0f, 1.0f,
                1.0f, 1.0f, 1.0f, 1.0f );

        Matrix44 ref(
                2.0f, 3.0f, 4.0f, 1.0f,
                2.0f, 3.0f, 4.0f, 1.0f,
                2.0f, 3.0f, 4.0f, 1.0f,
                1.0f, 1.0f, 1.0f, 1.0f );

        Matrix44 r;
        r = ScaleColumn(initialMat, (float_test_type)2.0f, (float_test_type)3.0f, (float_test_type)4.0f);

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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



        SetFunctionName("EulerXYZFromMatrix44(const Matrix44& m)");

        Matrix44 m;
        Vector3 r, ref;

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

        ref.Set(0, 0, HALF_PI);

        r= EulerXYZFromMatrix44(m);

        Validate(IsSimilar(r, ref));



      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Mult3x3(const Vector4 &v, const Matrix44 &m, Vector4 &result)");

        Matrix44 m;
        Vector4 v4, r;

        m.Set(
                2.0f,  3.0f,  4.0f,  5.0f,
                6.0f,  7.0f,  8.0f,  9.0f,
               10.0f, 11.0f, 12.0f, 13.0f,
               14.0f, 15.0f, 16.0f, 17.0f
             );
        v4.Set(6, -1, -3, 2);

        Vector4 ref(
                  m.GetElem(0, 0) * v4.X() + m.GetElem(1, 0) * v4.Y() + m.GetElem(2, 0) * v4.Z(),
                  m.GetElem(0, 1) * v4.X() + m.GetElem(1, 1) * v4.Y() + m.GetElem(2, 1) * v4.Z(),
                  m.GetElem(0, 2) * v4.X() + m.GetElem(1, 2) * v4.Y() + m.GetElem(2, 2) * v4.Z(),
                  v4.W());

        Mult3x3(v4, m, r);

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Mult3x3(const Vector4 &v, const Matrix44 &m, Vector4 &result)");

        Matrix44 m;
        Vector3 v3, r;

        m.Set(
            2.0f,  3.0f,  4.0f,  5.0f,
            6.0f,  7.0f,  8.0f,  9.0f,
            10.0f, 11.0f, 12.0f, 13.0f,
            14.0f, 15.0f, 16.0f, 17.0f
            );
        v3.Set(6, -1, -3);

        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());

        Mult3x3(v3, m, r);

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Matrix44PerspectiveOffCenter(l, r, b, t, zn, zf, Matrix44&)");
        // Note: These numbers were generated by running Matrix44PerspectiveOffCenter on the input.
        // This test case will only ensure future changes don't modify the results generated.
        Matrix44 ref(
            0.012500000f,  0.00000000f,  0.00000000f, 0.00000000f,
             0.00000000f, 0.022222223f,  0.00000000f, 0.00000000f,
            -0.25000000f,  0.11111111f,  -1.0010010f, -1.0000000f,
             0.00000000f,  0.00000000f, -0.10010010f, 0.00000000f 
        );

        Matrix44 r;

#if defined HOST_TESTING
        Matrix44PerspectiveOffCenter(-10.0f, 6.0f, -4.0f, 5.0f, 0.1f, 100.0f, r);
#else
        Matrix44PerspectiveOffCenter<FloatType>(-10.0f, 6.0f, -4.0f, 5.0f, 0.1f, 100.0f, r);
#endif

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Matrix44FromScale(const Vector3 &scale, Matrix44 &result)");

        Matrix44 m, r;
        Vector3 s;
        s.Set(3, 5, 1);

        r.Set(
            3, 0, 0, 0,
            0, 5, 0, 0,
            0, 0, 1, 0,
            0, 0, 0, 1
            );

        Matrix44FromScale(s, m);

        Validate(IsSimilar(m, r));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Matrix44FromTranslation(const Vector3 &trans, Matrix44 &result)");

        Matrix44 m, r;
        Vector3 t;
        t.Set(3, 5, 1);

        r.Set(
            1, 0, 0, 0,
            0, 1, 0, 0,
            0, 0, 1, 0,
            3, 5, 1, 1
            );

        Matrix44FromTranslation(t, m);

        Validate(IsSimilar(m, r));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Matrix44FromScaleQuaternion(const Vector3 &scale, const Quaternion &q, Matrix44 &result)");

        Matrix44 r, ref;
        Vector3 t;
        Quaternion q;
        t.Set(3, 5, 1);
        q.Set(0, 0, SQRT_HALF, SQRT_HALF);

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

        Matrix44FromScaleQuaternion(t, q, r);

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Matrix44FromScaleTranslation(const Vector3 &scale, const Vector3 &trans, Matrix44 &result)");

        Matrix44 r, ref;
        Vector3 s, t;
        s.Set(3, 5, 1);
        t.Set(2, 1 ,3);

        ref.Set(
            3, 0, 0, 0,
            0, 5, 0, 0,
            0, 0, 1, 0,
            2, 1, 3, 1
            );

        Matrix44FromScaleTranslation(s, t, r);

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Mult(const Vector4 &v, const Matrix44 &m, Vector4&)");

        Matrix44 m;
        Vector4 v4, ra;
        v4.Set(6.0f, -1.0f, -3.0f, 1.0f);
        m.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        Vector4 r;
        Mult(v4, m, r); // test with non-aliasing

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

        Vector4 ref(
                  m.GetElem(0, 0) * v4.X() + m.GetElem(1, 0) * v4.Y() + m.GetElem(2, 0) * v4.Z() + m.GetElem(3, 0) * v4.W(),
                  m.GetElem(0, 1) * v4.X() + m.GetElem(1, 1) * v4.Y() + m.GetElem(2, 1) * v4.Z() + m.GetElem(3, 1) * v4.W(),
                  m.GetElem(0, 2) * v4.X() + m.GetElem(1, 2) * v4.Y() + m.GetElem(2, 2) * v4.Z() + m.GetElem(3, 2) * v4.W(),
                  m.GetElem(0, 3) * v4.X() + m.GetElem(1, 3) * v4.Y() + m.GetElem(2, 3) * v4.Z() + m.GetElem(3, 3) * v4.W());

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

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("float Matrix44Inverse3x3(const Matrix44 &src, Matrix44&)");

        Matrix44 a, r, ref;
        Vector4 va, vb;

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

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

        va.Set(1.0f, 0.0f, 0.0f, 0.0f);

        float_test_type determinant= Matrix44Inverse3x3(a, r);

        vb = Mult3x3(Mult3x3(va,  a), r);

        Validate( IsSimilar(r, ref) && IsSimilar(va, vb) && IsSimilar(determinant, Determinant(a)) );

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Matrix44InverseRotTrans(const Matrix44 &src, Matrix44 &result)");

        Matrix44 a, r, ref;
        Vector4 va, vb;

        a.Set(
             0, 1, 0, 0,
            -1, 0, 0, 0,
             0, 0, 1, 0,
             0, 0, 4, 1
             );

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

        va.Set(0.507092552837f, 0.845154254729f, 0.169030850946f, 1.0f);

        Matrix44InverseRotTrans(a, r);

        vb = Mult3x3(Mult3x3(va,  a), r);

        Validate(IsSimilar(r, ref) && IsSimilar(va, vb));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

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

        Matrix44 m, r, ref;
        m.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        Negate(m, r);

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

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

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

        Matrix44 m, r, ref;
        m.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        float_test_type s = 2.0f;
        Mult(m, s, r);

        for (int i = 0; i < 16; i++)
        {
            ref.SetElem(i, m.GetElem(i) * s);
        }

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

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

        Matrix44 m, r, ref;
        m.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        float_test_type s = 2.0f;
        Divide(m, s, r);

        for (int i = 0; i < 16; i++)
        {
            ref.SetElem(i, m.GetElem(i) / s);
        }

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

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

        Matrix44 a, b, r, ref;
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        b.Set(4.0f, 3.0f, 4.0f, 1.0f, 6.0f, 7.0f, 8.0f, 1.0f, 10.0f, 11.0f, 12.0f, 1.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        Add(a, b, r);

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

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

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

        Matrix44 a, b, r, ref;
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        b.Set(4.0f, 3.0f, 4.0f, 1.0f, 6.0f, 7.0f, 8.0f, 1.0f, 10.0f, 11.0f, 12.0f, 1.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        Subtract(a, b, r);

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

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

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

        Matrix44 a, b, r, ra, ref;

        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        b.Set(4.0f, 3.0f, 4.0f, 1.0f, 6.0f, 7.0f, 8.0f, 1.0f, 10.0f, 11.0f, 12.0f, 1.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        ra.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);


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

        for (int32_t i = 0; i < 4; ++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) + a.GetElem(i, 3) * b.GetElem(3, 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) + a.GetElem(i, 3) * b.GetElem(3, 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.GetElem(i, 3) * b.GetElem(3, 2) );
            ref.SetElem(i, 3, a.GetElem(i, 0) * b.GetElem(0, 3) + a.GetElem(i, 1) * b.GetElem(1, 3) + a.GetElem(i, 2) * b.GetElem(2, 3) + a.GetElem(i, 3) * b.GetElem(3, 3) );
        }

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

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

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

        Matrix44 m, r, ref;

        m.Set(
            1,  2,  3,  4,
            5,  6,  7,  8,
            9, 10, 11, 12,
            13, 14, 15, 16
            );
        ref.Set(
            1,  5,  9, 13,
            2,  6, 10, 14,
            3,  7, 11, 15,
            4,  8, 12, 16
            );

        Transpose(m, r);

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

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

        Matrix44 m, r, ref;

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

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

        Inverse(m, r);

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Matrix44FromEulerXYZ(const Vector3 &euler, Matrix44 &result)");

        Vector3 euler;
        Matrix44 r, ref;

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

        Matrix44FromEulerXYZ(euler, r);

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("EulerXYZFromMatrix44(const Matrix44& m, Vector3 &result)");

        Matrix44 m;
        Vector3 r, ref;

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

        ref.Set(0, 0, HALF_PI);

        EulerXYZFromMatrix44(m, r);

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Matrix44Diagonal(float_t a, Matrix44 &result)");

        Matrix44 r, ref;
        float_test_type s = 3.0f;
        ref.Set(
            s, 0, 0, 0,
            0, s, 0, 0,
            0, 0, s, 0,
            0, 0, 0, s
            );

        Matrix44Diagonal(s,r);

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Matrix44FromQuaternion(const Quaternion &q, Matrix44 &result)");

        Quaternion q;
        Matrix44 r, ref;

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

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

        Matrix44FromQuaternion(q, r);

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Matrix44RotationX(angle, Matrix44 &result)");

        Matrix44 r, ref;
        float_test_type angle = 1.3f;

        Matrix44RotationX( angle, r );

        Matrix44FromAxisAngle(Vector3(1.0f, 0.0f, 0.0f), angle, ref);

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Matrix44RotationY(angle, Matrix44 &result)");

        Matrix44 r, ref;
        float_test_type angle = 1.3f;

        Matrix44RotationY( angle, r );

        Matrix44FromAxisAngle(Vector3(0.0f, 1.0f, 0.0f), angle, ref);

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Matrix44RotationZ(angle, Matrix44 &result)");

        Matrix44 r, ref;
        float_test_type angle = 1.3f;

        Matrix44RotationZ( angle, r );

        Matrix44FromAxisAngle(Vector3(0.0f, 0.0f, 1.0f), angle, ref);

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("RotateAroundXAxis(angle, matrix44)");
        Matrix44 initialMat = Matrix44FromEulerXYZ(Vector3(1.0f, 2.3f, -1.4f));
        Matrix44 r, ref;
        float_test_type angle = 1.3f;

#if defined HOST_TESTING
        ref = Mult( Matrix44FromXRotationAngle( angle ), initialMat );
#else
        ref = Mult( Matrix44FromXRotationAngle<FloatType>( angle ), initialMat );
#endif
        r = RotateAroundXAxis(initialMat, angle);

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("RotateAroundYAxis(angle, matrix44)");
        Matrix44 initialMat = Matrix44FromEulerXYZ(Vector3(1.0f, 2.3f, -1.4f));
        Matrix44 r, ref;
        float_test_type angle = 1.3f;

#if defined HOST_TESTING
        ref = Mult( Matrix44FromYRotationAngle( angle ), initialMat );
#else
        ref = Mult( Matrix44FromYRotationAngle<FloatType>( angle ), initialMat );
#endif
        r = RotateAroundYAxis(initialMat, angle);

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("RotateAroundZAxis(angle, matrix44)");
        Matrix44 initialMat = Matrix44FromEulerXYZ(Vector3(1.0f, 2.3f, -1.4f));
        Matrix44 r, ref;
        float_test_type angle = 1.3f;

#if defined HOST_TESTING
        ref = Mult( Matrix44FromZRotationAngle( angle ), initialMat );
#else
        ref = Mult( Matrix44FromZRotationAngle<FloatType>( angle ), initialMat );
#endif
        r = RotateAroundZAxis(initialMat, angle);

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Matrix44Perspective(w, h, zn, zf,r)");
        // Note: These numbers were generated by running Matrix44Perspective on the input.
        // This test case will only ensure future changes don't modify the results generated.
        Matrix44 ref(
            0.0125f,    0.0f,            0.0f,      0.0f,
            0.0f,   0.0222222f,      0.0f,      0.0f,
            0.0f,   0.0f,         -1.001f,     -1.0f,
            0.0f,   0.0f,        -0.1001f,      0.0f
            );

        Matrix44 r;

        Matrix44Perspective((float_test_type)16.0f, (float_test_type)9.0f, (float_test_type)0.1f, (float_test_type)100.0f, r);

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Matrix44Ortho(w, h, zn, zf, r)");
        // Note: These numbers were generated by running Matrix44Ortho on the input.
        // This test case will only ensure future changes don't modify the results generated.
        Matrix44 ref(
            0.125f, 0.0f,       0.0f,       0.0f,
            0.0f,   0.222222f,  0.0f,       0.0f,
            0.0f,   0.0f,       -0.01001f,  0.0f,
            0.0f,   0.0f,       -0.001001f, 1.0f
            );

        Matrix44 r;

        Matrix44Ortho((float_test_type)16.0f, (float_test_type)9.0f, (float_test_type)0.1f, (float_test_type)100.0f, r);

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Matrix44OrthoOffCenter(l, r, b, t, zn, zf, r)");
        // Note: These numbers were generated by running Matrix44OrthoOffCenter on the input.
        // This test case will only ensure future changes don't modify the results generated.
        Matrix44 ref(
            0.12500000f,  0.00000000f,    0.00000000f,   0.00000000f,
            0.00000000f,  0.22222222f,    0.00000000f,   0.00000000f,
            0.00000000f,  0.00000000f,  -0.010010010f,   0.00000000f,
            0.25000000f, -0.11111111f, -0.0010010010f,    1.0000000f
            );

        Matrix44 r;

        Matrix44OrthoOffCenter((float_test_type)-10.0f, (float_test_type)6.0f, (float_test_type)-4.0f, (float_test_type)5.0f, (float_test_type)0.1f, (float_test_type)100.0f, r);

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Matrix44PerspectiveFov(fov, aspect, zn, zf, r)");
        // Note: These numbers were generated by running Matrix44PerspectiveFov on the input.
        // This test case will only ensure future changes don't modify the results generated.
        Matrix44 ref(
            0.89043140f,      0.00000000f,      0.00000000f,      0.00000000f,
            0.00000000f,       1.1872418f,      0.00000000f,      0.00000000f,
            0.00000000f,      0.00000000f,      -1.0001000f,      -1.0000000f,
            0.00000000f,      0.00000000f,    -0.010001000f,      0.00000000f
            );

        Matrix44 r;

        Matrix44PerspectiveFov((float_test_type)1.4f, (float_test_type)4.0f/(float_test_type)3.0f, (float_test_type)0.01f, (float_test_type)100.0f, r);

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Matrix44LookAt(eye, focal, up, r)");
        // Note: These numbers were generated by running Matrix44LookAt on the input.
        // This test case will only ensure future changes don't modify the results generated.
        Matrix44 ref(
            0.70710677f,     -0.40824825f,      0.57735020f,      0.00000000f,
            0.00000000f,      0.81649649f,      0.57735020f,      0.00000000f,
            -0.70710677f,     -0.40824825f,      0.57735020f,      0.00000000f,
            0.00000000f,      0.00000000f,      -17.320505f,       1.0000000f
            );

        Matrix44 r;

        Vector3 eye(10, 10, 10);
        Vector3 focal(0, 0, 0);
        Vector3 up(0, 1, 0);
        Matrix44LookAt(eye, focal, up, r);

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Matrix44TransposeRotation(m)");
        Matrix44 initialMat = Matrix44FromEulerXYZ(Vector3(1.0f, 2.3f, -1.4f));
        Matrix44 ref = Transpose(initialMat);

        Matrix44TransposeRotation(initialMat);
        Matrix44 r = initialMat;

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Matrix44ScaleRow(r0, r1, r2, m)");
        Matrix44 initialMat(
            1.0f, 1.0f, 1.0f, 1.0f,
            1.0f, 1.0f, 1.0f, 1.0f,
            1.0f, 1.0f, 1.0f, 1.0f,
            1.0f, 1.0f, 1.0f, 1.0f );

        Matrix44 ref(
            2.0f, 2.0f, 2.0f, 1.0f,
            3.0f, 3.0f, 3.0f, 1.0f,
            4.0f, 4.0f, 4.0f, 1.0f,
            1.0f, 1.0f, 1.0f, 1.0f );

        Matrix44ScaleRow((float_test_type)2.0f, (float_test_type)3.0f, (float_test_type)4.0f, initialMat);
        Matrix44 r = initialMat;

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Matrix44ScaleColumn(c0, c1, c2, m)");
        Matrix44 initialMat(
            1.0f, 1.0f, 1.0f, 1.0f,
            1.0f, 1.0f, 1.0f, 1.0f,
            1.0f, 1.0f, 1.0f, 1.0f,
            1.0f, 1.0f, 1.0f, 1.0f );

        Matrix44 ref(
            2.0f, 3.0f, 4.0f, 1.0f,
            2.0f, 3.0f, 4.0f, 1.0f,
            2.0f, 3.0f, 4.0f, 1.0f,
            1.0f, 1.0f, 1.0f, 1.0f );

        Matrix44ScaleColumn((float_test_type)2.0f, (float_test_type)3.0f, (float_test_type)4.0f, initialMat);
        Matrix44 r = initialMat;

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Matrix44FromAxisAngle(const Vector3 &axis, float_t angle, Matrix44 &result)");

        Vector3 axis;
        float_test_type angle;
        Matrix44 r, ref;

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

        Matrix44FromAxisAngle(axis, angle, r);

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if RW_MATH_ENABLE_DEPRECATED_API

        SetFunctionName("Matrix44Translate(trans, m)");
        Matrix44 initialMat = Matrix44FromEulerXYZ(Vector3(1.0f, 2.3f, -1.4f));

        Matrix44 translationMatrix( 1.0f, 0.0f, 0.0f, 0.0f,
                                    0.0f, 1.0f, 0.0f, 0.0f,
                                    0.0f, 0.0f, 1.0f, 0.0f,
                                    1.0f, 2.0f, 5.0f, 1.0f );
        Vector3 &transVec = *reinterpret_cast<Vector3*>(&translationMatrix.GetRow(3));
        Matrix44 ref = Mult( translationMatrix, initialMat );

        Matrix44Translate(transVec, initialMat);

        Validate(IsSimilar(initialMat, ref));

#endif



      ]]>
      </TEST>

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

        SetFunctionName("Get3x3(m)");
        
        Matrix44 m44(.11f, .12f, .13f, .14f, .21f, .22f, .23f, .24f, .31f, .32f, .33f, .34f, .41f, .42f, .43f, .44f);
        Matrix33 upper33(.11f, .12f, .13f, .21f, .22f, .23f, .31f, .32f, .33f);
        
        Matrix33 m33 = Get3x3(m44);
        
        Validate( IsSimilar(m33, upper33) );
        
      ]]>
      </TEST>

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

        SetFunctionName("Set3x3(Matrix44, Matrix33)");
        
        Matrix44 m44(.11f, .12f, .13f, .14f, .21f, .22f, .23f, .24f, .31f, .32f, .33f, .34f, .41f, .42f, .43f, .44f);
        Matrix44 m44_reference(1.1f, 1.2f, 1.3f, .14f, 2.1f, 2.2f, 2.3f, .24f, 3.1f, 3.2f, 3.3f, .34f, .41f, .42f, .43f, .44f);
        Matrix33 new33(1.1f, 1.2f, 1.3f, 2.1f, 2.2f, 2.3f, 3.1f, 3.2f, 3.3f);
        
        Matrix44 m44_new = Set3x3(m44, new33);
        
        Validate( IsSimilar(m44_new, m44_reference) );
        
      ]]>
      </TEST>

    </TYPE>


    <TYPE NAME="performance">

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

        SetFunctionName("Negate(const Matrix44 &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 = Negate(m44_function_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


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

        SetFunctionName("Mult(const Matrix44 &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++)
            {
                matResult = Mult(m44_function_array[i], x_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


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

        SetFunctionName("Divide(const Matrix44 &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++)
            {
                matResult = Divide(m44_function_array[i], x_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


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

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

        Matrix44 a;
        a = m44_function_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++)
            {
                matResult = Add(a, m44_function_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


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

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

        Matrix44 a;
        a = m44_function_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++)
            {
                matResult = Subtract(a, m44_function_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


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

        SetFunctionName("Mult(const Vector4 &v, const Matrix44 &m)");

        Vector4 v4;
        v4.Set(6.0f, -1.0f, -3.0f, 1.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++)
            {
                vec4Result = Mult(v4, m44_function_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


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

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

        Matrix44 a;

        a = m44_function_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++)
            {
                matResult = Mult(a, m44_function_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


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

        SetFunctionName("Transpose(const Matrix44 &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 = Transpose(m44_function_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


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

        SetFunctionName("Determinant(const Matrix44 &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(m44_function_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


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

        SetFunctionName("IsSimilar(const Matrix44 &a, const Matrix44 &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(m44_function_array[i], m44_function_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE - i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


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

        SetFunctionName("Matrix44FromScale(const Vector3 &v)");

        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 = Matrix44FromScale(v3_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


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

        SetFunctionName("Matrix44FromTranslation(const Vector3 &v)");

        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 = Matrix44FromTranslation(v3_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


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

        SetFunctionName("Matrix44FromScaleQuaternion(const Vector3 &scale, 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++)
            {
                matResult = Matrix44FromScaleQuaternion(v3_array[i],q_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


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

        SetFunctionName("Matrix44FromScaleTranslation(const Vector3 &scale, const Vector3 &translation)");

        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 = Matrix44FromScaleTranslation(v3_array[i],v3_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


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

        SetFunctionName("Matrix44FromDiagonal(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++)
            {
#if defined HOST_TESTING
                matResult = Matrix44FromDiagonal(x_array[i]);
#else
                matResult = Matrix44FromDiagonal<FloatType>(x_array[i]);
#endif
            }
        }

        StopTimer();

      ]]>
      </TEST>


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

        SetFunctionName("Matrix44FromQuaternion(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++)
            {
                matResult = Matrix44FromQuaternion(q_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>

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

        SetFunctionName("Matrix44FromQuaternionTranslation(quaternion, translation)");

        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 = Matrix44FromQuaternionTranslation(q_array[i], v3_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>

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

        SetFunctionName("Matrix44FromScaleQuaternionTranslation(scale, quaternion, translation)");

        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 = Matrix44FromScaleQuaternionTranslation(v3_array[i], q_array[i], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>

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

        SetFunctionName("Unrolled (x2) Matrix44FromScaleQuaternionTranslation(scale, quaternion, translation)");

        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+=2)
            {
                // Assign results to temporaries to allow calculations to be performed concurrently.
                Matrix44 temp1 = Matrix44FromScaleQuaternionTranslation(v3_array[i  ], q_array[i  ], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-i  ]);
                Matrix44 temp2 = Matrix44FromScaleQuaternionTranslation(v3_array[i+1], q_array[i+1], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i+1)]);
                matResult1 = temp1;
                matResult2 = temp2;
            }
        }

        StopTimer();

      ]]>
      </TEST>

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

        SetFunctionName("Unrolled (x3) Matrix44FromScaleQuaternionTranslation(scale, quaternion, translation)");

        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+=3)
            {
                // Assign results to temporaries to allow calculations to be performed concurrently.
                Matrix44 temp1 = Matrix44FromScaleQuaternionTranslation(v3_array[i  ], q_array[i  ], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i  )]);
                Matrix44 temp2 = Matrix44FromScaleQuaternionTranslation(v3_array[i+1], q_array[i+1], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i+1)]);
                Matrix44 temp3 = Matrix44FromScaleQuaternionTranslation(v3_array[i+2], q_array[i+2], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i+2)]);
                matResult1 = temp1;
                matResult2 = temp2;
                matResult3 = temp3;
            }
        }

        StopTimer();

      ]]>
      </TEST>

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

        SetFunctionName("Unrolled (x4) Matrix44FromScaleQuaternionTranslation(scale, quaternion, translation)");

        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+=4)
            {
                // Assign results to temporaries to allow calculations to be performed concurrently.
                Matrix44 temp1 = Matrix44FromScaleQuaternionTranslation(v3_array[i  ], q_array[i  ], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i  )]);
                Matrix44 temp2 = Matrix44FromScaleQuaternionTranslation(v3_array[i+1], q_array[i+1], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i+1)]);
                Matrix44 temp3 = Matrix44FromScaleQuaternionTranslation(v3_array[i+2], q_array[i+2], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i+2)]);
                Matrix44 temp4 = Matrix44FromScaleQuaternionTranslation(v3_array[i+3], q_array[i+3], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i+3)]);
                matResult1 = temp1;
                matResult2 = temp2;
                matResult3 = temp3;
                matResult4 = temp4;
            }
        }

        StopTimer();

      ]]>
      </TEST>

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

        SetFunctionName("Unrolled (x5) Matrix44FromScaleQuaternionTranslation(scale, quaternion, translation)");

        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+=5)
            {
                // Assign results to temporaries to allow calculations to be performed concurrently.
                Matrix44 temp1 = Matrix44FromScaleQuaternionTranslation(v3_array[i  ], q_array[i  ], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i  )]);
                Matrix44 temp2 = Matrix44FromScaleQuaternionTranslation(v3_array[i+1], q_array[i+1], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i+1)]);
                Matrix44 temp3 = Matrix44FromScaleQuaternionTranslation(v3_array[i+2], q_array[i+2], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i+2)]);
                Matrix44 temp4 = Matrix44FromScaleQuaternionTranslation(v3_array[i+3], q_array[i+3], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i+3)]);
                Matrix44 temp5 = Matrix44FromScaleQuaternionTranslation(v3_array[i+4], q_array[i+4], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i+4)]);
                matResult1 = temp1;
                matResult2 = temp2;
                matResult3 = temp3;
                matResult4 = temp4;
                matResult5 = temp5;
            }
        }

        StopTimer();

      ]]>
      </TEST>

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

        SetFunctionName("Unrolled (x6) Matrix44FromScaleQuaternionTranslation(scale, quaternion, translation)");

        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+=6)
            {
                // Assign results to temporaries to allow calculations to be performed concurrently.
                Matrix44 temp1 = Matrix44FromScaleQuaternionTranslation(v3_array[i  ], q_array[i  ], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i  )]);
                Matrix44 temp2 = Matrix44FromScaleQuaternionTranslation(v3_array[i+1], q_array[i+1], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i+1)]);
                Matrix44 temp3 = Matrix44FromScaleQuaternionTranslation(v3_array[i+2], q_array[i+2], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i+2)]);
                Matrix44 temp4 = Matrix44FromScaleQuaternionTranslation(v3_array[i+3], q_array[i+3], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i+3)]);
                Matrix44 temp5 = Matrix44FromScaleQuaternionTranslation(v3_array[i+4], q_array[i+4], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i+4)]);
                Matrix44 temp6 = Matrix44FromScaleQuaternionTranslation(v3_array[i+5], q_array[i+5], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i+5)]);
                matResult1 = temp1;
                matResult2 = temp2;
                matResult3 = temp3;
                matResult4 = temp4;
                matResult5 = temp5;
                matResult6 = temp6;
            }
        }

        StopTimer();

      ]]>
      </TEST>

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

        SetFunctionName("Unrolled (x7) Matrix44FromScaleQuaternionTranslation(scale, quaternion, translation)");

        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+=7)
            {
                // Assign results to temporaries to allow calculations to be performed concurrently.
                Matrix44 temp1 = Matrix44FromScaleQuaternionTranslation(v3_array[i  ], q_array[i  ], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i  )]);
                Matrix44 temp2 = Matrix44FromScaleQuaternionTranslation(v3_array[i+1], q_array[i+1], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i+1)]);
                Matrix44 temp3 = Matrix44FromScaleQuaternionTranslation(v3_array[i+2], q_array[i+2], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i+2)]);
                Matrix44 temp4 = Matrix44FromScaleQuaternionTranslation(v3_array[i+3], q_array[i+3], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i+3)]);
                Matrix44 temp5 = Matrix44FromScaleQuaternionTranslation(v3_array[i+4], q_array[i+4], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i+4)]);
                Matrix44 temp6 = Matrix44FromScaleQuaternionTranslation(v3_array[i+5], q_array[i+5], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i+5)]);
                Matrix44 temp7 = Matrix44FromScaleQuaternionTranslation(v3_array[i+6], q_array[i+6], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i+6)]);
                matResult1 = temp1;
                matResult2 = temp2;
                matResult3 = temp3;
                matResult4 = temp4;
                matResult5 = temp5;
                matResult6 = temp6;
                matResult7 = temp7;
            }
        }

        StopTimer();

      ]]>
      </TEST>

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

        SetFunctionName("Unrolled (x8) Matrix44FromScaleQuaternionTranslation(scale, quaternion, translation)");

        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+=8)
            {
                // Assign results to temporaries to allow calculations to be performed concurrently.
                Matrix44 temp1 = Matrix44FromScaleQuaternionTranslation(v3_array[i  ], q_array[i  ], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i  )]);
                Matrix44 temp2 = Matrix44FromScaleQuaternionTranslation(v3_array[i+1], q_array[i+1], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i+1)]);
                Matrix44 temp3 = Matrix44FromScaleQuaternionTranslation(v3_array[i+2], q_array[i+2], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i+2)]);
                Matrix44 temp4 = Matrix44FromScaleQuaternionTranslation(v3_array[i+3], q_array[i+3], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i+3)]);
                Matrix44 temp5 = Matrix44FromScaleQuaternionTranslation(v3_array[i+4], q_array[i+4], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i+4)]);
                Matrix44 temp6 = Matrix44FromScaleQuaternionTranslation(v3_array[i+5], q_array[i+5], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i+5)]);
                Matrix44 temp7 = Matrix44FromScaleQuaternionTranslation(v3_array[i+6], q_array[i+6], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i+6)]);
                Matrix44 temp8 = Matrix44FromScaleQuaternionTranslation(v3_array[i+7], q_array[i+7], v3_array[testing::RW_MATH_UNITTEST_TEST_MATRIX_ARRAY_SIZE-(i+7)]);
                matResult1 = temp1;
                matResult2 = temp2;
                matResult3 = temp3;
                matResult4 = temp4;
                matResult5 = temp5;
                matResult6 = temp6;
                matResult7 = temp7;
                matResult8 = temp8;
            }
        }

        StopTimer();

      ]]>
      </TEST>

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

        SetFunctionName("Matrix44FromAxisAngle(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++)
            {
                matResult = Matrix44FromAxisRotationAngle(v3_array[i], (float_test_type)2.0f);
            }
        }

        StopTimer();

      ]]>
      </TEST>


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

        SetFunctionName("Matrix44FromEulerXYZ(const Vector4 &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++)
            {
                matResult = Matrix44FromEulerXYZ(v3_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


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

        SetFunctionName("EulerXYZFromMatrix44(const Matrix44& 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++)
            {
                vec3Result = EulerXYZFromMatrix44(m44_function_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


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

        SetFunctionName("Matrix44FromXRotationAngle(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
                matResult = Matrix44FromXRotationAngle( 1.3f );
#else
                matResult = Matrix44FromXRotationAngle<FloatType>( 1.3f );
#endif
            }
        }

        StopTimer();

      ]]>
      </TEST>


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

        SetFunctionName("Matrix44FromYRotationAngle(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
                matResult = Matrix44FromYRotationAngle( 1.3f );
#else
                matResult = Matrix44FromYRotationAngle<FloatType>( 1.3f );
#endif
            }
        }

        StopTimer();

      ]]>
      </TEST>


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

        SetFunctionName("Matrix44FromZRotationAngle(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
                matResult = Matrix44FromZRotationAngle( 1.3f );
#else
                matResult = Matrix44FromZRotationAngle<FloatType>( 1.3f );
#endif
            }
        }

        StopTimer();

      ]]>
      </TEST>


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

        SetFunctionName("Inverse(const Matrix44 &m, float& determinant)");

        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 = Inverse(m44_function_array[i], retValueFloat);
            }
        }

        StopTimer();

      ]]>
      </TEST>


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

        SetFunctionName("Matrix44InverseRotationalComponent(Matrix44)");

        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 = Matrix44InverseRotationalComponent(m44_function_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>

    </TYPE>

  </TYPE>

  <TYPE NAME="operator">

    <TYPE NAME="correctness">

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


#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("Matrix44& operator = (const Matrix44 &m)");

        Matrix44 m, ref;
        ref.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f);

        m = ref;


        Validate(IsSimilar(m, ref));

#endif


      ]]>
      </TEST>
      
      <TEST NAME="test205">
      <![CDATA[


#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 m, ref;
        float_test_type s = 2.0f;
        m.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f);

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

        m *= s;


        Validate(IsSimilar(m, ref));

#endif


      ]]>
      </TEST>


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


#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 m, ref;
        float_test_type s = 2.0f;
        m.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f);

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

        m /= s;

        Validate(IsSimilar(m, ref));

#endif


      ]]>
      </TEST>


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


#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 a, r, ref;
        float_test_type s = 2.0f;
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);

        for (int i = 0; i < 16; i++)
        {
            ref.GetElem(i) = a.GetElem(i) * s;
        }

        r = a * s;

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 a, r, ref;
        float_test_type s = 2.0f;
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);

        for (int i = 0; i < 16; i++)
        {
            ref.GetElem(i) = a.GetElem(i) * s;
        }

        r = s * a;

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 a, r, ref;
        float_test_type s = 2.0f;
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);

        for (int i = 0; i < 16; i++)
        {
            ref.GetElem(i) = a.GetElem(i) / s;
        }

        r = a / s;

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 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, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f);

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

        m *= s;


        Validate(IsSimilar(m, ref));

#endif


      ]]>
      </TEST>


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


#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 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, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f);

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

        m /= s;

        Validate(IsSimilar(m, ref));

#endif


      ]]>
      </TEST>


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


#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 a, r, ref;
        float_basic_type s = 2.0f;
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);

        for (int i = 0; i < 16; i++)
        {
            ref.GetElem(i) = a.GetElem(i) * s;
        }

        r = a * s;

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 a, r, ref;
        float_basic_type s = 2.0f;
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);

        for (int i = 0; i < 16; i++)
        {
            ref.GetElem(i) = a.GetElem(i) * s;
        }

        r = s * a;

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 a, r, ref;
        float_basic_type s = 2.0f;
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);

        for (int i = 0; i < 16; i++)
        {
            ref.GetElem(i) = a.GetElem(i) / s;
        }

        r = a / s;

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 m, ref;
        float_test_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, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f);

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

        m *= svec.X();


        Validate(IsSimilar(m, ref));

#endif


      ]]>
      </TEST>


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


#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 m, ref;
        float_test_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, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f);

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

        m /= svec.X();

        Validate(IsSimilar(m, ref));

#endif


      ]]>
      </TEST>


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


#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 a, r, ref;
        float_test_type s = 2.0f;
        Vector3 svec(s, s, s);
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);

        for (int i = 0; i < 16; i++)
        {
            ref.GetElem(i) = a.GetElem(i) * s;
        }

        r = a * svec.X();

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 a, r, ref;
        float_test_type s = 2.0f;
        Vector3 svec(s, s, s);
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);

        for (int i = 0; i < 16; i++)
        {
            ref.GetElem(i) = a.GetElem(i) * s;
        }

        r = svec.X() * a;

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 a, r, ref;
        float_test_type s = 2.0f;
        Vector3 svec(s, s, s);
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);

        for (int i = 0; i < 16; i++)
        {
            ref.GetElem(i) = a.GetElem(i) / s;
        }

        r = a / svec.X();

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 m, ref;
        float_test_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, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f);

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

        m *= svec.GetComponent(0);


        Validate(IsSimilar(m, ref));

#endif


      ]]>
      </TEST>


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


#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 m, ref;
        float_test_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, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f);

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

        m /= svec.GetComponent(0);

        Validate(IsSimilar(m, ref));

#endif


      ]]>
      </TEST>


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


#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 a, r, ref;
        float_test_type s = 2.0f;
        Vector3 svec(s, s, s);
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);

        for (int i = 0; i < 16; i++)
        {
            ref.GetElem(i) = a.GetElem(i) * s;
        }

        r = a * svec.GetComponent(0);

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 a, r, ref;
        float_test_type s = 2.0f;
        Vector3 svec(s, s, s);
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);

        for (int i = 0; i < 16; i++)
        {
            ref.GetElem(i) = a.GetElem(i) * s;
        }

        r = svec.GetComponent(0) * a;

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 a, r, ref;
        float_test_type s = 2.0f;
        Vector3 svec(s, s, s);
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);

        for (int i = 0; i < 16; i++)
        {
            ref.GetElem(i) = a.GetElem(i) / s;
        }

        r = a / svec.GetComponent(0);

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator * (const Vector4 &v, const Matrix44 &m)");

        Matrix44 m;
        Vector4 v4, r;
        m.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        v4.Set(2.0f, 3.0f, 4.0f, 1.0f);

        Vector4 ref(
                  m.GetElem(0, 0) * v4.X() + m.GetElem(1, 0) * v4.Y() + m.GetElem(2, 0) * v4.Z() + m.GetElem(3, 0) * v4.W(),
                  m.GetElem(0, 1) * v4.X() + m.GetElem(1, 1) * v4.Y() + m.GetElem(2, 1) * v4.Z() + m.GetElem(3, 1) * v4.W(),
                  m.GetElem(0, 2) * v4.X() + m.GetElem(1, 2) * v4.Y() + m.GetElem(2, 2) * v4.Z() + m.GetElem(3, 2) * v4.W(),
                  m.GetElem(0, 3) * v4.X() + m.GetElem(1, 3) * v4.Y() + m.GetElem(2, 3) * v4.Z() + m.GetElem(3, 3) * v4.W());

        r = v4 * m;

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 a, b, ref;
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        b.Set(4.0f, 3.0f, 4.0f, 1.0f, 6.0f, 7.0f, 8.0f, 1.0f, 10.0f, 11.0f, 12.0f, 1.0f, 14.0f, 15.0f, 16.0f, 17.0f);

        for (int32_t i = 0; i < 4; ++i)
        {
            float_test_type foo = a.GetElem(i, 0) * b.GetElem(0, 0) + a.GetElem(i, 1) * b.GetElem(1, 0) + a.GetElem(i, 2) * b.GetElem(2, 0) + a.GetElem(i, 3) * b.GetElem(3, 0);
            ref.GetElem(i, 0) = foo;
            ref.GetElem(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) + a.GetElem(i, 3) * b.GetElem(3, 0);
            ref.GetElem(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) + a.GetElem(i, 3) * b.GetElem(3, 1);
            ref.GetElem(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.GetElem(i, 3) * b.GetElem(3, 2);
            ref.GetElem(i, 3) = a.GetElem(i, 0) * b.GetElem(0, 3) + a.GetElem(i, 1) * b.GetElem(1, 3) + a.GetElem(i, 2) * b.GetElem(2, 3) + a.GetElem(i, 3) * b.GetElem(3, 3);
        }

        a *= b;

        Validate(IsSimilar(a, ref));

#endif


      ]]>
      </TEST>


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


#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 a, b, ref;
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        b.Set(4.0f, 3.0f, 4.0f, 1.0f, 6.0f, 7.0f, 8.0f, 1.0f, 10.0f, 11.0f, 12.0f, 1.0f, 14.0f, 15.0f, 16.0f, 17.0f);

        for (int i = 0; i < 16; i++)
        {
            ref.GetElem(i) = a.GetElem(i) + b.GetElem(i);
        }

        a += b;

        Validate(IsSimilar(a, ref));

#endif


      ]]>
      </TEST>


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


#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 a, b, ref;
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        b.Set(4.0f, 3.0f, 4.0f, 1.0f, 6.0f, 7.0f, 8.0f, 1.0f, 10.0f, 11.0f, 12.0f, 1.0f, 14.0f, 15.0f, 16.0f, 17.0f);

        for (int i = 0; i < 16; i++)
        {
            ref.GetElem(i) = a.GetElem(i) - b.GetElem(i);
        }

        a -= b;

        Validate(IsSimilar(a, ref));

#endif


      ]]>
      </TEST>


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


#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 a, r, ref;
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);

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

        r = -a;

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 a, b, r, ref;
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        b.Set(4.0f, 3.0f, 4.0f, 1.0f, 6.0f, 7.0f, 8.0f, 1.0f, 10.0f, 11.0f, 12.0f, 1.0f, 14.0f, 15.0f, 16.0f, 17.0f);

        for (int i = 0; i < 16; i++)
        {
            ref.GetElem(i) = a.GetElem(i) + b.GetElem(i);
        }

        r = a + b;

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 a, b, r, ref;
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        b.Set(4.0f, 3.0f, 4.0f, 1.0f, 6.0f, 7.0f, 8.0f, 1.0f, 10.0f, 11.0f, 12.0f, 1.0f, 14.0f, 15.0f, 16.0f, 17.0f);

        for (int i = 0; i < 16; i++)
        {
            ref.GetElem(i) = a.GetElem(i) - b.GetElem(i);
        }

        r = a - b;

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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


#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 a, b, r, ref;
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);
        b.Set(4.0f, 3.0f, 4.0f, 1.0f, 6.0f, 7.0f, 8.0f, 1.0f, 10.0f, 11.0f, 12.0f, 1.0f, 14.0f, 15.0f, 16.0f, 17.0f);

        for (int32_t i = 0; i < 4; ++i)
        {
            ref.GetElem(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) + a.GetElem(i, 3) * b.GetElem(3, 0);
            ref.GetElem(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) + a.GetElem(i, 3) * b.GetElem(3, 1);
            ref.GetElem(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.GetElem(i, 3) * b.GetElem(3, 2);
            ref.GetElem(i, 3) = a.GetElem(i, 0) * b.GetElem(0, 3) + a.GetElem(i, 1) * b.GetElem(1, 3) + a.GetElem(i, 2) * b.GetElem(2, 3) + a.GetElem(i, 3) * b.GetElem(3, 3);
        }

        r = a * b;

        Validate(IsSimilar(r, ref));

#endif


      ]]>
      </TEST>


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



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

        Matrix44 a, b, c;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f);
        b.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f);
        c.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);

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



      ]]>
      </TEST>


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



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

        Matrix44 a, b, c;
        a.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f);
        b.Set(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f);
        c.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f);

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



      ]]>
      </TEST>

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


#ifdef HOST_TESTING

        SetFunctionName("SetElem(int, VecFloatRef<INDEX>)");

        Matrix44 a, ref;
        a.Set(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f);
        ref.Set(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 50.0f, 6.0f, 7.0f, 8.0f, 90.0f, 10.0f, 11.0f, 120.0f, 13.0f, 14.0f, 15.0f);

        Vector4 valuesVector( 120.0f, 50.0f, 90.0f, 0.0f );
        a.SetElem( 12, valuesVector.X() );
        a.SetElem( 5, valuesVector.Y() );
        a.SetElem( 9, valuesVector.Z() );

        Validate(a == ref);

#endif

      ]]>
      </TEST>

    </TYPE>


    <TYPE NAME="performance">

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

        SetFunctionName("Matrix44& operator = (const Matrix44 &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++)
            {
                matResult = m44_operator_array[i];
            }
        }

        StopTimer();

      ]]>
      </TEST>
      
      <TEST NAME="test230">
      <![CDATA[

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

        Matrix44 a;
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.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 == m44_operator_array[i];
            }
        }

        StopTimer();

      ]]>
      </TEST>


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

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

        Matrix44 a;
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.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 != m44_operator_array[i];
            }
        }

        StopTimer();

      ]]>
      </TEST>


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

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator *= (Matrix44 &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++)
            {
                m44_operator_array[i] *= s;
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


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

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator /= (Matrix44 &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++)
            {
                m44_operator_array[i] /= s;
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


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

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator /= (Matrix44 &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++)
            {
                m44_operator_array[i] /= s;
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


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

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 a;
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.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++)
            {
                m44_operator_array[i] *= a;
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


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

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 a;
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.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++)
            {
                m44_operator_array[i] += a;
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


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

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 a;
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.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++)
            {
                m44_operator_array[i] -= a;
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


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

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 r;

        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 = -m44_operator_array[i];
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


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

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator * (const Matrix44 &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 = m44_operator_array[i] * s;
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


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

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator / (const Matrix44 &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 = m44_operator_array[i] / s;
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


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

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 a;
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.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 = m44_operator_array[i] + a;
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


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

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 a;
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.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 = m44_operator_array[i] - a;
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


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

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

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

        Matrix44 a;
        a.Set(2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.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 = m44_operator_array[i] * a;
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


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

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("operator * (const Vector4 &v, const Matrix44 &m)");

        Vector4 v4;
        v4.Set(1.2f, 2.1f, 5.3f, 1.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++)
            {
                vec4Result = v4 * m44_operator_array[i];
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>

    </TYPE>


  </TYPE>

</CLASS>

</TESTCLASS>
