Class CRArray<A>
java.lang.Object
org.ddogleg.chainrule.CRArray<A>
References an index in an array. Used to abstract reading and writing array types.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CRArray<double[]> arrayD(double... values) byteb(int index) Array access for type bytevoidb(int index, byte value) Array access for type doublecopy()Creates a copy of the original array and this wrapper.doubled(int index) Array access for type doublevoidd(int index, double value) Array access for type doublefloatf(int index) Array access for type floatvoidf(int index, float value) Array access for type doubleinti(int index) Array access for type intvoidi(int index, int value) Array access for type doublebooleanChecks to see if the two arrays are equals to each other to within the specified tolerance and over the specified number of elementsbooleanvoidvoidCopies the passed in array into the referenced arrayreserve(int length) Ensure that the array has at least this many elements in itshorts(int index) Array access for type shortvoids(int index, short value) Array access for type doublesetOffset(int offset) Assigns a new value to the offset and returns a reference to 'this' allowing operations to be chained.Converts the array into a String using the provided printf format for each elementvoidCopies values into the passed in 'dest' array
-
Field Details
-
a
Reference to the array -
offset
public int offsetFirst index in the sub array
-
-
Constructor Details
-
CRArray
-
CRArray
public CRArray()
-
-
Method Details
-
arrayD
-
wrap
-
isInvalid
public boolean isInvalid() -
markInvalid
public void markInvalid() -
write
Copies values into the passed in 'dest' array- Parameters:
dest- Reference to the destination arrayoffset- Offset in the dest array where it should start writinglength- Number of elements to copy
-
read
Copies the passed in array into the referenced array- Parameters:
src- Reference to the source arrayoffset- Offset in the src array where it should startlength- Number of elements to copy
-
setOffset
-
d
public void d(int index, double value) Array access for type double -
d
public double d(int index) Array access for type double -
f
public void f(int index, float value) Array access for type double -
f
public float f(int index) Array access for type float -
i
public void i(int index, int value) Array access for type double -
i
public int i(int index) Array access for type int -
s
public void s(int index, short value) Array access for type double -
s
public short s(int index) Array access for type short -
b
public void b(int index, byte value) Array access for type double -
b
public byte b(int index) Array access for type byte -
reserve
-
toStringD
-
isEquals
Checks to see if the two arrays are equals to each other to within the specified tolerance and over the specified number of elements- Parameters:
compare- Array to compare againstlength- Number of elements to comparetol- Tolerance for equality- Returns:
- true if equal
-
copy
-