Index: trunk/psLib/src/math/psSparse.h
===================================================================
--- trunk/psLib/src/math/psSparse.h	(revision 10001)
+++ trunk/psLib/src/math/psSparse.h	(revision 10009)
@@ -29,4 +29,18 @@
 }
 psSparse;
+
+// The border elements of a sparse matrix equation:
+// A = |S B'| where T is a low-rank square matrix (N<20)
+//     |B T | and B is a rectangular band (B' is B transpose)
+typedef struct
+{
+    psSparse *sparse;   // corresponding sparse matrix equation
+    psImage *Bij;   // Bij contains the border band (Nrow x Nborder)
+    psImage *Tjj;   // Tjj contains the square border matrix (Nborder x Nborder)
+    psVector *Gj;   // XXX lower dependent var drop??
+    int Nrows;    // Number of rows (long dimension of Bij, 0-j)
+    int Nborder;   // Number of border elements (size of Qii)
+}
+psSparseBorder;
 
 // allocate a sparse matrix structure
@@ -65,37 +79,26 @@
                        );
 
-# if (0)
-    // The border elements of a sparse matrix equation:
-    // A = |S B| where Q is a low-rank square matrix (N<20)
-    //     |B Q| and B is a rectangular band (technically this is B and B^T)
-    typedef struct
-    {
-        psSparse *sparse;  // corresponding sparse matrix equation
-        psImage *Bij;   // Aij contains the populated elements of the matrix
-        psImage *Qii;   // Bfj contains the elements of the vector Bf
-        psVector *Yi;   // lower independent var
-        psVector *Gi;   // lower dependent var
-        int Nrows;   // Number of rows (long dimension of Bij, 0-j)
-        int Nborder;   // Number of border elements (size of Qii)
-    }
-psSparseBorder;
-
-
 // allocate a sparse matrix structure
 psSparseBorder *psSparseBorderAlloc(psSparse *sparse, int Nborder);
 
-// add a new matrix element
-// user should only add elements above the diagonal
-bool psSparseBorderMatrixElement(psSparse *sparse, // Matrix to which to add
-                                 int i, int j, // Matrix indices at which to add
-                                 float value  // Value to add
-                                );
+bool psSparseBorderElementT(psSparseBorder *border, int i, int j, float value);
 
-// define a new sparse matrix equation vector element
-void psSparseBorderVectorElement(psSparse *sparse, // Matrix to which to add
-                                 int i, int j, // Index to add
-                                 float value // Value to add
-                                );
-# endif /* gene's dev work */
+bool psSparseBorderElementB(psSparseBorder *border, int i, int j, float value);
+
+bool psSparseBorderElementG(psSparseBorder *border, int i, float value);
+
+psVector *psSparseBorderLowerProduct (psVector *dG, psSparseBorder *border, psVector *xVec);
+
+psVector *psSparseBorderUpperProduct (psVector *dF, psSparseBorder *border, psVector *yVec);
+
+psVector *psSparseBorderSquareProduct (psVector *dG, psSparseBorder *border, psVector *yVec);
+
+bool psSparseBorderUpperDelta (psSparseBorder *border, psVector *dF);
+
+bool psSparseBorderLowerDelta (psSparseBorder *border, psVector *dG);
+
+bool psSparseBorderMultiply (psVector **fIn, psVector **gIn, psSparseBorder *border, psVector *xVec, psVector *yVec);
+
+bool psSparseBorderSolve(psVector **xFit, psVector **yFit, psSparseConstraint constraint, psSparseBorder *border, int Niter);
 
 #endif /* PS_SPARSE_H */
