IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1464


Ignore:
Timestamp:
Aug 10, 2004, 4:37:55 PM (22 years ago)
Author:
desonia
Message:

doxygen cleanup.

Location:
trunk/psLib/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/dataManip/psFunctions.h

    r1441 r1464  
    1313*  @author George Gusciora, MHPCC
    1414*
    15 *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
    16 *  @date $Date: 2004-08-09 23:40:55 $
     15*  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
     16*  @date $Date: 2004-08-11 02:35:58 $
    1717*
    1818*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3131
    3232/** Evaluate a non-normalized Gaussian with the given mean and sigma at the
    33     given coordianate.  Note that this is not a Gaussian deviate.  The
    34     evaluated Gaussian is: \f[ exp(-\frac{(x-mean)^2}{2\sigma^2}) \f] */
    35 
    36 float psGaussian(float x,       ///< Value at which to evaluate
    37                  float mean,    ///< Mean for the Gaussian
    38                  float stddev,  ///< Standard deviation for the Gaussian
    39                  bool normal    ///< Indicates whether result should be normalized
    40                 );
     33 *  given coordianate. 
     34 *
     35 *  Note that this is not a Gaussian deviate.  The evaluated Gaussian is:
     36 *        \f[ exp(-\frac{(x-mean)^2}{2\sigma^2}) \f]
     37 *
     38 *  @return float      value on the gaussian curve given the input parameters
     39 */
     40float psGaussian(
     41    float x,                           ///< Value at which to evaluate
     42    float mean,                        ///< Mean for the Gaussian
     43    float stddev,                      ///< Standard deviation for the Gaussian
     44    bool normal                        ///< Indicates whether result should be normalized
     45);
    4146
    4247/** Produce a vector of random numbers from a Gaussian distribution with
    43     the specified mean and sigma */
    44 psVector* psGaussianDev(float mean,     ///< The mean of the Gaussian
    45                         float sigma,    ///< The sigma of the Gaussian
    46                         int Npts);      ///< The size of the vector
     48 *  the specified mean and sigma
     49 * 
     50 *  @return psVector*    vector of random numbers
     51 * 
     52 */
     53psVector* psGaussianDev(
     54    float mean,                        ///< The mean of the Gaussian
     55    float sigma,                       ///< The sigma of the Gaussian
     56    int Npts                           ///< The size of the vector
     57);
    4758
    4859/** One-dimensional polynomial */
    4960typedef struct
    5061{
    51     int n;                      ///< Number of terms
    52     float *coeff;               ///< Coefficients
    53     float *coeffErr;            ///< Error in coefficients
    54     char *mask;                 ///< Coefficient mask
     62    int n;                             ///< Number of terms
     63    float *coeff;                      ///< Coefficients
     64    float *coeffErr;                   ///< Error in coefficients
     65    char *mask;                        ///< Coefficient mask
    5566}
    5667psPolynomial1D;
     
    5970typedef struct
    6071{
    61     int nX,
    62     nY;                       ///< Number of terms in x and y
    63     float **coeff;              ///< Coefficients
    64     float **coeffErr;           ///< Error in coefficients
    65     char **mask;                ///< Coefficients mask
     72    int nX;                            ///< Number of terms in x
     73    int nY;                            ///< Number of terms in y
     74    float **coeff;                     ///< Coefficients
     75    float **coeffErr;                  ///< Error in coefficients
     76    char **mask;                       ///< Coefficients mask
    6677}
    6778psPolynomial2D;
     
    7081typedef struct
    7182{
    72     int nX,
    73     nY,
    74     nZ;                       ///< Number of terms in x, y and z
    75     float ***coeff;             ///< Coefficients
    76     float ***coeffErr;          ///< Error in coefficients
    77     char ***mask;               ///< Coefficients mask
     83    int nX;                            ///< Number of terms in x
     84    int nY;                            ///< Number of terms in y
     85    int nZ;                            ///< Number of terms in z
     86    float ***coeff;                    ///< Coefficients
     87    float ***coeffErr;                 ///< Error in coefficients
     88    char ***mask;                      ///< Coefficients mask
    7889}
    7990psPolynomial3D;
     
    8293typedef struct
    8394{
    84     int nW,
    85     nX,
    86     nY,
    87     nZ;                       ///< Number of terms in w, x, y and z
    88     float ****coeff;            ///< Coefficients
    89     float ****coeffErr;         ///< Error in coefficients
    90     char ****mask;              ///< Coefficients mask
     95    int nW;                            ///< Number of terms in w
     96    int nX;                            ///< Number of terms in x
     97    int nY;                            ///< Number of terms in y
     98    int nZ;                            ///< Number of terms in z
     99    float ****coeff;                   ///< Coefficients
     100    float ****coeffErr;                ///< Error in coefficients
     101    char ****mask;                     ///< Coefficients mask
    91102}
    92103psPolynomial4D;
    93104
    94 /** Functions **************************************************************/
    95 
    96 /** Constructor */
    97 psPolynomial1D* psPolynomial1DAlloc(int n       ///< Number of terms
    98                                    );
    99 
    100 /** Constructor */
    101 psPolynomial2D* psPolynomial2DAlloc(int nX, int nY      ///< Number of terms in x and y
    102                                    );
    103 
    104 /** Constructor */
    105 psPolynomial3D* psPolynomial3DAlloc(int nX, int nY, int nZ      ///< Number of terms in x, y and z
    106                                    );
    107 
    108 /** Constructor */
    109 psPolynomial4D* psPolynomial4DAlloc(int nW, int nX, int nY, int nZ      ///< Number of terms in w, x, y and
    110                                     // z
    111                                    );
    112 
    113 /** Evaluate 1D polynomial */
    114 float psPolynomial1DEval(float x,       ///< Value at which to evaluate
    115                          const psPolynomial1D* myPoly  ///< Coefficients for the polynomial
    116                         );
    117 
    118 /** Evaluate 2D polynomial */
    119 float psPolynomial2DEval(float x,       ///< Value x at which to evaluate
    120                          float y,       ///< Value y at which to evaluate
    121                          const psPolynomial2D* myPoly  ///< Coefficients for the polynomial
    122                         );
    123 
    124 /** Evaluate 3D polynomial */
    125 float psPolynomial3DEval(float x,       ///< Value x at which to evaluate
    126                          float y,       ///< Value y at which to evaluate
    127                          float z,       ///< Value z at which to evaluate
    128                          const psPolynomial3D* myPoly  ///< Coefficients for the polynomial
    129                         );
    130 
    131 /** Evaluate 4D polynomial */
    132 float psPolynomial4DEval(float w,       ///< Value w at which to evaluate
    133                          float x,       ///< Value x at which to evaluate
    134                          float y,       ///< Value y at which to evaluate
    135                          float z,       ///< Value z at which to evaluate
    136                          const psPolynomial4D* myPoly  ///< Coefficients for the polynomial
    137                         );
     105
     106/** Allocates a psPolynomial1D structure with n terms
     107 *
     108 *  @return  psPolynomial1D*    new 1-D polynomial struct
     109 */
     110psPolynomial1D* psPolynomial1DAlloc(
     111    int n                              ///< Number of terms
     112);
     113
     114/** Allocates a 2-D polynomial structure
     115 *
     116 *  @return  psPolynomial2D*    new 2-D polynomial struct
     117 */
     118psPolynomial2D* psPolynomial2DAlloc(
     119    int nX,                            ///< Number of terms in x
     120    int nY                             ///< Number of terms in y
     121);
     122
     123/** Allocates a 3-D polynomial structure
     124 *
     125 *  @return  psPolynomial3D*    new 3-D polynomial struct
     126 */
     127psPolynomial3D* psPolynomial3DAlloc(
     128    int nX,                            ///< Number of terms in x
     129    int nY,                            ///< Number of terms in y
     130    int nZ                             ///< Number of terms in z
     131);
     132
     133/** Allocates a 4-D polynomial structure
     134 *
     135 *  @return  psPolynomial4D*    new 4-D polynomial struct
     136 */
     137psPolynomial4D* psPolynomial4DAlloc(
     138    int nW,                            ///< Number of terms in w
     139    int nX,                            ///< Number of terms in x
     140    int nY,                            ///< Number of terms in y
     141    int nZ                             ///< Number of terms in z
     142);
     143
     144/** Evaluates a 1-D polynomial at specific coordinates.
     145 *
     146 *  @return float    result of polynomial at given location
     147 */
     148float psPolynomial1DEval(
     149    float x,                           ///< location at which to evaluate
     150    const psPolynomial1D* myPoly       ///< Coefficients for the polynomial
     151);
     152
     153/** Evaluates a 2-D polynomial at specific coordinates.
     154 *
     155 *  @return float    result of polynomial at given location
     156 */
     157float psPolynomial2DEval(
     158    float x,                           ///< x location at which to evaluate
     159    float y,                           ///< y location at which to evaluate
     160    const psPolynomial2D* myPoly       ///< Coefficients for the polynomial
     161);
     162
     163/** Evaluates a 3-D polynomial at specific coordinates.
     164 *
     165 *  @return float    result of polynomial at given location
     166 */
     167float psPolynomial3DEval(
     168    float x,                           ///< x location at which to evaluate
     169    float y,                           ///< y location at which to evaluate
     170    float z,                           ///< z location at which to evaluate
     171    const psPolynomial3D* myPoly       ///< Coefficients for the polynomial
     172);
     173
     174/** Evaluates a 4-D polynomial at specific coordinates.
     175 *
     176 *  @return float    result of polynomial at given location
     177 */
     178float psPolynomial4DEval(
     179    float w,                           ///< w location at which to evaluate
     180    float x,                           ///< x location at which to evaluate
     181    float y,                           ///< y location at which to evaluate
     182    float z,                           ///< z location at which to evaluate
     183    const psPolynomial4D* myPoly       ///< Coefficients for the polynomial
     184);
    138185
    139186/*****************************************************************************/
     
    144191typedef struct
    145192{
    146     int n;                      ///< Number of terms
    147     double *coeff;              ///< Coefficients
    148     double *coeffErr;           ///< Error in coefficients
    149     char *mask;                 ///< Coefficient mask
     193    int n;                             ///< Number of terms
     194    double *coeff;                     ///< Coefficients
     195    double *coeffErr;                  ///< Error in coefficients
     196    char *mask;                        ///< Coefficient mask
    150197}
    151198psDPolynomial1D;
     
    154201typedef struct
    155202{
    156     int nX,
    157     nY;                       ///< Number of terms in x and y
    158     double **coeff;             ///< Coefficients
    159     double **coeffErr;          ///< Error in coefficients
    160     char **mask;                ///< Coefficients mask
     203    int nX;                            ///< Number of terms in x
     204    int nY;                            ///< Number of terms in y
     205    double **coeff;                    ///< Coefficients
     206    double **coeffErr;                 ///< Error in coefficients
     207    char **mask;                       ///< Coefficients mask
    161208}
    162209psDPolynomial2D;
     
    165212typedef struct
    166213{
    167     int nX,
    168     nY,
    169     nZ;                       ///< Number of terms in x, y and z
    170     double ***coeff;            ///< Coefficients
    171     double ***coeffErr;         ///< Error in coefficients
    172     char ***mask;               ///< Coefficient mask
     214    int nX;                            ///< Number of terms in x
     215    int nY;                            ///< Number of terms in y
     216    int nZ;                            ///< Number of terms in z
     217    double ***coeff;                   ///< Coefficients
     218    double ***coeffErr;                ///< Error in coefficients
     219    char ***mask;                      ///< Coefficient mask
    173220}
    174221psDPolynomial3D;
     
    177224typedef struct
    178225{
    179     int nW,
    180     nX,
    181     nY,
    182     nZ;                       ///< Number of terms in w, x, y and z
    183     double ****coeff;           ///< Coefficients
    184     double ****coeffErr;        ///< Error in coefficients
    185     char ****mask;              ///< Coefficients mask
     226    int nW;                            ///< Number of terms in w
     227    int nX;                            ///< Number of terms in x
     228    int nY;                            ///< Number of terms in y
     229    int nZ;                            ///< Number of terms in z
     230    double ****coeff;                  ///< Coefficients
     231    double ****coeffErr;               ///< Error in coefficients
     232    char ****mask;                     ///< Coefficients mask
    186233}
    187234psDPolynomial4D;
    188235
    189 /** Constructor */
    190 psDPolynomial1D* psDPolynomial1DAlloc(int n     ///< Number of terms
    191                                      );
    192 
    193 /** Constructor */
    194 psDPolynomial2D* psDPolynomial2DAlloc(int nX, int nY    ///< Number of terms in x and y
    195                                      );
    196 
    197 /** Constructor */
    198 psDPolynomial3D* psDPolynomial3DAlloc(int nX, int nY, int nZ    ///< Number of terms in x, y and z
    199                                      );
    200 
    201 /** Constructor */
    202 psDPolynomial4D* psDPolynomial4DAlloc(int nW, int nX, int nY, int nZ    ///< Number of terms in w, x, y and
    203                                       // z
    204                                      );
    205 
    206 /** Evaluate 1D polynomial (double precision) */
    207 double psDPolynomial1DEval(double x,    ///< Value at which to evaluate
    208                            const psDPolynomial1D* myPoly       ///< Coefficients for the polynomial
    209                           );
    210 
    211 /** Evaluate 2D polynomial (double precision) */
    212 double psDPolynomial2DEval(double x,    ///< Value x at which to evaluate
    213                            double y,    ///< Value y at which to evaluate
    214                            const psDPolynomial2D* myPoly       ///< Coefficients for the polynomial
    215                           );
    216 
    217 /** Evaluate 3D polynomial (double precision) */
    218 double psDPolynomial3DEval(double x,    ///< Value x at which to evaluate
    219                            double y,    ///< Value y at which to evaluate
    220                            double z,    ///< Value z at which to evaluate
    221                            const psDPolynomial3D* myPoly       ///< Coefficients for the polynomial
    222                           );
    223 
    224 /** Evaluate 4D polynomial (double precision) */
    225 double psDPolynomial4DEval(double w,    ///< Value w at which to evaluate
    226                            double x,    ///< Value x at which to evaluate
    227                            double y,    ///< Value y at which to evaluate
    228                            double z,    ///< Value z at which to evaluate
    229                            const psDPolynomial4D* myPoly       ///< Coefficients for the polynomial
    230                           );
     236/** Allocates a double-precision 1-D polynomial structure with n terms
     237 *
     238 *  @return  psPolynomial1D*    new double-precision 1-D polynomial struct
     239 */
     240psDPolynomial1D* psDPolynomial1DAlloc(
     241    int n                              ///< Number of terms
     242);
     243
     244/** Allocates a double-precision 2-D polynomial structure
     245 *
     246 *  @return  psPolynomial2D*    new double-precision 2-D polynomial struct
     247 */
     248psDPolynomial2D* psDPolynomial2DAlloc(
     249    int nX,                            ///< Number of terms in x
     250    int nY                             ///< Number of terms in y
     251);
     252
     253/** Allocates a double-precision 3-D polynomial structure
     254 *
     255 *  @return  psPolynomial3D*    new double-precision 3-D polynomial struct
     256 */
     257psDPolynomial3D* psDPolynomial3DAlloc(
     258    int nX,                            ///< Number of terms in x
     259    int nY,                            ///< Number of terms in y
     260    int nZ                             ///< Number of terms in z
     261);
     262
     263/** Allocates a double-precision 4-D polynomial structure
     264 *
     265 *  @return  psPolynomial4D*    new double-precision 4-D polynomial struct
     266 */
     267psDPolynomial4D* psDPolynomial4DAlloc(
     268    int nW,                            ///< Number of terms in w
     269    int nX,                            ///< Number of terms in x
     270    int nY,                            ///< Number of terms in y
     271    int nZ                             ///< Number of terms in z
     272);
     273
     274/** Evaluates a double-precision 1-D polynomial at specific coordinates.
     275 *
     276 *  @return float    result of polynomial at given location
     277 */
     278double psDPolynomial1DEval(
     279    double x,                          ///< Value at which to evaluate
     280    const psDPolynomial1D* myPoly      ///< Coefficients for the polynomial
     281);
     282
     283/** Evaluates a double-precision 2-D polynomial at specific coordinates.
     284 *
     285 *  @return float    result of polynomial at given location
     286 */
     287double psDPolynomial2DEval(
     288    double x,                           ///< Value x at which to evaluate
     289    double y,                           ///< Value y at which to evaluate
     290    const psDPolynomial2D* myPoly       ///< Coefficients for the polynomial
     291);
     292
     293/** Evaluates a double-precision 3-D polynomial at specific coordinates.
     294 *
     295 *  @return float    result of polynomial at given location
     296 */
     297double psDPolynomial3DEval(
     298    double x,                          ///< Value x at which to evaluate
     299    double y,                          ///< Value y at which to evaluate
     300    double z,                          ///< Value z at which to evaluate
     301    const psDPolynomial3D* myPoly      ///< Coefficients for the polynomial
     302);
     303
     304/** Evaluates a double-precision 4-D polynomial at specific coordinates.
     305 *
     306 *  @return float    result of polynomial at given location
     307 */
     308double psDPolynomial4DEval(
     309    double w,                          ///< Value w at which to evaluate
     310    double x,                          ///< Value x at which to evaluate
     311    double y,                          ///< Value y at which to evaluate
     312    double z,                          ///< Value z at which to evaluate
     313    const psDPolynomial4D* myPoly      ///< Coefficients for the polynomial
     314);
    231315
    232316/* \} */// End of MathGroup Functions
  • trunk/psLib/src/dataManip/psMatrix.h

    r1441 r1464  
    2222 *  @author Ross Harman, MHPCC
    2323 *
    24  *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
    25  *  @date $Date: 2004-08-09 23:40:55 $
     24 *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
     25 *  @date $Date: 2004-08-11 02:35:58 $
    2626 *
    2727 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4343 *  @return  psImage* : Pointer to LU decomposed psImage.
    4444 */
    45 psImage* psMatrixLUD(psImage* outImage,        ///< Image to return, or NULL.
    46                      psVector* outPerm,        ///< Output permutation vector used by psMatrixLUSolve.
    47                      psImage* inImage  ///< Image to decompose.
    48                     );
     45psImage* psMatrixLUD(
     46    psImage* outImage,                 ///< Image to return, or NULL.
     47    psVector* outPerm,                 ///< Output permutation vector used by psMatrixLUSolve.
     48    psImage* inImage                   ///< Image to decompose.
     49);
    4950
    5051/** LU Solution of psImage matrix.
     
    5758 *  @return  psVector* : Pointer to psVector solution of matrix equation.
    5859 */
    59 psVector* psMatrixLUSolve(psVector* outVector, ///< Vector to return, or NULL.
    60                           const psImage* luImage,      ///< LU-decomposed matrix.
    61                           const psVector* inVector,    ///< Vector right-hand-side of equation.
    62                           const psVector* inPerm       ///< Permutation vector resulting from psMatrixLUD
    63                           // function.
    64                          );
     60psVector* psMatrixLUSolve(
     61    psVector* outVector,               ///< Vector to return, or NULL.
     62    const psImage* luImage,            ///< LU-decomposed matrix.
     63    const psVector* inVector,          ///< Vector right-hand-side of equation.
     64    const psVector* inPerm             ///< Permutation vector resulting from psMatrixLUD function.
     65);
    6566
    6667/** Invert psImage matrix.
     
    7374 *  @return  psImage* : Pointer to inverted psImage.
    7475 */
    75 psImage* psMatrixInvert(psImage* outImage,     ///< Image to return, or NULL for in-place substitution.
    76                         const psImage* inImage,        ///< Image to be inverted
    77                         float *restrict det     ///< Determinant to return, or NULL
    78                        );
     76psImage* psMatrixInvert(
     77    psImage* outImage,                 ///< Image to return, or NULL for in-place substitution.
     78    const psImage* inImage,            ///< Image to be inverted
     79    float *restrict det                ///< Determinant to return, or NULL
     80);
    7981
    8082/** Calculate psImage matrix determinant.
     
    8688 *  @return  float: Determinant from psImage.
    8789 */
    88 float *psMatrixDeterminant(const psImage* restrict inMatrix    ///< Image used to calculate determinant.
    89                           );
     90float *psMatrixDeterminant(
     91    const psImage* restrict inMatrix   ///< Image used to calculate determinant.
     92);
    9093
    9194/** Performs psImage matrix multiplication.
     
    98101 *  @return  psImage* : Pointer to resulting psImage.
    99102 */
    100 psImage* psMatrixMultiply(psImage* outImage,   ///< Matrix to return, or NULL.
    101                           psImage* inImage1,   ///< First input image.
    102                           psImage* inImage2    ///< Second input image.
    103                          );
     103psImage* psMatrixMultiply(
     104    psImage* outImage,                 ///< Matrix to return, or NULL.
     105    psImage* inImage1,                 ///< First input image.
     106    psImage* inImage2                  ///< Second input image.
     107);
    104108
    105109/** Transpose matrix.
     
    112116 *  @return  psImage* : Pointer to transposed psImage.
    113117 */
    114 psImage* psMatrixTranspose(psImage* outImage,  ///< Image to return, or NULL
    115                            const psImage* inImage      ///< Image to transpose
    116                           );
     118psImage* psMatrixTranspose(
     119    psImage* outImage,                 ///< Image to return, or NULL
     120    const psImage* inImage             ///< Image to transpose
     121);
    117122
    118123/** Calculate matrix eigenvectors.
     
    124129 *  @return  psImage* : Pointer to matrix of Eigenvectors.
    125130 */
    126 psImage* psMatrixEigenvectors(psImage* outImage,       ///< Eigenvectors to return, or NULL.
    127                               psImage* inImage ///< Input image.
    128                              );
     131psImage* psMatrixEigenvectors(
     132    psImage* outImage,                 ///< Eigenvectors to return, or NULL.
     133    psImage* inImage                   ///< Input image.
     134);
    129135
    130136/** Convert matrix to vector.
     
    137143 *  @return  psVector* : Pointer to psVector.
    138144 */
    139 psVector* psMatrixToVector(psVector* outVector,        ///< Vector to return, or NULL.
    140                            psImage* inImage    ///< Image to convert.
    141                           );
     145psVector* psMatrixToVector(
     146    psVector* outVector,               ///< Vector to return, or NULL.
     147    psImage* inImage                   ///< Image to convert.
     148);
    142149
    143150/** Convert vector to matrix.
     
    150157 *  @return  psVector* : Pointer to psIamge.
    151158 */
    152 psImage* psVectorToMatrix(psImage* outImage,   ///< Matrix to return, or NULL.
    153                           psVector* inVector   ///< Vector to convert.
    154                          );
     159psImage* psVectorToMatrix(
     160    psImage* outImage,                 ///< Matrix to return, or NULL.
     161    psVector* inVector                 ///< Vector to convert.
     162);
    155163
    156164/// @}
  • trunk/psLib/src/dataManip/psMatrixVectorArithmetic.h

    r1441 r1464  
    3030 *  @author Ross Harman, MHPCC
    3131 *
    32  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    33  *  @date $Date: 2004-08-09 23:40:55 $
     32 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     33 *  @date $Date: 2004-08-11 02:37:55 $
    3434 *
    3535 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    5555 *  @return  psType* : Pointer to either psImage or psVector.
    5656 */
    57 psType* psBinaryOp(void *out,   // / Output type, either psImage or psVector.
    58                    void *in1,   // / First input, either psImage or psVector.
    59                    char *op,    // / Operator.
    60                    void *in2    // / Second input, either psImage or psVector.
    61                   );
     57psType* psBinaryOp(
     58    void *out,                         ///< Output type, either psImage or psVector.
     59    void *in1,                         ///< First input, either psImage or psVector.
     60    char *op,                          ///< Operator.
     61    void *in2                          ///< Second input, either psImage or psVector.
     62);
    6263
    6364/** Perform simple unary arithmetic with images or vectors
     
    7778 *  @return  psType* : Pointer to either psImage or psVector.
    7879 */
    79 psType* psUnaryOp(void *out,    // / Output type, either psImage or psVector.
    80                   void *in,     // / Input, either psImage or psVector.
    81                   char *op      // / Operator.
    82                  );
     80psType* psUnaryOp(
     81    void *out,                         ///< Output type, either psImage or psVector.
     82    void *in,                          ///< Input, either psImage or psVector.
     83    char *op                           ///< Operator.
     84);
    8385
    8486/// @}
  • trunk/psLib/src/math/psMatrix.h

    r1441 r1464  
    2222 *  @author Ross Harman, MHPCC
    2323 *
    24  *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
    25  *  @date $Date: 2004-08-09 23:40:55 $
     24 *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
     25 *  @date $Date: 2004-08-11 02:35:58 $
    2626 *
    2727 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4343 *  @return  psImage* : Pointer to LU decomposed psImage.
    4444 */
    45 psImage* psMatrixLUD(psImage* outImage,        ///< Image to return, or NULL.
    46                      psVector* outPerm,        ///< Output permutation vector used by psMatrixLUSolve.
    47                      psImage* inImage  ///< Image to decompose.
    48                     );
     45psImage* psMatrixLUD(
     46    psImage* outImage,                 ///< Image to return, or NULL.
     47    psVector* outPerm,                 ///< Output permutation vector used by psMatrixLUSolve.
     48    psImage* inImage                   ///< Image to decompose.
     49);
    4950
    5051/** LU Solution of psImage matrix.
     
    5758 *  @return  psVector* : Pointer to psVector solution of matrix equation.
    5859 */
    59 psVector* psMatrixLUSolve(psVector* outVector, ///< Vector to return, or NULL.
    60                           const psImage* luImage,      ///< LU-decomposed matrix.
    61                           const psVector* inVector,    ///< Vector right-hand-side of equation.
    62                           const psVector* inPerm       ///< Permutation vector resulting from psMatrixLUD
    63                           // function.
    64                          );
     60psVector* psMatrixLUSolve(
     61    psVector* outVector,               ///< Vector to return, or NULL.
     62    const psImage* luImage,            ///< LU-decomposed matrix.
     63    const psVector* inVector,          ///< Vector right-hand-side of equation.
     64    const psVector* inPerm             ///< Permutation vector resulting from psMatrixLUD function.
     65);
    6566
    6667/** Invert psImage matrix.
     
    7374 *  @return  psImage* : Pointer to inverted psImage.
    7475 */
    75 psImage* psMatrixInvert(psImage* outImage,     ///< Image to return, or NULL for in-place substitution.
    76                         const psImage* inImage,        ///< Image to be inverted
    77                         float *restrict det     ///< Determinant to return, or NULL
    78                        );
     76psImage* psMatrixInvert(
     77    psImage* outImage,                 ///< Image to return, or NULL for in-place substitution.
     78    const psImage* inImage,            ///< Image to be inverted
     79    float *restrict det                ///< Determinant to return, or NULL
     80);
    7981
    8082/** Calculate psImage matrix determinant.
     
    8688 *  @return  float: Determinant from psImage.
    8789 */
    88 float *psMatrixDeterminant(const psImage* restrict inMatrix    ///< Image used to calculate determinant.
    89                           );
     90float *psMatrixDeterminant(
     91    const psImage* restrict inMatrix   ///< Image used to calculate determinant.
     92);
    9093
    9194/** Performs psImage matrix multiplication.
     
    98101 *  @return  psImage* : Pointer to resulting psImage.
    99102 */
    100 psImage* psMatrixMultiply(psImage* outImage,   ///< Matrix to return, or NULL.
    101                           psImage* inImage1,   ///< First input image.
    102                           psImage* inImage2    ///< Second input image.
    103                          );
     103psImage* psMatrixMultiply(
     104    psImage* outImage,                 ///< Matrix to return, or NULL.
     105    psImage* inImage1,                 ///< First input image.
     106    psImage* inImage2                  ///< Second input image.
     107);
    104108
    105109/** Transpose matrix.
     
    112116 *  @return  psImage* : Pointer to transposed psImage.
    113117 */
    114 psImage* psMatrixTranspose(psImage* outImage,  ///< Image to return, or NULL
    115                            const psImage* inImage      ///< Image to transpose
    116                           );
     118psImage* psMatrixTranspose(
     119    psImage* outImage,                 ///< Image to return, or NULL
     120    const psImage* inImage             ///< Image to transpose
     121);
    117122
    118123/** Calculate matrix eigenvectors.
     
    124129 *  @return  psImage* : Pointer to matrix of Eigenvectors.
    125130 */
    126 psImage* psMatrixEigenvectors(psImage* outImage,       ///< Eigenvectors to return, or NULL.
    127                               psImage* inImage ///< Input image.
    128                              );
     131psImage* psMatrixEigenvectors(
     132    psImage* outImage,                 ///< Eigenvectors to return, or NULL.
     133    psImage* inImage                   ///< Input image.
     134);
    129135
    130136/** Convert matrix to vector.
     
    137143 *  @return  psVector* : Pointer to psVector.
    138144 */
    139 psVector* psMatrixToVector(psVector* outVector,        ///< Vector to return, or NULL.
    140                            psImage* inImage    ///< Image to convert.
    141                           );
     145psVector* psMatrixToVector(
     146    psVector* outVector,               ///< Vector to return, or NULL.
     147    psImage* inImage                   ///< Image to convert.
     148);
    142149
    143150/** Convert vector to matrix.
     
    150157 *  @return  psVector* : Pointer to psIamge.
    151158 */
    152 psImage* psVectorToMatrix(psImage* outImage,   ///< Matrix to return, or NULL.
    153                           psVector* inVector   ///< Vector to convert.
    154                          );
     159psImage* psVectorToMatrix(
     160    psImage* outImage,                 ///< Matrix to return, or NULL.
     161    psVector* inVector                 ///< Vector to convert.
     162);
    155163
    156164/// @}
  • trunk/psLib/src/math/psPolynomial.h

    r1441 r1464  
    1313*  @author George Gusciora, MHPCC
    1414*
    15 *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
    16 *  @date $Date: 2004-08-09 23:40:55 $
     15*  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
     16*  @date $Date: 2004-08-11 02:35:58 $
    1717*
    1818*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3131
    3232/** Evaluate a non-normalized Gaussian with the given mean and sigma at the
    33     given coordianate.  Note that this is not a Gaussian deviate.  The
    34     evaluated Gaussian is: \f[ exp(-\frac{(x-mean)^2}{2\sigma^2}) \f] */
    35 
    36 float psGaussian(float x,       ///< Value at which to evaluate
    37                  float mean,    ///< Mean for the Gaussian
    38                  float stddev,  ///< Standard deviation for the Gaussian
    39                  bool normal    ///< Indicates whether result should be normalized
    40                 );
     33 *  given coordianate. 
     34 *
     35 *  Note that this is not a Gaussian deviate.  The evaluated Gaussian is:
     36 *        \f[ exp(-\frac{(x-mean)^2}{2\sigma^2}) \f]
     37 *
     38 *  @return float      value on the gaussian curve given the input parameters
     39 */
     40float psGaussian(
     41    float x,                           ///< Value at which to evaluate
     42    float mean,                        ///< Mean for the Gaussian
     43    float stddev,                      ///< Standard deviation for the Gaussian
     44    bool normal                        ///< Indicates whether result should be normalized
     45);
    4146
    4247/** Produce a vector of random numbers from a Gaussian distribution with
    43     the specified mean and sigma */
    44 psVector* psGaussianDev(float mean,     ///< The mean of the Gaussian
    45                         float sigma,    ///< The sigma of the Gaussian
    46                         int Npts);      ///< The size of the vector
     48 *  the specified mean and sigma
     49 * 
     50 *  @return psVector*    vector of random numbers
     51 * 
     52 */
     53psVector* psGaussianDev(
     54    float mean,                        ///< The mean of the Gaussian
     55    float sigma,                       ///< The sigma of the Gaussian
     56    int Npts                           ///< The size of the vector
     57);
    4758
    4859/** One-dimensional polynomial */
    4960typedef struct
    5061{
    51     int n;                      ///< Number of terms
    52     float *coeff;               ///< Coefficients
    53     float *coeffErr;            ///< Error in coefficients
    54     char *mask;                 ///< Coefficient mask
     62    int n;                             ///< Number of terms
     63    float *coeff;                      ///< Coefficients
     64    float *coeffErr;                   ///< Error in coefficients
     65    char *mask;                        ///< Coefficient mask
    5566}
    5667psPolynomial1D;
     
    5970typedef struct
    6071{
    61     int nX,
    62     nY;                       ///< Number of terms in x and y
    63     float **coeff;              ///< Coefficients
    64     float **coeffErr;           ///< Error in coefficients
    65     char **mask;                ///< Coefficients mask
     72    int nX;                            ///< Number of terms in x
     73    int nY;                            ///< Number of terms in y
     74    float **coeff;                     ///< Coefficients
     75    float **coeffErr;                  ///< Error in coefficients
     76    char **mask;                       ///< Coefficients mask
    6677}
    6778psPolynomial2D;
     
    7081typedef struct
    7182{
    72     int nX,
    73     nY,
    74     nZ;                       ///< Number of terms in x, y and z
    75     float ***coeff;             ///< Coefficients
    76     float ***coeffErr;          ///< Error in coefficients
    77     char ***mask;               ///< Coefficients mask
     83    int nX;                            ///< Number of terms in x
     84    int nY;                            ///< Number of terms in y
     85    int nZ;                            ///< Number of terms in z
     86    float ***coeff;                    ///< Coefficients
     87    float ***coeffErr;                 ///< Error in coefficients
     88    char ***mask;                      ///< Coefficients mask
    7889}
    7990psPolynomial3D;
     
    8293typedef struct
    8394{
    84     int nW,
    85     nX,
    86     nY,
    87     nZ;                       ///< Number of terms in w, x, y and z
    88     float ****coeff;            ///< Coefficients
    89     float ****coeffErr;         ///< Error in coefficients
    90     char ****mask;              ///< Coefficients mask
     95    int nW;                            ///< Number of terms in w
     96    int nX;                            ///< Number of terms in x
     97    int nY;                            ///< Number of terms in y
     98    int nZ;                            ///< Number of terms in z
     99    float ****coeff;                   ///< Coefficients
     100    float ****coeffErr;                ///< Error in coefficients
     101    char ****mask;                     ///< Coefficients mask
    91102}
    92103psPolynomial4D;
    93104
    94 /** Functions **************************************************************/
    95 
    96 /** Constructor */
    97 psPolynomial1D* psPolynomial1DAlloc(int n       ///< Number of terms
    98                                    );
    99 
    100 /** Constructor */
    101 psPolynomial2D* psPolynomial2DAlloc(int nX, int nY      ///< Number of terms in x and y
    102                                    );
    103 
    104 /** Constructor */
    105 psPolynomial3D* psPolynomial3DAlloc(int nX, int nY, int nZ      ///< Number of terms in x, y and z
    106                                    );
    107 
    108 /** Constructor */
    109 psPolynomial4D* psPolynomial4DAlloc(int nW, int nX, int nY, int nZ      ///< Number of terms in w, x, y and
    110                                     // z
    111                                    );
    112 
    113 /** Evaluate 1D polynomial */
    114 float psPolynomial1DEval(float x,       ///< Value at which to evaluate
    115                          const psPolynomial1D* myPoly  ///< Coefficients for the polynomial
    116                         );
    117 
    118 /** Evaluate 2D polynomial */
    119 float psPolynomial2DEval(float x,       ///< Value x at which to evaluate
    120                          float y,       ///< Value y at which to evaluate
    121                          const psPolynomial2D* myPoly  ///< Coefficients for the polynomial
    122                         );
    123 
    124 /** Evaluate 3D polynomial */
    125 float psPolynomial3DEval(float x,       ///< Value x at which to evaluate
    126                          float y,       ///< Value y at which to evaluate
    127                          float z,       ///< Value z at which to evaluate
    128                          const psPolynomial3D* myPoly  ///< Coefficients for the polynomial
    129                         );
    130 
    131 /** Evaluate 4D polynomial */
    132 float psPolynomial4DEval(float w,       ///< Value w at which to evaluate
    133                          float x,       ///< Value x at which to evaluate
    134                          float y,       ///< Value y at which to evaluate
    135                          float z,       ///< Value z at which to evaluate
    136                          const psPolynomial4D* myPoly  ///< Coefficients for the polynomial
    137                         );
     105
     106/** Allocates a psPolynomial1D structure with n terms
     107 *
     108 *  @return  psPolynomial1D*    new 1-D polynomial struct
     109 */
     110psPolynomial1D* psPolynomial1DAlloc(
     111    int n                              ///< Number of terms
     112);
     113
     114/** Allocates a 2-D polynomial structure
     115 *
     116 *  @return  psPolynomial2D*    new 2-D polynomial struct
     117 */
     118psPolynomial2D* psPolynomial2DAlloc(
     119    int nX,                            ///< Number of terms in x
     120    int nY                             ///< Number of terms in y
     121);
     122
     123/** Allocates a 3-D polynomial structure
     124 *
     125 *  @return  psPolynomial3D*    new 3-D polynomial struct
     126 */
     127psPolynomial3D* psPolynomial3DAlloc(
     128    int nX,                            ///< Number of terms in x
     129    int nY,                            ///< Number of terms in y
     130    int nZ                             ///< Number of terms in z
     131);
     132
     133/** Allocates a 4-D polynomial structure
     134 *
     135 *  @return  psPolynomial4D*    new 4-D polynomial struct
     136 */
     137psPolynomial4D* psPolynomial4DAlloc(
     138    int nW,                            ///< Number of terms in w
     139    int nX,                            ///< Number of terms in x
     140    int nY,                            ///< Number of terms in y
     141    int nZ                             ///< Number of terms in z
     142);
     143
     144/** Evaluates a 1-D polynomial at specific coordinates.
     145 *
     146 *  @return float    result of polynomial at given location
     147 */
     148float psPolynomial1DEval(
     149    float x,                           ///< location at which to evaluate
     150    const psPolynomial1D* myPoly       ///< Coefficients for the polynomial
     151);
     152
     153/** Evaluates a 2-D polynomial at specific coordinates.
     154 *
     155 *  @return float    result of polynomial at given location
     156 */
     157float psPolynomial2DEval(
     158    float x,                           ///< x location at which to evaluate
     159    float y,                           ///< y location at which to evaluate
     160    const psPolynomial2D* myPoly       ///< Coefficients for the polynomial
     161);
     162
     163/** Evaluates a 3-D polynomial at specific coordinates.
     164 *
     165 *  @return float    result of polynomial at given location
     166 */
     167float psPolynomial3DEval(
     168    float x,                           ///< x location at which to evaluate
     169    float y,                           ///< y location at which to evaluate
     170    float z,                           ///< z location at which to evaluate
     171    const psPolynomial3D* myPoly       ///< Coefficients for the polynomial
     172);
     173
     174/** Evaluates a 4-D polynomial at specific coordinates.
     175 *
     176 *  @return float    result of polynomial at given location
     177 */
     178float psPolynomial4DEval(
     179    float w,                           ///< w location at which to evaluate
     180    float x,                           ///< x location at which to evaluate
     181    float y,                           ///< y location at which to evaluate
     182    float z,                           ///< z location at which to evaluate
     183    const psPolynomial4D* myPoly       ///< Coefficients for the polynomial
     184);
    138185
    139186/*****************************************************************************/
     
    144191typedef struct
    145192{
    146     int n;                      ///< Number of terms
    147     double *coeff;              ///< Coefficients
    148     double *coeffErr;           ///< Error in coefficients
    149     char *mask;                 ///< Coefficient mask
     193    int n;                             ///< Number of terms
     194    double *coeff;                     ///< Coefficients
     195    double *coeffErr;                  ///< Error in coefficients
     196    char *mask;                        ///< Coefficient mask
    150197}
    151198psDPolynomial1D;
     
    154201typedef struct
    155202{
    156     int nX,
    157     nY;                       ///< Number of terms in x and y
    158     double **coeff;             ///< Coefficients
    159     double **coeffErr;          ///< Error in coefficients
    160     char **mask;                ///< Coefficients mask
     203    int nX;                            ///< Number of terms in x
     204    int nY;                            ///< Number of terms in y
     205    double **coeff;                    ///< Coefficients
     206    double **coeffErr;                 ///< Error in coefficients
     207    char **mask;                       ///< Coefficients mask
    161208}
    162209psDPolynomial2D;
     
    165212typedef struct
    166213{
    167     int nX,
    168     nY,
    169     nZ;                       ///< Number of terms in x, y and z
    170     double ***coeff;            ///< Coefficients
    171     double ***coeffErr;         ///< Error in coefficients
    172     char ***mask;               ///< Coefficient mask
     214    int nX;                            ///< Number of terms in x
     215    int nY;                            ///< Number of terms in y
     216    int nZ;                            ///< Number of terms in z
     217    double ***coeff;                   ///< Coefficients
     218    double ***coeffErr;                ///< Error in coefficients
     219    char ***mask;                      ///< Coefficient mask
    173220}
    174221psDPolynomial3D;
     
    177224typedef struct
    178225{
    179     int nW,
    180     nX,
    181     nY,
    182     nZ;                       ///< Number of terms in w, x, y and z
    183     double ****coeff;           ///< Coefficients
    184     double ****coeffErr;        ///< Error in coefficients
    185     char ****mask;              ///< Coefficients mask
     226    int nW;                            ///< Number of terms in w
     227    int nX;                            ///< Number of terms in x
     228    int nY;                            ///< Number of terms in y
     229    int nZ;                            ///< Number of terms in z
     230    double ****coeff;                  ///< Coefficients
     231    double ****coeffErr;               ///< Error in coefficients
     232    char ****mask;                     ///< Coefficients mask
    186233}
    187234psDPolynomial4D;
    188235
    189 /** Constructor */
    190 psDPolynomial1D* psDPolynomial1DAlloc(int n     ///< Number of terms
    191                                      );
    192 
    193 /** Constructor */
    194 psDPolynomial2D* psDPolynomial2DAlloc(int nX, int nY    ///< Number of terms in x and y
    195                                      );
    196 
    197 /** Constructor */
    198 psDPolynomial3D* psDPolynomial3DAlloc(int nX, int nY, int nZ    ///< Number of terms in x, y and z
    199                                      );
    200 
    201 /** Constructor */
    202 psDPolynomial4D* psDPolynomial4DAlloc(int nW, int nX, int nY, int nZ    ///< Number of terms in w, x, y and
    203                                       // z
    204                                      );
    205 
    206 /** Evaluate 1D polynomial (double precision) */
    207 double psDPolynomial1DEval(double x,    ///< Value at which to evaluate
    208                            const psDPolynomial1D* myPoly       ///< Coefficients for the polynomial
    209                           );
    210 
    211 /** Evaluate 2D polynomial (double precision) */
    212 double psDPolynomial2DEval(double x,    ///< Value x at which to evaluate
    213                            double y,    ///< Value y at which to evaluate
    214                            const psDPolynomial2D* myPoly       ///< Coefficients for the polynomial
    215                           );
    216 
    217 /** Evaluate 3D polynomial (double precision) */
    218 double psDPolynomial3DEval(double x,    ///< Value x at which to evaluate
    219                            double y,    ///< Value y at which to evaluate
    220                            double z,    ///< Value z at which to evaluate
    221                            const psDPolynomial3D* myPoly       ///< Coefficients for the polynomial
    222                           );
    223 
    224 /** Evaluate 4D polynomial (double precision) */
    225 double psDPolynomial4DEval(double w,    ///< Value w at which to evaluate
    226                            double x,    ///< Value x at which to evaluate
    227                            double y,    ///< Value y at which to evaluate
    228                            double z,    ///< Value z at which to evaluate
    229                            const psDPolynomial4D* myPoly       ///< Coefficients for the polynomial
    230                           );
     236/** Allocates a double-precision 1-D polynomial structure with n terms
     237 *
     238 *  @return  psPolynomial1D*    new double-precision 1-D polynomial struct
     239 */
     240psDPolynomial1D* psDPolynomial1DAlloc(
     241    int n                              ///< Number of terms
     242);
     243
     244/** Allocates a double-precision 2-D polynomial structure
     245 *
     246 *  @return  psPolynomial2D*    new double-precision 2-D polynomial struct
     247 */
     248psDPolynomial2D* psDPolynomial2DAlloc(
     249    int nX,                            ///< Number of terms in x
     250    int nY                             ///< Number of terms in y
     251);
     252
     253/** Allocates a double-precision 3-D polynomial structure
     254 *
     255 *  @return  psPolynomial3D*    new double-precision 3-D polynomial struct
     256 */
     257psDPolynomial3D* psDPolynomial3DAlloc(
     258    int nX,                            ///< Number of terms in x
     259    int nY,                            ///< Number of terms in y
     260    int nZ                             ///< Number of terms in z
     261);
     262
     263/** Allocates a double-precision 4-D polynomial structure
     264 *
     265 *  @return  psPolynomial4D*    new double-precision 4-D polynomial struct
     266 */
     267psDPolynomial4D* psDPolynomial4DAlloc(
     268    int nW,                            ///< Number of terms in w
     269    int nX,                            ///< Number of terms in x
     270    int nY,                            ///< Number of terms in y
     271    int nZ                             ///< Number of terms in z
     272);
     273
     274/** Evaluates a double-precision 1-D polynomial at specific coordinates.
     275 *
     276 *  @return float    result of polynomial at given location
     277 */
     278double psDPolynomial1DEval(
     279    double x,                          ///< Value at which to evaluate
     280    const psDPolynomial1D* myPoly      ///< Coefficients for the polynomial
     281);
     282
     283/** Evaluates a double-precision 2-D polynomial at specific coordinates.
     284 *
     285 *  @return float    result of polynomial at given location
     286 */
     287double psDPolynomial2DEval(
     288    double x,                           ///< Value x at which to evaluate
     289    double y,                           ///< Value y at which to evaluate
     290    const psDPolynomial2D* myPoly       ///< Coefficients for the polynomial
     291);
     292
     293/** Evaluates a double-precision 3-D polynomial at specific coordinates.
     294 *
     295 *  @return float    result of polynomial at given location
     296 */
     297double psDPolynomial3DEval(
     298    double x,                          ///< Value x at which to evaluate
     299    double y,                          ///< Value y at which to evaluate
     300    double z,                          ///< Value z at which to evaluate
     301    const psDPolynomial3D* myPoly      ///< Coefficients for the polynomial
     302);
     303
     304/** Evaluates a double-precision 4-D polynomial at specific coordinates.
     305 *
     306 *  @return float    result of polynomial at given location
     307 */
     308double psDPolynomial4DEval(
     309    double w,                          ///< Value w at which to evaluate
     310    double x,                          ///< Value x at which to evaluate
     311    double y,                          ///< Value y at which to evaluate
     312    double z,                          ///< Value z at which to evaluate
     313    const psDPolynomial4D* myPoly      ///< Coefficients for the polynomial
     314);
    231315
    232316/* \} */// End of MathGroup Functions
  • trunk/psLib/src/math/psSpline.h

    r1441 r1464  
    1313*  @author George Gusciora, MHPCC
    1414*
    15 *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
    16 *  @date $Date: 2004-08-09 23:40:55 $
     15*  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
     16*  @date $Date: 2004-08-11 02:35:58 $
    1717*
    1818*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3131
    3232/** Evaluate a non-normalized Gaussian with the given mean and sigma at the
    33     given coordianate.  Note that this is not a Gaussian deviate.  The
    34     evaluated Gaussian is: \f[ exp(-\frac{(x-mean)^2}{2\sigma^2}) \f] */
    35 
    36 float psGaussian(float x,       ///< Value at which to evaluate
    37                  float mean,    ///< Mean for the Gaussian
    38                  float stddev,  ///< Standard deviation for the Gaussian
    39                  bool normal    ///< Indicates whether result should be normalized
    40                 );
     33 *  given coordianate. 
     34 *
     35 *  Note that this is not a Gaussian deviate.  The evaluated Gaussian is:
     36 *        \f[ exp(-\frac{(x-mean)^2}{2\sigma^2}) \f]
     37 *
     38 *  @return float      value on the gaussian curve given the input parameters
     39 */
     40float psGaussian(
     41    float x,                           ///< Value at which to evaluate
     42    float mean,                        ///< Mean for the Gaussian
     43    float stddev,                      ///< Standard deviation for the Gaussian
     44    bool normal                        ///< Indicates whether result should be normalized
     45);
    4146
    4247/** Produce a vector of random numbers from a Gaussian distribution with
    43     the specified mean and sigma */
    44 psVector* psGaussianDev(float mean,     ///< The mean of the Gaussian
    45                         float sigma,    ///< The sigma of the Gaussian
    46                         int Npts);      ///< The size of the vector
     48 *  the specified mean and sigma
     49 * 
     50 *  @return psVector*    vector of random numbers
     51 * 
     52 */
     53psVector* psGaussianDev(
     54    float mean,                        ///< The mean of the Gaussian
     55    float sigma,                       ///< The sigma of the Gaussian
     56    int Npts                           ///< The size of the vector
     57);
    4758
    4859/** One-dimensional polynomial */
    4960typedef struct
    5061{
    51     int n;                      ///< Number of terms
    52     float *coeff;               ///< Coefficients
    53     float *coeffErr;            ///< Error in coefficients
    54     char *mask;                 ///< Coefficient mask
     62    int n;                             ///< Number of terms
     63    float *coeff;                      ///< Coefficients
     64    float *coeffErr;                   ///< Error in coefficients
     65    char *mask;                        ///< Coefficient mask
    5566}
    5667psPolynomial1D;
     
    5970typedef struct
    6071{
    61     int nX,
    62     nY;                       ///< Number of terms in x and y
    63     float **coeff;              ///< Coefficients
    64     float **coeffErr;           ///< Error in coefficients
    65     char **mask;                ///< Coefficients mask
     72    int nX;                            ///< Number of terms in x
     73    int nY;                            ///< Number of terms in y
     74    float **coeff;                     ///< Coefficients
     75    float **coeffErr;                  ///< Error in coefficients
     76    char **mask;                       ///< Coefficients mask
    6677}
    6778psPolynomial2D;
     
    7081typedef struct
    7182{
    72     int nX,
    73     nY,
    74     nZ;                       ///< Number of terms in x, y and z
    75     float ***coeff;             ///< Coefficients
    76     float ***coeffErr;          ///< Error in coefficients
    77     char ***mask;               ///< Coefficients mask
     83    int nX;                            ///< Number of terms in x
     84    int nY;                            ///< Number of terms in y
     85    int nZ;                            ///< Number of terms in z
     86    float ***coeff;                    ///< Coefficients
     87    float ***coeffErr;                 ///< Error in coefficients
     88    char ***mask;                      ///< Coefficients mask
    7889}
    7990psPolynomial3D;
     
    8293typedef struct
    8394{
    84     int nW,
    85     nX,
    86     nY,
    87     nZ;                       ///< Number of terms in w, x, y and z
    88     float ****coeff;            ///< Coefficients
    89     float ****coeffErr;         ///< Error in coefficients
    90     char ****mask;              ///< Coefficients mask
     95    int nW;                            ///< Number of terms in w
     96    int nX;                            ///< Number of terms in x
     97    int nY;                            ///< Number of terms in y
     98    int nZ;                            ///< Number of terms in z
     99    float ****coeff;                   ///< Coefficients
     100    float ****coeffErr;                ///< Error in coefficients
     101    char ****mask;                     ///< Coefficients mask
    91102}
    92103psPolynomial4D;
    93104
    94 /** Functions **************************************************************/
    95 
    96 /** Constructor */
    97 psPolynomial1D* psPolynomial1DAlloc(int n       ///< Number of terms
    98                                    );
    99 
    100 /** Constructor */
    101 psPolynomial2D* psPolynomial2DAlloc(int nX, int nY      ///< Number of terms in x and y
    102                                    );
    103 
    104 /** Constructor */
    105 psPolynomial3D* psPolynomial3DAlloc(int nX, int nY, int nZ      ///< Number of terms in x, y and z
    106                                    );
    107 
    108 /** Constructor */
    109 psPolynomial4D* psPolynomial4DAlloc(int nW, int nX, int nY, int nZ      ///< Number of terms in w, x, y and
    110                                     // z
    111                                    );
    112 
    113 /** Evaluate 1D polynomial */
    114 float psPolynomial1DEval(float x,       ///< Value at which to evaluate
    115                          const psPolynomial1D* myPoly  ///< Coefficients for the polynomial
    116                         );
    117 
    118 /** Evaluate 2D polynomial */
    119 float psPolynomial2DEval(float x,       ///< Value x at which to evaluate
    120                          float y,       ///< Value y at which to evaluate
    121                          const psPolynomial2D* myPoly  ///< Coefficients for the polynomial
    122                         );
    123 
    124 /** Evaluate 3D polynomial */
    125 float psPolynomial3DEval(float x,       ///< Value x at which to evaluate
    126                          float y,       ///< Value y at which to evaluate
    127                          float z,       ///< Value z at which to evaluate
    128                          const psPolynomial3D* myPoly  ///< Coefficients for the polynomial
    129                         );
    130 
    131 /** Evaluate 4D polynomial */
    132 float psPolynomial4DEval(float w,       ///< Value w at which to evaluate
    133                          float x,       ///< Value x at which to evaluate
    134                          float y,       ///< Value y at which to evaluate
    135                          float z,       ///< Value z at which to evaluate
    136                          const psPolynomial4D* myPoly  ///< Coefficients for the polynomial
    137                         );
     105
     106/** Allocates a psPolynomial1D structure with n terms
     107 *
     108 *  @return  psPolynomial1D*    new 1-D polynomial struct
     109 */
     110psPolynomial1D* psPolynomial1DAlloc(
     111    int n                              ///< Number of terms
     112);
     113
     114/** Allocates a 2-D polynomial structure
     115 *
     116 *  @return  psPolynomial2D*    new 2-D polynomial struct
     117 */
     118psPolynomial2D* psPolynomial2DAlloc(
     119    int nX,                            ///< Number of terms in x
     120    int nY                             ///< Number of terms in y
     121);
     122
     123/** Allocates a 3-D polynomial structure
     124 *
     125 *  @return  psPolynomial3D*    new 3-D polynomial struct
     126 */
     127psPolynomial3D* psPolynomial3DAlloc(
     128    int nX,                            ///< Number of terms in x
     129    int nY,                            ///< Number of terms in y
     130    int nZ                             ///< Number of terms in z
     131);
     132
     133/** Allocates a 4-D polynomial structure
     134 *
     135 *  @return  psPolynomial4D*    new 4-D polynomial struct
     136 */
     137psPolynomial4D* psPolynomial4DAlloc(
     138    int nW,                            ///< Number of terms in w
     139    int nX,                            ///< Number of terms in x
     140    int nY,                            ///< Number of terms in y
     141    int nZ                             ///< Number of terms in z
     142);
     143
     144/** Evaluates a 1-D polynomial at specific coordinates.
     145 *
     146 *  @return float    result of polynomial at given location
     147 */
     148float psPolynomial1DEval(
     149    float x,                           ///< location at which to evaluate
     150    const psPolynomial1D* myPoly       ///< Coefficients for the polynomial
     151);
     152
     153/** Evaluates a 2-D polynomial at specific coordinates.
     154 *
     155 *  @return float    result of polynomial at given location
     156 */
     157float psPolynomial2DEval(
     158    float x,                           ///< x location at which to evaluate
     159    float y,                           ///< y location at which to evaluate
     160    const psPolynomial2D* myPoly       ///< Coefficients for the polynomial
     161);
     162
     163/** Evaluates a 3-D polynomial at specific coordinates.
     164 *
     165 *  @return float    result of polynomial at given location
     166 */
     167float psPolynomial3DEval(
     168    float x,                           ///< x location at which to evaluate
     169    float y,                           ///< y location at which to evaluate
     170    float z,                           ///< z location at which to evaluate
     171    const psPolynomial3D* myPoly       ///< Coefficients for the polynomial
     172);
     173
     174/** Evaluates a 4-D polynomial at specific coordinates.
     175 *
     176 *  @return float    result of polynomial at given location
     177 */
     178float psPolynomial4DEval(
     179    float w,                           ///< w location at which to evaluate
     180    float x,                           ///< x location at which to evaluate
     181    float y,                           ///< y location at which to evaluate
     182    float z,                           ///< z location at which to evaluate
     183    const psPolynomial4D* myPoly       ///< Coefficients for the polynomial
     184);
    138185
    139186/*****************************************************************************/
     
    144191typedef struct
    145192{
    146     int n;                      ///< Number of terms
    147     double *coeff;              ///< Coefficients
    148     double *coeffErr;           ///< Error in coefficients
    149     char *mask;                 ///< Coefficient mask
     193    int n;                             ///< Number of terms
     194    double *coeff;                     ///< Coefficients
     195    double *coeffErr;                  ///< Error in coefficients
     196    char *mask;                        ///< Coefficient mask
    150197}
    151198psDPolynomial1D;
     
    154201typedef struct
    155202{
    156     int nX,
    157     nY;                       ///< Number of terms in x and y
    158     double **coeff;             ///< Coefficients
    159     double **coeffErr;          ///< Error in coefficients
    160     char **mask;                ///< Coefficients mask
     203    int nX;                            ///< Number of terms in x
     204    int nY;                            ///< Number of terms in y
     205    double **coeff;                    ///< Coefficients
     206    double **coeffErr;                 ///< Error in coefficients
     207    char **mask;                       ///< Coefficients mask
    161208}
    162209psDPolynomial2D;
     
    165212typedef struct
    166213{
    167     int nX,
    168     nY,
    169     nZ;                       ///< Number of terms in x, y and z
    170     double ***coeff;            ///< Coefficients
    171     double ***coeffErr;         ///< Error in coefficients
    172     char ***mask;               ///< Coefficient mask
     214    int nX;                            ///< Number of terms in x
     215    int nY;                            ///< Number of terms in y
     216    int nZ;                            ///< Number of terms in z
     217    double ***coeff;                   ///< Coefficients
     218    double ***coeffErr;                ///< Error in coefficients
     219    char ***mask;                      ///< Coefficient mask
    173220}
    174221psDPolynomial3D;
     
    177224typedef struct
    178225{
    179     int nW,
    180     nX,
    181     nY,
    182     nZ;                       ///< Number of terms in w, x, y and z
    183     double ****coeff;           ///< Coefficients
    184     double ****coeffErr;        ///< Error in coefficients
    185     char ****mask;              ///< Coefficients mask
     226    int nW;                            ///< Number of terms in w
     227    int nX;                            ///< Number of terms in x
     228    int nY;                            ///< Number of terms in y
     229    int nZ;                            ///< Number of terms in z
     230    double ****coeff;                  ///< Coefficients
     231    double ****coeffErr;               ///< Error in coefficients
     232    char ****mask;                     ///< Coefficients mask
    186233}
    187234psDPolynomial4D;
    188235
    189 /** Constructor */
    190 psDPolynomial1D* psDPolynomial1DAlloc(int n     ///< Number of terms
    191                                      );
    192 
    193 /** Constructor */
    194 psDPolynomial2D* psDPolynomial2DAlloc(int nX, int nY    ///< Number of terms in x and y
    195                                      );
    196 
    197 /** Constructor */
    198 psDPolynomial3D* psDPolynomial3DAlloc(int nX, int nY, int nZ    ///< Number of terms in x, y and z
    199                                      );
    200 
    201 /** Constructor */
    202 psDPolynomial4D* psDPolynomial4DAlloc(int nW, int nX, int nY, int nZ    ///< Number of terms in w, x, y and
    203                                       // z
    204                                      );
    205 
    206 /** Evaluate 1D polynomial (double precision) */
    207 double psDPolynomial1DEval(double x,    ///< Value at which to evaluate
    208                            const psDPolynomial1D* myPoly       ///< Coefficients for the polynomial
    209                           );
    210 
    211 /** Evaluate 2D polynomial (double precision) */
    212 double psDPolynomial2DEval(double x,    ///< Value x at which to evaluate
    213                            double y,    ///< Value y at which to evaluate
    214                            const psDPolynomial2D* myPoly       ///< Coefficients for the polynomial
    215                           );
    216 
    217 /** Evaluate 3D polynomial (double precision) */
    218 double psDPolynomial3DEval(double x,    ///< Value x at which to evaluate
    219                            double y,    ///< Value y at which to evaluate
    220                            double z,    ///< Value z at which to evaluate
    221                            const psDPolynomial3D* myPoly       ///< Coefficients for the polynomial
    222                           );
    223 
    224 /** Evaluate 4D polynomial (double precision) */
    225 double psDPolynomial4DEval(double w,    ///< Value w at which to evaluate
    226                            double x,    ///< Value x at which to evaluate
    227                            double y,    ///< Value y at which to evaluate
    228                            double z,    ///< Value z at which to evaluate
    229                            const psDPolynomial4D* myPoly       ///< Coefficients for the polynomial
    230                           );
     236/** Allocates a double-precision 1-D polynomial structure with n terms
     237 *
     238 *  @return  psPolynomial1D*    new double-precision 1-D polynomial struct
     239 */
     240psDPolynomial1D* psDPolynomial1DAlloc(
     241    int n                              ///< Number of terms
     242);
     243
     244/** Allocates a double-precision 2-D polynomial structure
     245 *
     246 *  @return  psPolynomial2D*    new double-precision 2-D polynomial struct
     247 */
     248psDPolynomial2D* psDPolynomial2DAlloc(
     249    int nX,                            ///< Number of terms in x
     250    int nY                             ///< Number of terms in y
     251);
     252
     253/** Allocates a double-precision 3-D polynomial structure
     254 *
     255 *  @return  psPolynomial3D*    new double-precision 3-D polynomial struct
     256 */
     257psDPolynomial3D* psDPolynomial3DAlloc(
     258    int nX,                            ///< Number of terms in x
     259    int nY,                            ///< Number of terms in y
     260    int nZ                             ///< Number of terms in z
     261);
     262
     263/** Allocates a double-precision 4-D polynomial structure
     264 *
     265 *  @return  psPolynomial4D*    new double-precision 4-D polynomial struct
     266 */
     267psDPolynomial4D* psDPolynomial4DAlloc(
     268    int nW,                            ///< Number of terms in w
     269    int nX,                            ///< Number of terms in x
     270    int nY,                            ///< Number of terms in y
     271    int nZ                             ///< Number of terms in z
     272);
     273
     274/** Evaluates a double-precision 1-D polynomial at specific coordinates.
     275 *
     276 *  @return float    result of polynomial at given location
     277 */
     278double psDPolynomial1DEval(
     279    double x,                          ///< Value at which to evaluate
     280    const psDPolynomial1D* myPoly      ///< Coefficients for the polynomial
     281);
     282
     283/** Evaluates a double-precision 2-D polynomial at specific coordinates.
     284 *
     285 *  @return float    result of polynomial at given location
     286 */
     287double psDPolynomial2DEval(
     288    double x,                           ///< Value x at which to evaluate
     289    double y,                           ///< Value y at which to evaluate
     290    const psDPolynomial2D* myPoly       ///< Coefficients for the polynomial
     291);
     292
     293/** Evaluates a double-precision 3-D polynomial at specific coordinates.
     294 *
     295 *  @return float    result of polynomial at given location
     296 */
     297double psDPolynomial3DEval(
     298    double x,                          ///< Value x at which to evaluate
     299    double y,                          ///< Value y at which to evaluate
     300    double z,                          ///< Value z at which to evaluate
     301    const psDPolynomial3D* myPoly      ///< Coefficients for the polynomial
     302);
     303
     304/** Evaluates a double-precision 4-D polynomial at specific coordinates.
     305 *
     306 *  @return float    result of polynomial at given location
     307 */
     308double psDPolynomial4DEval(
     309    double w,                          ///< Value w at which to evaluate
     310    double x,                          ///< Value x at which to evaluate
     311    double y,                          ///< Value y at which to evaluate
     312    double z,                          ///< Value z at which to evaluate
     313    const psDPolynomial4D* myPoly      ///< Coefficients for the polynomial
     314);
    231315
    232316/* \} */// End of MathGroup Functions
Note: See TracChangeset for help on using the changeset viewer.