Record Class SparseVectorData<T>
java.lang.Object
java.lang.Record
org.flag4j.arrays.SparseVectorData<T>
- Record Components:
shape
- Shape of the vector.data
- Non-zero data of the sparse COO vector.indices
- Non-zero indices of the sparse COO vector.
Data class for storing information for a sparse COO vector.
This record stores two lists: the non-zero data and the indices of the vector.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondata()
Returns the value of thedata
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.indices()
Returns the value of theindices
record component.int[]
Converts the indices of this sparse vector data to a primitive integer array.shape()
Returns the value of theshape
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
SparseVectorData
-
-
Method Details
-
indicesToArray
public int[] indicesToArray()Converts the indices of this sparse vector data to a primitive integer array.- Returns:
- A primitive integer array containing the indices of this sparse vector data.
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
shape
-
data
-
indices
-