예제 #1
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: private void assertMatrixEquals(final com.opengamma.strata.collect.array.Matrix m1, final com.opengamma.strata.collect.array.Matrix m2)
        private void assertMatrixEquals(Matrix m1, Matrix m2)
        {
            if (m1 is DoubleArray)
            {
                assertTrue(m2 is DoubleArray);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final com.opengamma.strata.collect.array.DoubleArray m3 = (com.opengamma.strata.collect.array.DoubleArray) m1;
                DoubleArray m3 = (DoubleArray)m1;
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final com.opengamma.strata.collect.array.DoubleArray m4 = (com.opengamma.strata.collect.array.DoubleArray) m2;
                DoubleArray m4 = (DoubleArray)m2;
                assertEquals(m3.size(), m4.size());
                for (int i = 0; i < m3.size(); i++)
                {
                    assertEquals(m3.get(i), m4.get(i), EPS);
                }
                return;
            }
            if (m2 is DoubleMatrix)
            {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final com.opengamma.strata.collect.array.DoubleMatrix m3 = (com.opengamma.strata.collect.array.DoubleMatrix) m1;
                DoubleMatrix m3 = (DoubleMatrix)m1;
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final com.opengamma.strata.collect.array.DoubleMatrix m4 = (com.opengamma.strata.collect.array.DoubleMatrix) m2;
                DoubleMatrix m4 = (DoubleMatrix)m2;
                assertEquals(m3.size(), m4.size());
                assertEquals(m3.rowCount(), m4.rowCount());
                assertEquals(m3.columnCount(), m4.columnCount());
                for (int i = 0; i < m3.rowCount(); i++)
                {
                    for (int j = 0; j < m3.columnCount(); j++)
                    {
                        assertEquals(m3.get(i, j), m4.get(i, j), EPS);
                    }
                }
            }
        }