IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 15, 2006, 3:43:39 PM (19 years ago)
Author:
magnier
Message:

added psSparseBorder for special matrices

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/math/psSparse.h

    r10001 r10009  
    2929}
    3030psSparse;
     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)
     35typedef 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}
     44psSparseBorder;
    3145
    3246// allocate a sparse matrix structure
     
    6579                       );
    6680
    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 struct
    72     {
    73         psSparse *sparse;  // corresponding sparse matrix equation
    74         psImage *Bij;   // Aij contains the populated elements of the matrix
    75         psImage *Qii;   // Bfj contains the elements of the vector Bf
    76         psVector *Yi;   // lower independent var
    77         psVector *Gi;   // lower dependent var
    78         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 
    8481// allocate a sparse matrix structure
    8582psSparseBorder *psSparseBorderAlloc(psSparse *sparse, int Nborder);
    8683
    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                                 );
     84bool psSparseBorderElementT(psSparseBorder *border, int i, int j, float value);
    9385
    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 */
     86bool psSparseBorderElementB(psSparseBorder *border, int i, int j, float value);
     87
     88bool psSparseBorderElementG(psSparseBorder *border, int i, float value);
     89
     90psVector *psSparseBorderLowerProduct (psVector *dG, psSparseBorder *border, psVector *xVec);
     91
     92psVector *psSparseBorderUpperProduct (psVector *dF, psSparseBorder *border, psVector *yVec);
     93
     94psVector *psSparseBorderSquareProduct (psVector *dG, psSparseBorder *border, psVector *yVec);
     95
     96bool psSparseBorderUpperDelta (psSparseBorder *border, psVector *dF);
     97
     98bool psSparseBorderLowerDelta (psSparseBorder *border, psVector *dG);
     99
     100bool psSparseBorderMultiply (psVector **fIn, psVector **gIn, psSparseBorder *border, psVector *xVec, psVector *yVec);
     101
     102bool psSparseBorderSolve(psVector **xFit, psVector **yFit, psSparseConstraint constraint, psSparseBorder *border, int Niter);
    100103
    101104#endif /* PS_SPARSE_H */
Note: See TracChangeset for help on using the changeset viewer.