Index: /trunk/psModules/src/objects/pmGrowthCurve.c
===================================================================
--- /trunk/psModules/src/objects/pmGrowthCurve.c	(revision 6942)
+++ /trunk/psModules/src/objects/pmGrowthCurve.c	(revision 6943)
@@ -5,6 +5,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-04-17 18:01:05 $
+ *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-04-21 21:25:52 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -35,4 +35,5 @@
     growth->radius = psVectorCreate (NULL, minRadius, maxRadius, 1.0, PS_TYPE_F32);
     growth->apMag  = psVectorAlloc (growth->radius->n, PS_TYPE_F32);
+    growth->apMag->n = growth->radius->n;
 
     // XXX may want to extend this to allow for a different refRadius;
Index: /trunk/psModules/src/objects/pmModel.c
===================================================================
--- /trunk/psModules/src/objects/pmModel.c	(revision 6942)
+++ /trunk/psModules/src/objects/pmModel.c	(revision 6943)
@@ -6,6 +6,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-04-17 18:01:05 $
+ *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-04-21 21:26:01 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -61,4 +61,5 @@
     tmp->params  = psVectorAlloc(Nparams, PS_TYPE_F32);
     tmp->dparams = psVectorAlloc(Nparams, PS_TYPE_F32);
+    tmp->params->n = tmp->dparams->n = Nparams;
 
     for (psS32 i = 0; i < tmp->params->n; i++) {
@@ -111,4 +112,5 @@
     x->data.F32[0] = (psF32) (col + image->col0);
     x->data.F32[1] = (psF32) (row + image->row0);
+    x->n = 2;
     psF32 tmpF;
     pmModelFunc modelFunc;
@@ -136,4 +138,5 @@
 
     psVector *x = psVectorAlloc(2, PS_TYPE_F32);
+    x->n = 2;
     psVector *params = model->params;
     pmModelFunc modelFunc = pmModelFunc_GetFunction (model->type);
Index: /trunk/psModules/src/objects/pmPSFtry.c
===================================================================
--- /trunk/psModules/src/objects/pmPSFtry.c	(revision 6942)
+++ /trunk/psModules/src/objects/pmPSFtry.c	(revision 6943)
@@ -5,6 +5,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-04-19 20:37:35 $
+ *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-04-21 21:26:22 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -67,4 +67,6 @@
     test->fitMag   = psVectorAlloc (sources->n, PS_TYPE_F64);
     test->mask     = psVectorAlloc (sources->n, PS_TYPE_U8);
+    test->metric->n = test->fitMag->n = test->mask->n = sources->n;
+    test->modelEXT->n = test->modelPSF->n = sources->n;
 
     for (int i = 0; i < test->modelEXT->n; i++) {
@@ -190,4 +192,5 @@
     psVector *chisq = psVectorAlloc (psfTry->sources->n, PS_TYPE_F64);
     psVector *mask  = psVectorAlloc (psfTry->sources->n, PS_TYPE_MASK);
+    flux->n = mask->n = chisq->n = psfTry->sources->n;
 
     // write sources with models first
@@ -211,5 +214,5 @@
     psVectorClipFitPolynomial1D (psfTry->psf->ChiTrend, stats, mask, 1, chisq, NULL, flux);
     for (int i = 0; i < psfTry->psf->ChiTrend->nX + 1; i++) {
-        psLogMsg ("pmPSFtry", 4, "chisq vs flux fit term %d: %f +/- %f\n", i, psfTry->psf->ChiTrend->coeff[i]*pow(10000, i), psfTry->psf->ChiTrend->coeffErr[i]);
+        psLogMsg ("pmPSFtry", 4, "chisq vs flux fit term %d: %f +/- %f\n", i, psfTry->psf->ChiTrend->coeff[i]*pow(10000, i), psfTry->psf->ChiTrend->coeffErr[i]*pow(10000,i));
     }
     psLogMsg ("pmPSFtry", 4, "chisq vs flux fit: %f +/- %f\n", stats->sampleMedian, stats->sampleStdev);
@@ -239,4 +242,6 @@
     // r2rflux = radius^2 * ten(0.4*fitMag);
     psVector *r2rflux = psVectorAlloc (psfTry->sources->n, PS_TYPE_F64);
+    r2rflux->n = psfTry->sources->n;
+
     for (int i = 0; i < psfTry->sources->n; i++) {
         if (psfTry->mask->data.U8[i] & PSFTRY_MASK_ALL)
Index: /trunk/psModules/src/objects/pmPeaks.c
===================================================================
--- /trunk/psModules/src/objects/pmPeaks.c	(revision 6942)
+++ /trunk/psModules/src/objects/pmPeaks.c	(revision 6943)
@@ -6,6 +6,6 @@
  *  @author EAM, IfA: significant modifications.
  *
- *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-04-17 18:01:05 $
+ *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-04-21 21:26:44 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -65,4 +65,5 @@
         tmpVector->data.F32[col] = image->data.F32[row][col];
     }
+    tmpVector->n = image->numCols;
     psTrace(__func__, 4, "---- %s() end ----\n", __func__);
     return(tmpVector);
@@ -181,4 +182,5 @@
             tmpVector = psVectorAlloc(1, PS_TYPE_U32);
             tmpVector->data.U32[0] = 0;
+            tmpVector->n = 1;
         } else {
             tmpVector = psVectorAlloc(0, PS_TYPE_U32);
@@ -220,4 +222,5 @@
     //
     psVector *tmpVector = psVectorAlloc(count, PS_TYPE_U32);
+    tmpVector->n = count;
     count = 0;
 
Index: /trunk/psModules/src/objects/pmSourceContour.c
===================================================================
--- /trunk/psModules/src/objects/pmSourceContour.c	(revision 6942)
+++ /trunk/psModules/src/objects/pmSourceContour.c	(revision 6943)
@@ -6,6 +6,6 @@
  *  @author EAM, IfA: significant modifications.
  *
- *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-04-17 18:01:05 $
+ *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-04-21 21:27:04 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -323,4 +323,6 @@
     // fprintf (stderr, "done\n");
     psArray *tmpArray = psArrayAlloc(2);
+    tmpArray->n = 2;
+
     tmpArray->data[0] = (psPtr *) xVec;
     tmpArray->data[1] = (psPtr *) yVec;
@@ -360,4 +362,5 @@
     psVector *xVec = psVectorAlloc(2 * source->pixels->numRows, PS_TYPE_F32);
     psVector *yVec = psVectorAlloc(2 * source->pixels->numRows, PS_TYPE_F32);
+    xVec->n = yVec->n = 2 * source->pixels->numRows;
 
     //
@@ -440,4 +443,6 @@
     //
     psArray *tmpArray = psArrayAlloc(2);
+    tmpArray->n = 2;
+
     tmpArray->data[0] = (psPtr *) yVec;
     tmpArray->data[1] = (psPtr *) xVec;
Index: /trunk/psModules/src/objects/pmSourceIO_CMF.c
===================================================================
--- /trunk/psModules/src/objects/pmSourceIO_CMF.c	(revision 6942)
+++ /trunk/psModules/src/objects/pmSourceIO_CMF.c	(revision 6943)
@@ -3,6 +3,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-04-17 18:01:05 $
+ *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-04-21 21:27:23 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -124,4 +124,5 @@
 
     psArray *sources = psArrayAlloc (table->n);
+    sources->n = table->n;
 
     // convert the table to the pmSource entries
Index: /trunk/psModules/src/objects/pmSourcePhotometry.c
===================================================================
--- /trunk/psModules/src/objects/pmSourcePhotometry.c	(revision 6942)
+++ /trunk/psModules/src/objects/pmSourcePhotometry.c	(revision 6943)
@@ -3,6 +3,6 @@
  *  @author EAM, IfA; GLG, MHPCC
  *
- *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-04-19 20:37:35 $
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-04-21 21:28:31 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -237,4 +237,6 @@
     pmModelFunc modelFunc = pmModelFunc_GetFunction (model->type);
     psVector *coord = psVectorAlloc(2, PS_TYPE_F32);
+    coord->n = 2;
+
     psVector *params = model->params;
 
Index: /trunk/psModules/src/pslib/psSparse.c
===================================================================
--- /trunk/psModules/src/pslib/psSparse.c	(revision 6942)
+++ /trunk/psModules/src/pslib/psSparse.c	(revision 6943)
@@ -30,4 +30,6 @@
     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;
@@ -109,4 +111,5 @@
     if (output == NULL) {
         output = psVectorAlloc (vector->n, PS_DATA_F32);
+        output->n = vector->n;
     }
 
@@ -136,4 +139,5 @@
     // temporary storage for intermediate results
     psVector *dQ = psVectorAlloc (guess->n, PS_DATA_F32);
+    dQ->n = guess->n;
 
     for (int j = 0; j < Niter; j++) {
@@ -171,4 +175,6 @@
     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++) {
         int j = index->data.U32[i];
@@ -213,5 +219,7 @@
     x->data.F32[1] = 5;
     x->data.F32[2] = 7;
-    fprintf (stderr, "x: %f %f %f\n", x->data.F32[0], x->data.F32[1], x->data.F32[2]);
+    x->n = 3;
+    fprintf (stderr, "x: %f %f %f\n", x->data.F32[0], x->data.F32[1], x->data.F32[2]);
+
 
     psVector *B = psSparseMatrixTimesVector (NULL, sparse, x);
