[numerics] add some assertions on storageType and version
@@ -2981,6 +2981,8 @@ CSparseMatrix* NM_triplet(NumericsMatrix* A)
NM_clearTriplet(A);
}
+ assert(NM_version(A, A->storageType) == NM_max_version(A));
+
if(!numericsSparseMatrix(A)->triplet)
// ||
// NSM_version(numericsSparseMatrix(A), NSM_TRIPLET) < NSM_max_version(numericsSparseMatrix(A)))
@@ -3100,6 +3102,9 @@ CSparseMatrix* NM_triplet(NumericsMatrix* A)
CSparseMatrix* NM_half_triplet(NumericsMatrix* A)
{
+ assert(A);
+ assert(NM_version(A, A->storageType) == NM_max_version(A));
+
if(numericsSparseMatrix(A)->half_triplet && (NM_max_version(A) >
NSM_version(numericsSparseMatrix(A),
NSM_HALF_TRIPLET)))
@@ -3221,9 +3226,14 @@ CSparseMatrix* NM_half_triplet(NumericsMatrix* A)
CSparseMatrix* NM_csc(NumericsMatrix *A)
{
+
+ assert(NM_version(A, A->storageType) == NM_max_version(A));
+
DEBUG_BEGIN("NM_csc(NumericsMatrix *A)\n");
assert(A);
+ assert(NM_version(A, A->storageType) == NM_max_version(A));
+
if(numericsSparseMatrix(A)->csc && (NM_max_version(A) >
NSM_version(numericsSparseMatrix(A),
NSM_CSC)))
@@ -3303,6 +3313,7 @@ CSparseMatrix* NM_csc_trans(NumericsMatrix* A)
CSparseMatrix* NM_csr(NumericsMatrix *A)
{
assert(A);
+ assert(NM_version(A, A->storageType) == NM_max_version(A));
if(numericsSparseMatrix(A)->csr && (NM_max_version(A) >
NSM_version(numericsSparseMatrix(A),
