IData
, java.io.Serializable
public class DataDoubleBDArray extends java.lang.Object implements IData, java.io.Serializable
All arithmetic methods throw ClassCastException if given a Data instance that is not a DataDoubleDBArray, and throw an IllegalArgumentException if the given DataDoubleDBArray is not of the same length as this one (array shape is not considered for arithmetic operations; only total length is relevant).
Modifier and Type | Class | Description |
---|---|---|
static class |
DataDoubleBDArray.DataInfoDoubleBDArray |
|
static class |
DataDoubleBDArray.DataInfoDoubleBDArrayFactory |
Modifier and Type | Field | Description |
---|---|---|
static java.util.HashSet<java.math.BigDecimal> |
ones |
|
static java.util.HashSet<java.math.BigDecimal> |
zeros |
Constructor | Description |
---|---|
DataDoubleBDArray(int[] arrayShape,
int precision) |
Constructs a new multidimensional array of the given shape.
|
DataDoubleBDArray(int nValues,
int precision) |
Constructs a new one-dimensional array of the given length.
|
Modifier and Type | Method | Description |
---|---|---|
static void |
addBDOne(java.math.BigDecimal one) |
|
static void |
addBDZero(java.math.BigDecimal zero) |
|
void |
assignColumnFrom(int i,
java.math.BigDecimal[] array) |
Assigns values in given array to the i-th "hypercolumn" of this data array.
|
void |
assignColumnTo(int i,
java.math.BigDecimal[] array) |
Assigns values in the i=th "hypercolumn" of this array to the given array.
|
void |
assignSubsectionFrom(int[] idx,
double[] array) |
Assigns values in the given array to the subsection of this array
beginning at the specified index.
|
void |
assignTo(double[] array) |
Returns the encapsulated array, implementing the Data interface.
|
void |
DE(double y) |
Times-equals (*=) operation.
|
void |
DE(IData y) |
Divide-equals (/=) operation.
|
void |
E(double y) |
Equals (=) operation.
|
void |
E(IData y) |
Sets the wrapped array of values to the values in the given
instance.
|
void |
E(java.math.BigDecimal[] y) |
Copies each value in the given array to the values in the wrapped
array.
|
int |
getArrayDimension() |
Returns the dimension of the array, which is the number of integer
indices needed to access one of its elements.
|
int |
getArrayShape(int i) |
Returns the length of the array in the i-th dimension.
|
java.math.BigDecimal[] |
getData() |
Returns the encapsulated array.
|
int |
getLength() |
Returns the total length of the wrapped array.
|
double |
getValue(int i) |
Returns the i-th value of the wrapped array.
|
double |
getValue(int[] index) |
Returns the element of the array indicated by the given set of indices.
|
boolean |
isNaN() |
Returns true if any data value is true for Double.isNaN
|
void |
map(IFunction function) |
Replaces all values by the value of the function applied to each.
|
void |
ME(IData y) |
Minus-equals (-=) operation.
|
void |
PE(double y) |
Plus-equals (+=) operation.
|
void |
PE(IData y) |
Plus-equals (+=) operation.
|
void |
TE(double y) |
Times-equals (*=) operation.
|
void |
TE(IData y) |
Times-equals (*=) operation.
|
java.lang.String |
toString() |
Returns a string formed from the dataInfo label and the array values.
|
public static java.util.HashSet<java.math.BigDecimal> zeros
public static java.util.HashSet<java.math.BigDecimal> ones
public DataDoubleBDArray(int nValues, int precision)
nValues
- length of the one-dimensional arraypublic DataDoubleBDArray(int[] arrayShape, int precision)
arrayShape
- length of the array in each dimensionpublic int getArrayDimension()
public void E(IData y)
public void E(java.math.BigDecimal[] y)
java.lang.IllegalArgumentException
- if the arrays are of different lengthspublic void PE(IData y)
public static void addBDZero(java.math.BigDecimal zero)
public static void addBDOne(java.math.BigDecimal one)
public void ME(IData y)
public void TE(IData y)
public void DE(IData y)
public void E(double y)
public void PE(double y)
public void TE(double y)
public void DE(double y)
public void map(IFunction function)
public int getLength()
public int getArrayShape(int i)
public double getValue(int i)
public double getValue(int[] index)
java.lang.ArrayIndexOutOfBoundsException
- if length of given array is less than getArrayDimension (if
length is greater, excess indices are ignored).public java.math.BigDecimal[] getData()
public boolean isNaN()
IData
public void assignTo(double[] array)
public void assignColumnTo(int i, java.math.BigDecimal[] array)
public void assignColumnFrom(int i, java.math.BigDecimal[] array)
public void assignSubsectionFrom(int[] idx, double[] array)
idx
- index array of length less than or equal to getArrayDimension
(right-padded with zeros if shorter)array
- values to be copied into this arraypublic java.lang.String toString()
toString
in class java.lang.Object