Class CommonsMathWrapper


  • public final class CommonsMathWrapper
    extends Object
    Utility class for converting OpenGamma mathematical objects into Commons objects and vice versa.
    • Method Detail

      • wrapUnivariate

        public static org.apache.commons.math3.analysis.UnivariateFunction wrapUnivariate​(Function<Double,​Double> f)
        Wraps a function.
        Parameters:
        f - an OG 1-D function mapping doubles onto doubles
        Returns:
        a Commons univariate real function
      • wrap

        public static org.apache.commons.math3.linear.RealMatrix wrap​(DoubleMatrix x)
        Wraps a matrix.
        Parameters:
        x - an OG 2-D matrix of doubles
        Returns:
        a Commons matrix
      • wrapAsMatrix

        public static org.apache.commons.math3.linear.RealMatrix wrapAsMatrix​(DoubleArray x)
        Wraps a matrix.
        Parameters:
        x - an OG 1-D vector of doubles
        Returns:
        a Commons matrix
      • unwrap

        public static DoubleMatrix unwrap​(org.apache.commons.math3.linear.RealMatrix x)
        Unwraps a matrix.
        Parameters:
        x - a Commons matrix
        Returns:
        an OG 2-D matrix of doubles
      • wrap

        public static org.apache.commons.math3.linear.RealVector wrap​(DoubleArray x)
        Wraps a vector.
        Parameters:
        x - an OG vector of doubles
        Returns:
        a Commons vector
      • unwrap

        public static DoubleArray unwrap​(org.apache.commons.math3.linear.RealVector x)
        Unwraps a vector.
        Parameters:
        x - a Commons vector
        Returns:
        an OG 1-D matrix of doubles