IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 1, 2004, 5:57:21 PM (22 years ago)
Author:
gusciora
Message:

Code cleaning in psMinimize.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/image/psImageStats.c

    r2262 r2265  
    99*  @author GLG, MHPCC
    1010*
    11 *  @version $Revision: 1.48 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2004-11-02 02:03:56 $
     11*  @version $Revision: 1.49 $ $Name: not supported by cvs2svn $
     12*  @date $Date: 2004-11-02 03:57:21 $
    1313*
    1414*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    149149}
    150150
    151 double *CalcScaleFactors(psS32 n)
    152 {
    153     psS32 i = 0;
    154     double tmp = 0.0;
    155     double *scalingFactors = (double *)psAlloc(n * sizeof(double));
    156 
    157     for (i = 0; i < n; i++) {
    158         tmp = (double)(n - i);
    159         tmp = (M_PI * (tmp - 0.5)) / ((double)n);
    160         scalingFactors[i] = cos(tmp);
    161     }
    162 
    163     return (scalingFactors);
    164 }
    165 
    166 // XXX: Why do we have this function?
    167 double *CalcScaleFactorsFit(psS32 n)
    168 {
    169     psS32 i = 0;
    170     double tmp = 0.0;
    171     double *scalingFactors = (double *)psAlloc(n * sizeof(double));
    172 
    173     for (i = 0; i < n; i++) {
    174         tmp = (double)(n - i);
    175         tmp = (M_PI * (tmp - 0.5)) / ((double)n);
    176         scalingFactors[i] = cos(tmp);
    177     }
    178 
    179     return (scalingFactors);
    180 }
    181 
    182151/*****************************************************************************
    183152CalcScaleFactorsEval(n): The Chebyshev polynomials are defined over the
     
    187156output a vector of evenly spaced floating point values between -1.0:1.0.
    188157 *****************************************************************************/
    189 double *CalcScaleFactorsEval(psS32 n)
    190 {
     158double *CalcScaleFactors(psS32 n)
     159{
     160    PS_INT_CHEC_NON_NEGATIVE(n, NULL);
    191161    psS32 i = 0;
    192162    double tmp = 0.0;
    193 
    194     return(CalcScaleFactorsFit(n));
    195 
    196163    double *scalingFactors = (double *)psAlloc(n * sizeof(double));
    197164
     
    201168        scalingFactors[i] = cos(tmp);
    202169    }
     170
    203171    return (scalingFactors);
    204172}
    205173
    206 // XXX: Use a static array of CHebyshev polynomials.
     174psVector *VecCalcScaleFactors(psVector *scalingFactors, psS32 n)
     175{
     176    PS_VECTOR_CHECK_NULL(scalingFactors, NULL);
     177    PS_VECTOR_CHECK_TYPE(scalingFactors, PS_TYPE_F64, NULL);
     178    PS_INT_CHEC_NON_NEGATIVE(n, NULL);
     179    psS32 i = 0;
     180    double tmp = 0.0;
     181
     182    for (i = 0; i < n; i++) {
     183        tmp = (double)(n - i);
     184        tmp = (M_PI * (tmp - 0.5)) / ((double)n);
     185        scalingFactors->data.F64[i] = cos(tmp);
     186    }
     187
     188    return (scalingFactors);
     189}
     190
     191// XXX: Use a static array of Chebyshev polynomials.
    207192psPolynomial1D **p_psCreateChebyshevPolys(psS32 maxChebyPoly)
    208193{
Note: See TracChangeset for help on using the changeset viewer.