Package org.drip.numerical.common
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.
- Module = Computational Core Module
- Library = Numerical Analysis Library
- Project = Numerical Quadrature, Differentiation, Eigenization, Linear Algebra, and Utilities
- Package = Primitives/Array Manipulate Format Display Utilities
- Author:
- Lakshmi Krishnamurthy
-
Method Summary
Modifier and Type Method Description static Array2D
BulletSchedule()
Create an Array2D Instance from the Flat Unit Ystatic Array2D
FromArray(double[] adblX, double[] adblY)
Create the Array2D Instance from a Matched Array of X and Ystatic Array2D
FromArray(int[] aiX, double[] adblY)
Create the Array2D Instance from a Matched Array of X and Ystatic 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 Pairstatic 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 Pairstatic Array2D
FromStringSet(java.lang.String strX, java.lang.String strY)
Create the Array2D Instance from a Matched String Array of X and Ystatic Array2D
FromXYDeltaArray(double[] adblX, double[] adblYDelta, double dblYInitial)
Create the Array2D Instance from a Matched Array of X and Y Deltasint
index(double dblX)
Retrieve the Index that corresponds to the given Xboolean
match(Array2D a2DOther)
Indicate if this Array2D Instance matches the "other" Entry-by-Entrydouble[]
x()
Retrieve the Array of Xdouble[]
y()
Retrieve the Array of Ydouble
y(double dblX)
Retrieve the Y given Xdouble
y(double dblStartX, double dblEndX)
Retrieve the X-Weighted YMethods 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 VertexesiMaturityDate
- The Maturity DatedblInitialAmount
- 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 PairiMaturityDate
- The Maturity DatedblInitialAmount
- 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 PairiMaturityDate
- The Maturity Date- Returns:
- The Array2D Instance
-
FromStringSet
Create the Array2D Instance from a Matched String Array of X and Y- Parameters:
strX
- String Array of XstrY
- String Array of Y- Returns:
- The Array2D Instance
-
FromArray
Create the Array2D Instance from a Matched Array of X and Y- Parameters:
adblX
- Array of XadblY
- Array of Y- Returns:
- The Array2D Instance
-
FromArray
Create the Array2D Instance from a Matched Array of X and Y- Parameters:
aiX
- Array of XadblY
- 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 XadblYDelta
- Array of Y DeltasdblYInitial
- The Initial Value of Y- Returns:
- The Array2D Instance
-
BulletSchedule
Create an Array2D Instance from the Flat Unit Y- Returns:
- The Array2D Instance
-
y
public double y(double dblX) throws java.lang.ExceptionRetrieve 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.ExceptionRetrieve 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.ExceptionRetrieve the X-Weighted Y- Parameters:
dblStartX
- Start XdblEndX
- 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
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
-