/// <summary> /// Interpolate. /// </summary> /// <param name="xValues"> the values </param> /// <param name="yValuesMatrix"> the matrix </param> /// <param name="x"> the s </param> /// <returns> Values of the underlying cubic spline functions interpolating {yValuesMatrix.RowVectors} at the values of x </returns> //JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: public com.opengamma.strata.collect.array.DoubleMatrix interpolate(final double[] xValues, final double[][] yValuesMatrix, final double[] x) public virtual DoubleMatrix interpolate(double[] xValues, double[][] yValuesMatrix, double[] x) { ArgChecker.notNull(x, "x"); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final com.opengamma.strata.collect.array.DoubleMatrix matrix = com.opengamma.strata.collect.array.DoubleMatrix.copyOf(yValuesMatrix); DoubleMatrix matrix = DoubleMatrix.copyOf(yValuesMatrix); return(DoubleMatrix.ofArrayObjects(yValuesMatrix.Length, x.Length, i => interpolate(xValues, matrix.rowArray(i), x))); }
/// <summary> /// Interpolate. /// </summary> /// <param name="xValues"> the values </param> /// <param name="yValues"> the values </param> /// <param name="xMatrix"> the matrix </param> /// <returns> Values of the underlying cubic spline function at the values of x </returns> //JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: public com.opengamma.strata.collect.array.DoubleMatrix interpolate(final double[] xValues, final double[] yValues, final double[][] xMatrix) public virtual DoubleMatrix interpolate(double[] xValues, double[] yValues, double[][] xMatrix) { ArgChecker.notNull(xMatrix, "xMatrix"); DoubleMatrix matrix = DoubleMatrix.copyOf(xMatrix); return(DoubleMatrix.ofArrayObjects(xMatrix.Length, xMatrix[0].Length, i => interpolate(xValues, yValues, matrix.rowArray(i)))); }
/// <summary> /// Interpolate. /// </summary> /// <param name="xValues"> the values </param> /// <param name="yValuesMatrix"> the matrix </param> /// <param name="x"> the x </param> /// <returns> Values of the underlying cubic spline functions interpolating {yValuesMatrix.RowVectors} at the value of x </returns> //JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: public com.opengamma.strata.collect.array.DoubleArray interpolate(final double[] xValues, final double[][] yValuesMatrix, final double x) public virtual DoubleArray interpolate(double[] xValues, double[][] yValuesMatrix, double x) { DoubleMatrix matrix = DoubleMatrix.copyOf(yValuesMatrix); return(DoubleArray.of(matrix.rowCount(), i => interpolate(xValues, matrix.rowArray(i), x))); }
/// <summary> /// Tests solve AX = B from A and B. /// </summary> public virtual void solveMatrix() { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final CholeskyDecompositionResult result = CDOG.apply(A5); CholeskyDecompositionResult result = CDOG.apply(A5); double[][] b = new double[][] { new double[] { 1.0, 2.0 }, new double[] { 2.0, 3.0 }, new double[] { 3.0, 4.0 }, new double[] { 4.0, -2.0 }, new double[] { -1.0, -1.0 } }; DoubleMatrix x = result.solve(DoubleMatrix.copyOf(b)); DoubleMatrix ax = (DoubleMatrix)ALGEBRA.multiply(A5, x); ArrayAsserts.assertArrayEquals("Cholesky decomposition OpenGamma - solve", b[0], ax.rowArray(0), 1.0E-10); ArrayAsserts.assertArrayEquals("Cholesky decomposition OpenGamma - solve", b[1], ax.rowArray(1), 1.0E-10); }