Package org.djunits.vecmat.storage
Class SparseFloatDataSiTest
java.lang.Object
org.djunits.vecmat.storage.SparseFloatDataSiTest
Unit tests for
SparseFloatDataSi.
Achieves full branch and method coverage, including:
- All constructors
- Validation of nulls, bounds, ragged matrices, and index invariants
- Sparse generation via all storeSparse(...) overloads
- Binary-search paths in get()
- All DataGrid default methods (getRowArray, getColArray)
- copy(), instantiateNew(), cardinality()
- SI conversion using Length
- equals and hashCode
- Author:
- Alexander Verbraeck (specifications); Test implementation by Copilot.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidTest cardinality.voidtestCopy()Test deep copy.voidConstructor(Collection): row/col bounds + SI.voidConstructor: double[] denseData.voidConstructor: float[] denseData.voidConstructor: Q[] denseData to sparse safe copy.voidConstructor: float[][] densely.voidConstructor: double[][] densely.voidConstructor(Q[][]): SI conversion + ragged detection + sparse copy.voidConstructor: Q[] sparseData + indexes + safe copy.voidTest equals and hashCode.voidget() and getDataArray(): binary search hit/miss + safe copy.voidTest instantiateNew.voidTest length errors.voidTest protected constructor(float[], int[], r, c) via reflection-like access through copy().voidDataGrid.getRowArray / getColArray: correctness + bounds.
-
Constructor Details
-
SparseFloatDataSiTest
public SparseFloatDataSiTest()
-
-
Method Details
-
testProtectedConstructor
@Test @DisplayName("protected ctor(float[],indexes,r,c): validates length, order, bounds") public void testProtectedConstructor()Test protected constructor(float[], int[], r, c) via reflection-like access through copy(). -
testLengthErrors
@Test public void testLengthErrors()Test length errors. -
testCtorDenseData
@Test @DisplayName("ctor(double[],r,c): basic sparse conversion + validations") public void testCtorDenseData()Constructor: double[] denseData. -
testCtorDenseFloatData
@Test @DisplayName("ctor(float[],r,c): basic sparse conversion + validations") public void testCtorDenseFloatData()Constructor: float[] denseData. -
testCtorMatrix
@Test @DisplayName("ctor(double[][]): ragged detection + safe sparse copy") public void testCtorMatrix()Constructor: double[][] densely. -
testCtorFloatMatrix
@Test @DisplayName("ctor(float[][]): ragged detection + safe sparse copy") public void testCtorFloatMatrix()Constructor: float[][] densely. -
testCtorSparseQArray
@Test @DisplayName("ctor(Q[],indexes): SI conversion + safe copies") public void testCtorSparseQArray()Constructor: Q[] sparseData + indexes + safe copy. -
testCtorDenseQArray
@Test @DisplayName("ctor(Q[],r,c): full dense \u2192 sparse with SI conversion") public void testCtorDenseQArray()Constructor: Q[] denseData to sparse safe copy. -
testCtorMatrixQ
@Test @DisplayName("ctor(Q[][]): SI conversion + ragged detection + sparse copy") public void testCtorMatrixQ()Constructor(Q[][]): SI conversion + ragged detection + sparse copy. -
testCtorCollection
@Test @DisplayName("ctor(Collection): row/col bounds + SI") public void testCtorCollection()Constructor(Collection): row/col bounds + SI. -
testGetAndGetDataArray
@Test @DisplayName("get() and getDataArray(): binary search hit/miss + safe copy") public void testGetAndGetDataArray()get() and getDataArray(): binary search hit/miss + safe copy. -
testRowColDefaults
@Test @DisplayName("DataGrid.getRowArray / getColArray: correctness + bounds") public void testRowColDefaults()DataGrid.getRowArray / getColArray: correctness + bounds. -
testCopy
@Test @DisplayName("copy(): deep copy") public void testCopy()Test deep copy. -
testInstantiateNew
@Test @DisplayName("instantiateNew: reshape and size validation") public void testInstantiateNew()Test instantiateNew. -
testCardinality
@Test @DisplayName("cardinality: count non-zero sparse entries") public void testCardinality()Test cardinality. -
testEqualsHashCode
@Test @DisplayName("equals/hashCode: reflexive, symmetric, correct mismatch detection") public void testEqualsHashCode()Test equals and hashCode.
-