IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 217


Ignore:
Timestamp:
Mar 11, 2004, 10:45:43 AM (22 years ago)
Author:
Paul Price
Message:

Defined proper polynomial types for 1 and 2 dimensions, with
corresponding double-precision versions (for astrometry).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/archive/pslib/include/psFunctions.h

    r153 r217  
    1313           );
    1414
    15 /** Polynomial: one dimension */
     15/************************************************************************************************************/
     16
     17/** One-dimensional polynomial */
     18typedef struct {
     19    int n;                              //!< Number of terms
     20    float *restrict coeff;              //!< Coefficients
     21    float *restrict coeffErr;           //!< Error in coefficients
     22    char *restrict mask;                //!< Coefficient mask
     23} psPolynomial1D;
     24
     25/** Two-dimensional polynomial */
     26typedef struct {
     27    int nX, nY;                         //!< Number of terms in x and y
     28    float *restrict *restrict coeff;    //!< Coefficients
     29    float *restrict *restrict coeffErr; //!< Error in coefficients
     30    char *restrict *restrict mask;      //!< Coefficients mask
     31} psPolynomial2D;
     32
     33
     34/** Double-precision one-dimensional polynomial */
     35typedef struct {
     36    int n;                              //!< Number of terms
     37    double *restrict coeff;             //!< Coefficients
     38    double *restrict coeffErr;          //!< Error in coefficients
     39    char *restrict mask;                //!< Coefficient mask
     40} psDPolynomial1D;
     41
     42/** Double-precision two-dimensional polynomial */
     43typedef struct {
     44    int nX, nY;                         //!< Number of terms in x and y
     45    double *restrict *restrict coeff;   //!< Coefficients
     46    double *restrict *restrict coeffErr; //!< Error in coefficients
     47    char *restrict *restrict mask;      //!< Coefficients mask
     48} psDPolynomial2D;
     49
     50
     51/** Constructors */
     52psPolynomial1D *psPolynomial1DAlloc(int n //!< Number of terms
     53                                    );
     54psPolynomial2D *psPolynomial2DAlloc(int nX, int nY //!< Number of terms in x and y
     55                                    );
     56psPolynomial1D *psDPolynomial1DAlloc(int n //!< Number of terms
     57                                     );
     58psPolynomial2D *psDPolynomial2DAlloc(int nX, int nY //!< Number of terms in x and y
     59                                     );
     60
     61/** Destructors */
     62void psPolynomial1DFree(psPolynomial1D *restrict myPoly //!< Polynomial to destroy
     63                        );
     64void psPolynomial2DFree(psPolynomial2D *restrict myPoly //!< Polynomial to destroy
     65                        );
     66void psDPolynomial1DFree(psPolynomial1D *restrict myPoly //!< Polynomial to destroy
     67                         );
     68void psDPolynomial2DFree(psPolynomial1D *restrict myPoly //!< Polynomial to destroy
     69                         );
     70
     71
     72/** Evaluate 1D polynomial */
    1673float
    17 psPolynomial1d(float x,                 //!< Value at which to evaluate
    18                const psFloatArray *restrict coeffs //!< Coefficients for the polynomial
    19                );
     74psEvalPolynomial1D(float x,             //!< Value at which to evaluate
     75                   const psPolynomial1D *restrict myPoly //!< Coefficients for the polynomial
     76                   );
    2077
    21 /** Polynomial: two dimensions */
     78/** Evaluate 2D polynomial */
    2279float
    23 psPolynomial2d(float x,                 //!< Value x at which to evaluate
    24                float y,                 //!< Value y at which to evaluate
    25                int orderx,              //!< Polynomial order in x
    26                int ordery,              //!< Polynomial order in y
    27                const psFloatArray *coeffs //!< Coefficients for the polynomial
    28                );
     80psEvalPolynomial2D(float x,             //!< Value x at which to evaluate
     81                   float y,             //!< Value y at which to evaluate
     82                   const psPolynomial2D *restrict myPoly //!< Coefficients for the polynomial
     83                   );
     84
     85/** Evaluate 1D polynomial (double precision) */
     86double
     87psEvalDPolynomial1D(double x,           //!< Value at which to evaluate
     88                    const psDPolynomial1D *restrict myPoly //!< Coefficients for the polynomial
     89                    );
     90
     91/** Evaluate 2D polynomial (double precision) */
     92double
     93psEvalDPolynomial2D(double x,           //!< Value x at which to evaluate
     94                    double y,           //!< Value y at which to evaluate
     95                    const psDPolynomial2D *restrict myPoly //!< Coefficients for the polynomial
     96                    );
    2997
    3098#endif
Note: See TracChangeset for help on using the changeset viewer.