Skip to content
This repository was archived by the owner on Jul 15, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
Expand Up@@ -63,7 +63,7 @@ public class BooleanSparseNdArray extends AbstractSparseNdArray<Boolean, Boolean
implements BooleanNdArray{

/**
* Creates a BooleanSparseNdArray with a default value of false.
* Creates a BooleanSparseNdArray
*
* @param indices A 2-D LongNdArray of shape{@code [N, ndims]}, that specifies the indices of the
* elements in the sparse array that contain non-default values (elements are zero-indexed).
Expand All@@ -74,14 +74,19 @@ public class BooleanSparseNdArray extends AbstractSparseNdArray<Boolean, Boolean
* parameter{@code values=[18, 3.6]} specifies that element{@code [1,3]} of the sparse
* NdArray has a value of{@code 18}, and element{@code [2,4]} of the NdArray has a value of
*{@code 3.6}.
* @param defaultValue Scalar value to set for indices not specified in{@link #getIndices()}
* @param dimensions the dimensional space for the dense object represented by this sparse array,
*/
BooleanSparseNdArray(LongNdArray indices, BooleanNdArray values, DimensionalSpace dimensions){
this(indices, values, false, dimensions);
protected BooleanSparseNdArray(
LongNdArray indices,
BooleanNdArray values,
boolean defaultValue,
DimensionalSpace dimensions){
super(indices, values, defaultValue, dimensions);
}

/**
* Creates a BooleanSparseNdArray
* Creates a BooleanSparseNdArray with a default value of false.
*
* @param indices A 2-D LongNdArray of shape{@code [N, ndims]}, that specifies the indices of the
* elements in the sparse array that contain non-default values (elements are zero-indexed).
Expand All@@ -92,15 +97,10 @@ public class BooleanSparseNdArray extends AbstractSparseNdArray<Boolean, Boolean
* parameter{@code values=[18, 3.6]} specifies that element{@code [1,3]} of the sparse
* NdArray has a value of{@code 18}, and element{@code [2,4]} of the NdArray has a value of
*{@code 3.6}.
* @param defaultValue Scalar value to set for indices not specified in{@link #getIndices()}
* @param dimensions the dimensional space for the dense object represented by this sparse array,
*/
BooleanSparseNdArray(
LongNdArray indices,
BooleanNdArray values,
boolean defaultValue,
DimensionalSpace dimensions){
super(indices, values, defaultValue, dimensions);
BooleanSparseNdArray(LongNdArray indices, BooleanNdArray values, DimensionalSpace dimensions){
this(indices, values, false, dimensions);
}

/**
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -63,7 +63,7 @@ public class ByteSparseNdArray extends AbstractSparseNdArray<Byte, ByteNdArray>
implements ByteNdArray{

/**
* Creates a ByteSparseNdArray
* Creates a ByteSparseNdArray with a default value of zero.
*
* @param indices A 2-D LongNdArray of shape{@code [N, ndims]}, that specifies the indices of the
* elements in the sparse array that contain non-default values (elements are zero-indexed).
Expand All@@ -73,14 +73,16 @@ public class ByteSparseNdArray extends AbstractSparseNdArray<Byte, ByteNdArray>
* each element in indices. For example, given{@code indices=[[1,3], [2,4]]}, the parameter
*{@code values=[18, 3.6]} specifies that element{@code [1,3]} of the sparse NdArray has a
* value of{@code 18}, and element{@code [2,4]} of the NdArray has a value of{@code 3.6}.
* @param defaultValue Scalar value to set for indices not specified in{@link #getIndices()}
* @param dimensions the dimensional space for the dense object represented by this sparse array,
*/
ByteSparseNdArray(LongNdArray indices, ByteNdArray values, DimensionalSpace dimensions){
this(indices, values, (byte) 0, dimensions);
protected ByteSparseNdArray(
LongNdArray indices, ByteNdArray values, byte defaultValue, DimensionalSpace dimensions){
super(indices, values, defaultValue, dimensions);
}

/**
* Creates a ByteSparseNdArray with a default value of zero.
* Creates a ByteSparseNdArray
*
* @param indices A 2-D LongNdArray of shape{@code [N, ndims]}, that specifies the indices of the
* elements in the sparse array that contain non-default values (elements are zero-indexed).
Expand All@@ -90,12 +92,10 @@ public class ByteSparseNdArray extends AbstractSparseNdArray<Byte, ByteNdArray>
* each element in indices. For example, given{@code indices=[[1,3], [2,4]]}, the parameter
*{@code values=[18, 3.6]} specifies that element{@code [1,3]} of the sparse NdArray has a
* value of{@code 18}, and element{@code [2,4]} of the NdArray has a value of{@code 3.6}.
* @param defaultValue Scalar value to set for indices not specified in{@link #getIndices()}
* @param dimensions the dimensional space for the dense object represented by this sparse array,
*/
ByteSparseNdArray(
LongNdArray indices, ByteNdArray values, byte defaultValue, DimensionalSpace dimensions){
super(indices, values, defaultValue, dimensions);
ByteSparseNdArray(LongNdArray indices, ByteNdArray values, DimensionalSpace dimensions){
this(indices, values, (byte) 0, dimensions);
}

/**
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -63,7 +63,7 @@ public class DoubleSparseNdArray extends AbstractSparseNdArray<Double, DoubleNdA
implements DoubleNdArray{

/**
* Creates a DoubleSparseNdArray with a default value of zero.
* Creates a DoubleSparseNdArray
*
* @param indices A 2-D LongNdArray of shape{@code [N, ndims]}, that specifies the indices of the
* elements in the sparse array that contain non-default values (elements are zero-indexed).
Expand All@@ -73,14 +73,16 @@ public class DoubleSparseNdArray extends AbstractSparseNdArray<Double, DoubleNdA
* element in indices. For example, given{@code indices=[[1,3], [2,4]]}, the parameter{@code
* values=[18, 3.6]} specifies that element{@code [1,3]} of the sparse NdArray has a value of
*{@code 18}, and element{@code [2,4]} of the NdArray has a value of{@code 3.6}.
* @param defaultValue Scalar value to set for indices not specified in{@link #getIndices()}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should be {@code indices} rather than {@link #getIndices()}, as it refers to the construction parameter rather than some instance method that you can't actually call when constructing the object.

* @param dimensions the dimensional space for the dense object represented by this sparse array,
*/
DoubleSparseNdArray(LongNdArray indices, DoubleNdArray values, DimensionalSpace dimensions){
this(indices, values, 0d, dimensions);
protected DoubleSparseNdArray(
LongNdArray indices, DoubleNdArray values, double defaultValue, DimensionalSpace dimensions){
super(indices, values, defaultValue, dimensions);
}

/**
* Creates a DoubleSparseNdArray
* Creates a DoubleSparseNdArray with a default value of zero.
*
* @param indices A 2-D LongNdArray of shape{@code [N, ndims]}, that specifies the indices of the
* elements in the sparse array that contain non-default values (elements are zero-indexed).
Expand All@@ -90,12 +92,10 @@ public class DoubleSparseNdArray extends AbstractSparseNdArray<Double, DoubleNdA
* element in indices. For example, given{@code indices=[[1,3], [2,4]]}, the parameter{@code
* values=[18, 3.6]} specifies that element{@code [1,3]} of the sparse NdArray has a value of
*{@code 18}, and element{@code [2,4]} of the NdArray has a value of{@code 3.6}.
* @param defaultValue Scalar value to set for indices not specified in{@link #getIndices()}
* @param dimensions the dimensional space for the dense object represented by this sparse array,
*/
DoubleSparseNdArray(
LongNdArray indices, DoubleNdArray values, double defaultValue, DimensionalSpace dimensions){
super(indices, values, defaultValue, dimensions);
DoubleSparseNdArray(LongNdArray indices, DoubleNdArray values, DimensionalSpace dimensions){
this(indices, values, 0d, dimensions);
}

/**
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -63,7 +63,7 @@ public class FloatSparseNdArray extends AbstractSparseNdArray<Float, FloatNdArra
implements FloatNdArray{

/**
* Creates a FloatSparseNdArray with a default value of zero.
* Creates a FloatSparseNdArray
*
* @param indices A 2-D LongNdArray of shape{@code [N, ndims]}, that specifies the indices of the
* elements in the sparse array that contain non-default values (elements are zero-indexed).
Expand All@@ -73,14 +73,16 @@ public class FloatSparseNdArray extends AbstractSparseNdArray<Float, FloatNdArra
* element in indices. For example, given{@code indices=[[1,3], [2,4]]}, the parameter{@code
* values=[18, 3.6]} specifies that element{@code [1,3]} of the sparse NdArray has a value of
*{@code 18}, and element{@code [2,4]} of the NdArray has a value of{@code 3.6}.
* @param defaultValue Scalar value to set for indices not specified in{@link #getIndices()}
* @param dimensions the dimensional space for the dense object represented by this sparse array,
*/
FloatSparseNdArray(LongNdArray indices, FloatNdArray values, DimensionalSpace dimensions){
this(indices, values, 0f, dimensions);
protected FloatSparseNdArray(
LongNdArray indices, FloatNdArray values, float defaultValue, DimensionalSpace dimensions){
super(indices, values, defaultValue, dimensions);
}

/**
* Creates a FloatSparseNdArray
* Creates a FloatSparseNdArray with a default value of zero.
*
* @param indices A 2-D LongNdArray of shape{@code [N, ndims]}, that specifies the indices of the
* elements in the sparse array that contain non-default values (elements are zero-indexed).
Expand All@@ -90,12 +92,10 @@ public class FloatSparseNdArray extends AbstractSparseNdArray<Float, FloatNdArra
* element in indices. For example, given{@code indices=[[1,3], [2,4]]}, the parameter{@code
* values=[18, 3.6]} specifies that element{@code [1,3]} of the sparse NdArray has a value of
*{@code 18}, and element{@code [2,4]} of the NdArray has a value of{@code 3.6}.
* @param defaultValue Scalar value to set for indices not specified in{@link #getIndices()}
* @param dimensions the dimensional space for the dense object represented by this sparse array,
*/
FloatSparseNdArray(
LongNdArray indices, FloatNdArray values, float defaultValue, DimensionalSpace dimensions){
super(indices, values, defaultValue, dimensions);
FloatSparseNdArray(LongNdArray indices, FloatNdArray values, DimensionalSpace dimensions){
this(indices, values, 0f, dimensions);
}

/**
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -63,7 +63,7 @@ public class IntSparseNdArray extends AbstractSparseNdArray<Integer, IntNdArray>
implements IntNdArray{

/**
* Creates a IntSparseNdArray with a default value of zero.
* Creates a IntSparseNdArray
*
* @param indices A 2-D LongNdArray of shape{@code [N, ndims]}, that specifies the indices of the
* elements in the sparse array that contain non-default values (elements are zero-indexed).
Expand All@@ -73,14 +73,16 @@ public class IntSparseNdArray extends AbstractSparseNdArray<Integer, IntNdArray>
* in indices. For example, given{@code indices=[[1,3], [2,4]]}, the parameter{@code
* values=[18, 3.6]} specifies that element{@code [1,3]} of the sparse NdArray has a value of
*{@code 18}, and element{@code [2,4]} of the NdArray has a value of{@code 3.6}.
* @param defaultValue Scalar value to set for indices not specified in{@link #getIndices()}
* @param dimensions the dimensional space for the dense object represented by this sparse array,
*/
IntSparseNdArray(LongNdArray indices, IntNdArray values, DimensionalSpace dimensions){
this(indices, values, 0, dimensions);
protected IntSparseNdArray(
LongNdArray indices, IntNdArray values, int defaultValue, DimensionalSpace dimensions){
super(indices, values, defaultValue, dimensions);
}

/**
* Creates a IntSparseNdArray
* Creates a IntSparseNdArray with a default value of zero.
*
* @param indices A 2-D LongNdArray of shape{@code [N, ndims]}, that specifies the indices of the
* elements in the sparse array that contain non-default values (elements are zero-indexed).
Expand All@@ -90,12 +92,10 @@ public class IntSparseNdArray extends AbstractSparseNdArray<Integer, IntNdArray>
* in indices. For example, given{@code indices=[[1,3], [2,4]]}, the parameter{@code
* values=[18, 3.6]} specifies that element{@code [1,3]} of the sparse NdArray has a value of
*{@code 18}, and element{@code [2,4]} of the NdArray has a value of{@code 3.6}.
* @param defaultValue Scalar value to set for indices not specified in{@link #getIndices()}
* @param dimensions the dimensional space for the dense object represented by this sparse array,
*/
IntSparseNdArray(
LongNdArray indices, IntNdArray values, int defaultValue, DimensionalSpace dimensions){
super(indices, values, defaultValue, dimensions);
IntSparseNdArray(LongNdArray indices, IntNdArray values, DimensionalSpace dimensions){
this(indices, values, 0, dimensions);
}

/**
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,7 +62,7 @@ public class LongSparseNdArray extends AbstractSparseNdArray<Long, LongNdArray>
implements LongNdArray{

/**
* Creates a LongSparseNdArray with a default value of zero.
* Creates a LongSparseNdArray
*
* @param indices A 2-D LongNdArray of shape{@code [N, ndims]}, that specifies the indices of the
* elements in the sparse array that contain non-default values (elements are zero-indexed).
Expand All@@ -72,14 +72,16 @@ public class LongSparseNdArray extends AbstractSparseNdArray<Long, LongNdArray>
* element in indices. For example, given{@code indices=[[1,3], [2,4]]}, the parameter{@code
* values=[18, 3.6]} specifies that element{@code [1,3]} of the sparse NdArray has a value of
*{@code 18}, and element{@code [2,4]} of the NdArray has a value of{@code 3.6}.
* @param defaultValue Scalar value to set for indices not specified in{@link #getIndices()}
* @param dimensions the dimensional space for the dense object represented by this sparse array,
*/
LongSparseNdArray(LongNdArray indices, LongNdArray values, DimensionalSpace dimensions){
this(indices, values, 0L, dimensions);
protected LongSparseNdArray(
LongNdArray indices, LongNdArray values, long defaultValue, DimensionalSpace dimensions){
super(indices, values, defaultValue, dimensions);
}

/**
* Creates a LongSparseNdArray
* Creates a LongSparseNdArray with a default value of zero.
*
* @param indices A 2-D LongNdArray of shape{@code [N, ndims]}, that specifies the indices of the
* elements in the sparse array that contain non-default values (elements are zero-indexed).
Expand All@@ -89,12 +91,10 @@ public class LongSparseNdArray extends AbstractSparseNdArray<Long, LongNdArray>
* element in indices. For example, given{@code indices=[[1,3], [2,4]]}, the parameter{@code
* values=[18, 3.6]} specifies that element{@code [1,3]} of the sparse NdArray has a value of
*{@code 18}, and element{@code [2,4]} of the NdArray has a value of{@code 3.6}.
* @param defaultValue Scalar value to set for indices not specified in{@link #getIndices()}
* @param dimensions the dimensional space for the dense object represented by this sparse array,
*/
LongSparseNdArray(
LongNdArray indices, LongNdArray values, long defaultValue, DimensionalSpace dimensions){
super(indices, values, defaultValue, dimensions);
LongSparseNdArray(LongNdArray indices, LongNdArray values, DimensionalSpace dimensions){
this(indices, values, 0L, dimensions);
}

/**
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -63,7 +63,7 @@ public class ShortSparseNdArray extends AbstractSparseNdArray<Short, ShortNdArra
implements ShortNdArray{

/**
* Creates a ShortSparseNdArray with a default value of zero.
* Creates a ShortSparseNdArray
*
* @param indices A 2-D LongNdArray of shape{@code [N, ndims]}, that specifies the indices of the
* elements in the sparse array that contain non-default values (elements are zero-indexed).
Expand All@@ -73,14 +73,16 @@ public class ShortSparseNdArray extends AbstractSparseNdArray<Short, ShortNdArra
* element in indices. For example, given{@code indices=[[1,3], [2,4]]}, the parameter{@code
* values=[18, 3.6]} specifies that element{@code [1,3]} of the sparse NdArray has a value of
*{@code 18}, and element{@code [2,4]} of the NdArray has a value of{@code 3.6}.
* @param defaultValue Scalar value to set for indices not specified in{@link #getIndices()}
* @param dimensions the dimensional space for the dense object represented by this sparse array,
*/
ShortSparseNdArray(LongNdArray indices, ShortNdArray values, DimensionalSpace dimensions){
this(indices, values, (short) 0, dimensions);
protected ShortSparseNdArray(
LongNdArray indices, ShortNdArray values, short defaultValue, DimensionalSpace dimensions){
super(indices, values, defaultValue, dimensions);
}

/**
* Creates a ShortSparseNdArray
* Creates a ShortSparseNdArray with a default value of zero.
*
* @param indices A 2-D LongNdArray of shape{@code [N, ndims]}, that specifies the indices of the
* elements in the sparse array that contain non-default values (elements are zero-indexed).
Expand All@@ -90,12 +92,10 @@ public class ShortSparseNdArray extends AbstractSparseNdArray<Short, ShortNdArra
* element in indices. For example, given{@code indices=[[1,3], [2,4]]}, the parameter{@code
* values=[18, 3.6]} specifies that element{@code [1,3]} of the sparse NdArray has a value of
*{@code 18}, and element{@code [2,4]} of the NdArray has a value of{@code 3.6}.
* @param defaultValue Scalar value to set for indices not specified in{@link #getIndices()}
* @param dimensions the dimensional space for the dense object represented by this sparse array,
*/
ShortSparseNdArray(
LongNdArray indices, ShortNdArray values, short defaultValue, DimensionalSpace dimensions){
super(indices, values, defaultValue, dimensions);
ShortSparseNdArray(LongNdArray indices, ShortNdArray values, DimensionalSpace dimensions){
this(indices, values, (short) 0, dimensions);
}

/**
Expand Down
Loading