Index: trunk/psLib/src/math/psSparse.c
===================================================================
--- trunk/psLib/src/math/psSparse.c	(revision 8627)
+++ trunk/psLib/src/math/psSparse.c	(revision 9730)
@@ -35,17 +35,12 @@
     psMemSetDeallocator(sparse, (psFreeFunc)sparseFree);
 
-    sparse->Aij = psVectorAlloc(Nelem, PS_DATA_F32);
-    sparse->Si  = psVectorAlloc(Nelem, PS_DATA_S32);
-    sparse->Sj  = psVectorAlloc(Nelem, PS_DATA_S32);
-
-    sparse->Aij->n = 0;
-    sparse->Si->n  = 0;
-    sparse->Sj->n  = 0;
+    sparse->Aij = psVectorAllocEmpty(Nelem, PS_DATA_F32);
+    sparse->Si  = psVectorAllocEmpty(Nelem, PS_DATA_S32);
+    sparse->Sj  = psVectorAllocEmpty(Nelem, PS_DATA_S32);
+
     sparse->Nelem = 0;
 
     sparse->Bfj = psVectorAlloc(Nrows, PS_DATA_F32);
     sparse->Qii = psVectorAlloc(Nrows, PS_DATA_F32);
-    sparse->Bfj->n = Nrows;
-    sparse->Qii->n = Nrows;
 
     sparse->Nrows = Nrows;
@@ -157,5 +152,4 @@
     // temporary storage for intermediate results
     psVector *dQ = psVectorAlloc(output->n, PS_DATA_F32);
-    dQ->n = output->n;
 
     for (int j = 0; j < Niter; j++) {
@@ -197,5 +191,4 @@
     psVector *tSi  = psVectorAlloc(Nelem, PS_DATA_S32);
     psVector *tSj  = psVectorAlloc(Nelem, PS_DATA_S32);
-    tAij->n = tSi->n = tSj->n = Nelem;
 
     for (int i = 0; i < Nelem; i++) {
