Class Array2D

java.lang.Object
org.drip.numerical.common.Array2D

public class Array2D
extends java.lang.Object
Array2D the contains array of x and y. It provides methods to create/access different varieties of x/y schedule creation.



Author:
Lakshmi Krishnamurthy
  • Method Summary

    Modifier and Type Method Description
    static Array2D BulletSchedule()
    Create an Array2D Instance from the Flat Unit Y
    static Array2D FromArray​(double[] adblX, double[] adblY)
    Create the Array2D Instance from a Matched Array of X and Y
    static Array2D FromArray​(int[] aiX, double[] adblY)
    Create the Array2D Instance from a Matched Array of X and Y
    static Array2D FromDateAmountVertex​(java.lang.String strDateAmountVertex, int iMaturityDate, double dblInitialAmount)
    Generate the Array2D Schedule from the String Representation of the Vertex Dates and Edge Payments Combination.
    static Array2D FromDateFactorVertex​(java.lang.String strDateFactorVertex, int iMaturityDate)
    Generate an Array2D Instance from the String Array containing semi-colon delimited Date/Factor Vertex Pair
    static Array2D FromDateFactorVertex​(java.lang.String strDateFactorVertex, int iMaturityDate, double dblInitialAmount)
    Generate an Array2D Instance from the String Array containing semi-colon delimited Date/Factor Vertex Pair
    static Array2D FromStringSet​(java.lang.String strX, java.lang.String strY)
    Create the Array2D Instance from a Matched String Array of X and Y
    static Array2D FromXYDeltaArray​(double[] adblX, double[] adblYDelta, double dblYInitial)
    Create the Array2D Instance from a Matched Array of X and Y Deltas
    int index​(double dblX)
    Retrieve the Index that corresponds to the given X
    boolean match​(Array2D a2DOther)
    Indicate if this Array2D Instance matches the "other" Entry-by-Entry
    double[] x()
    Retrieve the Array of X
    double[] y()
    Retrieve the Array of Y
    double y​(double dblX)
    Retrieve the Y given X
    double y​(double dblStartX, double dblEndX)
    Retrieve the X-Weighted Y

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • FromDateAmountVertex

      public static final Array2D FromDateAmountVertex​(java.lang.String strDateAmountVertex, int iMaturityDate, double dblInitialAmount)
      Generate the Array2D Schedule from the String Representation of the Vertex Dates and Edge Payments Combination.
      Parameters:
      strDateAmountVertex - The String Array consisting of the Date and the Amount Vertexes
      iMaturityDate - The Maturity Date
      dblInitialAmount - The Initial Amount
      Returns:
      The Array2D Instance
    • FromDateFactorVertex

      public static final Array2D FromDateFactorVertex​(java.lang.String strDateFactorVertex, int iMaturityDate, double dblInitialAmount)
      Generate an Array2D Instance from the String Array containing semi-colon delimited Date/Factor Vertex Pair
      Parameters:
      strDateFactorVertex - The String Array containing semi-colon delimited Date/Edge Pair
      iMaturityDate - The Maturity Date
      dblInitialAmount - The Initial Amount
      Returns:
      The Array2D Instance
    • FromDateFactorVertex

      public static final Array2D FromDateFactorVertex​(java.lang.String strDateFactorVertex, int iMaturityDate)
      Generate an Array2D Instance from the String Array containing semi-colon delimited Date/Factor Vertex Pair
      Parameters:
      strDateFactorVertex - The String Array containing semi-colon delimited Date/Edge Pair
      iMaturityDate - The Maturity Date
      Returns:
      The Array2D Instance
    • FromStringSet

      public static final Array2D FromStringSet​(java.lang.String strX, java.lang.String strY)
      Create the Array2D Instance from a Matched String Array of X and Y
      Parameters:
      strX - String Array of X
      strY - String Array of Y
      Returns:
      The Array2D Instance
    • FromArray

      public static final Array2D FromArray​(double[] adblX, double[] adblY)
      Create the Array2D Instance from a Matched Array of X and Y
      Parameters:
      adblX - Array of X
      adblY - Array of Y
      Returns:
      The Array2D Instance
    • FromArray

      public static final Array2D FromArray​(int[] aiX, double[] adblY)
      Create the Array2D Instance from a Matched Array of X and Y
      Parameters:
      aiX - Array of X
      adblY - Array of Y
      Returns:
      The Array2D Instance
    • FromXYDeltaArray

      public static final Array2D FromXYDeltaArray​(double[] adblX, double[] adblYDelta, double dblYInitial)
      Create the Array2D Instance from a Matched Array of X and Y Deltas
      Parameters:
      adblX - Array of X
      adblYDelta - Array of Y Deltas
      dblYInitial - The Initial Value of Y
      Returns:
      The Array2D Instance
    • BulletSchedule

      public static final Array2D BulletSchedule()
      Create an Array2D Instance from the Flat Unit Y
      Returns:
      The Array2D Instance
    • y

      public double y​(double dblX) throws java.lang.Exception
      Retrieve the Y given X
      Parameters:
      dblX - X
      Returns:
      Y
      Throws:
      java.lang.Exception - Thrown if the Y cannot be computed
    • index

      public int index​(double dblX) throws java.lang.Exception
      Retrieve the Index that corresponds to the given X
      Parameters:
      dblX - X
      Returns:
      Index
      Throws:
      java.lang.Exception - Thrown if the Index cannot be computed
    • y

      public double y​(double dblStartX, double dblEndX) throws java.lang.Exception
      Retrieve the X-Weighted Y
      Parameters:
      dblStartX - Start X
      dblEndX - End X
      Returns:
      The X-Weighted Y
      Throws:
      java.lang.Exception - Thrown if the Y cannot be computed
    • x

      public double[] x()
      Retrieve the Array of X
      Returns:
      Array of X
    • y

      public double[] y()
      Retrieve the Array of Y
      Returns:
      Array of Y
    • match

      public boolean match​(Array2D a2DOther)
      Indicate if this Array2D Instance matches the "other" Entry-by-Entry
      Parameters:
      a2DOther - The "Other" Array2D Instance
      Returns:
      TRUE - The Array2D Instances match Entry-by-Entry