Class SparseValidation
java.lang.Object
org.flag4j.arrays.sparse.SparseValidation
Utility class for validating parameters of sparse vectors, matrices, and tensors.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
validateCoo
(int size, int nnz, int[] indices) Validates constructor parameters for sparse COO vectors.static void
validateCoo
(Shape shape, int nnz, int[][] indices) Validates constructor parameters for sparse COO tensors.static void
validateCoo
(Shape shape, int nnz, int[] rowIndices, int[] colIndices) Validates constructor parameters for sparse COO matrices.static void
validateCsr
(Shape shape, int nnz, int[] rowPointers, int[] colIndices) Validates constructor parameters for sparse CSR matrices.
-
Constructor Details
-
SparseValidation
public SparseValidation()
-
-
Method Details
-
validateCoo
public static void validateCoo(int size, int nnz, int[] indices) Validates constructor parameters for sparse COO vectors.- Parameters:
size
- Full size of the COO vector.nnz
- Number of non-zero entries in the COO vector.indices
- Non-zero indices of the COO vector.- Throws:
IllegalArgumentException
- If the parameters do not specify a valid COO vector.
-
validateCoo
Validates constructor parameters for sparse COO matrices.- Parameters:
shape
- Shape of the matrix.nnz
- Number of non-zero values entries in the COO matrix.rowIndices
- The non-zero row indices in the COO matrix.colIndices
- The non-zero column indices in the COO matrix.- Throws:
IllegalArgumentException
- If the parameters do not specify a valid COO Matrix.
-
validateCoo
Validates constructor parameters for sparse COO tensors.- Parameters:
shape
- Shape of the tensor.nnz
- Number of non-zero values entries in the COO tensor.indices
- The non-zero indices of the COO tensor.
-
validateCsr
Validates constructor parameters for sparse CSR matrices.- Parameters:
shape
- Shape of the matrix.nnz
- Number of non-zero values entries in the CSR matrix.rowPointers
- The non-zero row pointers in the CSR matrix.colIndices
- The non-zero column indices in the CSR matrix.- Throws:
IllegalArgumentException
- If the parameters do not specify a valid CSR Matrix.
-