public class RealSparseArray extends ProtoSparseArray<RealSparseArray,double[],Double,RealArray>
Array.IndexingOrder
Modifier and Type | Field and Description |
---|---|
protected static double[] |
empty
An empty array.
|
dimOffsets, dims, emptyIndices, state, strides
Modifier | Constructor and Description |
---|---|
|
RealSparseArray(int... dims)
Default constructor.
|
protected |
RealSparseArray(int unused,
int[] dims)
Internal constructor with a distinctive signature.
|
|
RealSparseArray(RealSparseArray array)
Alternate constructor.
|
protected |
RealSparseArray(SparseArrayState<double[]> state,
int[] dims,
int[] strides,
int[] dimOffsets)
Internal constructor for package use only.
|
Modifier and Type | Method and Description |
---|---|
protected double[] |
empty()
Gets an empty array of values.
|
Class<Double> |
getComponentType()
Gets the component type.
|
protected int |
length(double[] values)
Gets the length of the given array.
|
RealArray |
toDense()
Converts this array to its dense form.
|
String |
toString()
Creates a human-readable representation of this array.
|
protected RealSparseArray |
wrap(Double value,
int[] dims,
int[] strides,
int[] dimOffsets)
Allocates a new array initialized to the given value.
|
protected RealSparseArray |
wrap(SparseArrayState<double[]> state,
int[] dims,
int[] strides,
int[] dimOffsets)
Allocates a new array.
|
public RealSparseArray(int... dims)
protected RealSparseArray(int unused, int[] dims)
public RealSparseArray(RealSparseArray array)
protected RealSparseArray(SparseArrayState<double[]> state, int[] dims, int[] strides, int[] dimOffsets)
public Class<Double> getComponentType()
Array
protected RealSparseArray wrap(Double value, int[] dims, int[] strides, int[] dimOffsets)
ProtoSparseArray
wrap
in class ProtoSparseArray<RealSparseArray,double[],Double,RealArray>
value
- the initial value.dims
- the dimensions.strides
- the strides.dimOffsets
- the dimension offsets.protected RealSparseArray wrap(SparseArrayState<double[]> state, int[] dims, int[] strides, int[] dimOffsets)
ProtoSparseArray
wrap
in class ProtoSparseArray<RealSparseArray,double[],Double,RealArray>
state
- the SparseArrayState
.dims
- the dimensions.strides
- the strides.dimOffsets
- the dimension offsets.protected int length(double[] values)
ProtoSparseArray
length
in class ProtoSparseArray<RealSparseArray,double[],Double,RealArray>
values
- the array.protected double[] empty()
ProtoSparseArray
empty
in class ProtoSparseArray<RealSparseArray,double[],Double,RealArray>
public RealArray toDense()
ProtoSparseArray
toDense
in class ProtoSparseArray<RealSparseArray,double[],Double,RealArray>