Changeset 10009 for trunk/psLib/src/math/psSparse.h
- Timestamp:
- Nov 15, 2006, 3:43:39 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psSparse.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psSparse.h
r10001 r10009 29 29 } 30 30 psSparse; 31 32 // The border elements of a sparse matrix equation: 33 // A = |S B'| where T is a low-rank square matrix (N<20) 34 // |B T | and B is a rectangular band (B' is B transpose) 35 typedef struct 36 { 37 psSparse *sparse; // corresponding sparse matrix equation 38 psImage *Bij; // Bij contains the border band (Nrow x Nborder) 39 psImage *Tjj; // Tjj contains the square border matrix (Nborder x Nborder) 40 psVector *Gj; // XXX lower dependent var drop?? 41 int Nrows; // Number of rows (long dimension of Bij, 0-j) 42 int Nborder; // Number of border elements (size of Qii) 43 } 44 psSparseBorder; 31 45 32 46 // allocate a sparse matrix structure … … 65 79 ); 66 80 67 # if (0)68 // The border elements of a sparse matrix equation:69 // A = |S B| where Q is a low-rank square matrix (N<20)70 // |B Q| and B is a rectangular band (technically this is B and B^T)71 typedef struct72 {73 psSparse *sparse; // corresponding sparse matrix equation74 psImage *Bij; // Aij contains the populated elements of the matrix75 psImage *Qii; // Bfj contains the elements of the vector Bf76 psVector *Yi; // lower independent var77 psVector *Gi; // lower dependent var78 int Nrows; // Number of rows (long dimension of Bij, 0-j)79 int Nborder; // Number of border elements (size of Qii)80 }81 psSparseBorder;82 83 84 81 // allocate a sparse matrix structure 85 82 psSparseBorder *psSparseBorderAlloc(psSparse *sparse, int Nborder); 86 83 87 // add a new matrix element 88 // user should only add elements above the diagonal 89 bool psSparseBorderMatrixElement(psSparse *sparse, // Matrix to which to add 90 int i, int j, // Matrix indices at which to add 91 float value // Value to add 92 ); 84 bool psSparseBorderElementT(psSparseBorder *border, int i, int j, float value); 93 85 94 // define a new sparse matrix equation vector element 95 void psSparseBorderVectorElement(psSparse *sparse, // Matrix to which to add 96 int i, int j, // Index to add 97 float value // Value to add 98 ); 99 # endif /* gene's dev work */ 86 bool psSparseBorderElementB(psSparseBorder *border, int i, int j, float value); 87 88 bool psSparseBorderElementG(psSparseBorder *border, int i, float value); 89 90 psVector *psSparseBorderLowerProduct (psVector *dG, psSparseBorder *border, psVector *xVec); 91 92 psVector *psSparseBorderUpperProduct (psVector *dF, psSparseBorder *border, psVector *yVec); 93 94 psVector *psSparseBorderSquareProduct (psVector *dG, psSparseBorder *border, psVector *yVec); 95 96 bool psSparseBorderUpperDelta (psSparseBorder *border, psVector *dF); 97 98 bool psSparseBorderLowerDelta (psSparseBorder *border, psVector *dG); 99 100 bool psSparseBorderMultiply (psVector **fIn, psVector **gIn, psSparseBorder *border, psVector *xVec, psVector *yVec); 101 102 bool psSparseBorderSolve(psVector **xFit, psVector **yFit, psSparseConstraint constraint, psSparseBorder *border, int Niter); 100 103 101 104 #endif /* PS_SPARSE_H */
Note:
See TracChangeset
for help on using the changeset viewer.
