IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4971


Ignore:
Timestamp:
Sep 7, 2005, 2:17:26 PM (21 years ago)
Author:
gusciora
Message:

....

Location:
trunk/psLib/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/math/math.i

    r4540 r4971  
    66%include "psMatrix.h"
    77%include "psMinimize.h"
    8 %include "psFunctions.h"
     8%include "psPolynomial.h"
     9%include "psSpline.h"
    910%include "psRandom.h"
    1011%include "psStats.h"
  • trunk/psLib/src/math/psPolynomial.c

    r4970 r4971  
    1 /** @file  psFunctions.c
     1/** @file  psPolynomial.c
    22*
    33*  @brief Contains basic function allocation, deallocation, and evaluation
     
    77*  polynomials.  It also contains a Gaussian functions.
    88*
    9 *  @version $Revision: 1.118 $ $Name: not supported by cvs2svn $
    10 *  @date $Date: 2005-09-08 00:07:59 $
     9*  @version $Revision: 1.119 $ $Name: not supported by cvs2svn $
     10*  @date $Date: 2005-09-08 00:14:31 $
    1111*
    1212*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    206206    psF64 xSum = 1.0;
    207207
    208     psTrace(".psLib.dataManip.psFunctions.ordPolynomial1DEval", 4,
     208    psTrace(".psLib.dataManip.psPolynomial.ordPolynomial1DEval", 4,
    209209            "---- Calling ordPolynomial1DEval(%lf)\n", x);
    210     psTrace(".psLib.dataManip.psFunctions.ordPolynomial1DEval", 4,
     210    psTrace(".psLib.dataManip.psPolynomial.ordPolynomial1DEval", 4,
    211211            "Polynomial order is %d\n", poly->n);
    212212    for (loop_x = 0; loop_x < poly->n; loop_x++) {
    213         psTrace(".psLib.dataManip.psFunctions.ordPolynomial1DEval", 4,
     213        psTrace(".psLib.dataManip.psPolynomial.ordPolynomial1DEval", 4,
    214214                "Polynomial coeff[%d] is %lf\n", loop_x, poly->coeff[loop_x]);
    215215    }
     
    217217    for (loop_x = 0; loop_x < poly->n; loop_x++) {
    218218        if (poly->mask[loop_x] == 0) {
    219             psTrace(".psLib.dataManip.psFunctions.ordPolynomial1DEval", 10,
     219            psTrace(".psLib.dataManip.psPolynomial.ordPolynomial1DEval", 10,
    220220                    "polysum+= sum*coeff [%lf+= (%lf * %lf)\n", polySum, xSum, poly->coeff[loop_x]);
    221221            polySum += xSum * poly->coeff[loop_x];
     
    546546    psF32 tmp = 1.0;
    547547
    548     psTrace(".psLib.dataManip.psFunctions.psGaussian", 4,
     548    psTrace(".psLib.dataManip.psPolynomial.psGaussian", 4,
    549549            "---- psGaussian() begin ----\n");
    550550
     
    553553    }
    554554
    555     psTrace(".psLib.dataManip.psFunctions.psGaussian", 4,
     555    psTrace(".psLib.dataManip.psPolynomial.psGaussian", 4,
    556556            "---- psGaussian() end ----\n");
    557557    return(tmp * exp(-((x - mean) * (x - mean)) / (2.0 * sigma * sigma)));
     
    759759    } else {
    760760        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
    761                 PS_ERRORTEXT_psFunctions_INVALID_POLYNOMIAL_TYPE,
     761                PS_ERRORTEXT_psPolynomial_INVALID_POLYNOMIAL_TYPE,
    762762                poly->type);
    763763    }
     
    792792    } else {
    793793        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
    794                 PS_ERRORTEXT_psFunctions_INVALID_POLYNOMIAL_TYPE,
     794                PS_ERRORTEXT_psPolynomial_INVALID_POLYNOMIAL_TYPE,
    795795                poly->type);
    796796    }
     
    839839    } else {
    840840        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
    841                 PS_ERRORTEXT_psFunctions_INVALID_POLYNOMIAL_TYPE,
     841                PS_ERRORTEXT_psPolynomial_INVALID_POLYNOMIAL_TYPE,
    842842                poly->type);
    843843    }
     
    895895    } else {
    896896        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
    897                 PS_ERRORTEXT_psFunctions_INVALID_POLYNOMIAL_TYPE,
     897                PS_ERRORTEXT_psPolynomial_INVALID_POLYNOMIAL_TYPE,
    898898                poly->type);
    899899    }
  • trunk/psLib/src/math/psSpline.c

    r4970 r4971  
    1 /** @file  psFunctions.c
     1/** @file psSpline.c
    22*
    33*  @brief Contains basic function allocation, deallocation, and evaluation
     
    77*  splines.
    88*
    9 *  @version $Revision: 1.121 $ $Name: not supported by cvs2svn $
    10 *  @date $Date: 2005-09-08 00:07:59 $
     9*  @version $Revision: 1.122 $ $Name: not supported by cvs2svn $
     10*  @date $Date: 2005-09-08 00:14:32 $
    1111*
    1212*
     
    112112    p_psMemSetPersistent(p->data.TYPE, true); \
    113113    \
    114     psTrace(".psLib.dataManip.psFunctions.fullInterpolate1D##TYPE", 4, \
     114    psTrace(".psLib.dataManip.psSpline.fullInterpolate1D##TYPE", 4, \
    115115            "---- fullInterpolate1D##TYPE() begin (%d-order at x=%f) (%d data points)----\n", n-1, x, n); \
    116116    \
    117117    for (i=0;i<n;i++) { \
    118         psTrace(".psLib.dataManip.psFunctions.fullInterpolate1D##TYPE", 6, \
     118        psTrace(".psLib.dataManip.psSpline.fullInterpolate1D##TYPE", 6, \
    119119                "domain/range is (%f %f)\n", domain[i], range[i]); \
    120120    } \
     
    122122    for (i=0;i<n;i++) { \
    123123        p->data.TYPE[i] = range[i]; \
    124         psTrace(".psLib.dataManip.psFunctions.fullInterpolate1D##TYPE", 6, \
     124        psTrace(".psLib.dataManip.psSpline.fullInterpolate1D##TYPE", 6, \
    125125                "p->data.TYPE[%d] is %f\n", i, p->data.TYPE[i]); \
    126126        \
     
    139139            /*printf("((%f-%f * %f) + (%f-%f * %f)) / (%f - %f)\n", x, domain[i+m], p->data.TYPE[i], domain[i], x, p->data.TYPE[i+1], domain[i], domain[i+m]); \
    140140             */ \
    141             psTrace(".psLib.dataManip.psFunctions.fullInterpolate1D##TYPE", 6, \
     141            psTrace(".psLib.dataManip.psSpline.fullInterpolate1D##TYPE", 6, \
    142142                    "p->data.TYPE[%d] is %f\n", i, p->data.TYPE[i]); \
    143143        } \
    144144    } \
    145     psTrace(".psLib.dataManip.psFunctions.fullInterpolate1D##TYPE", 4, \
     145    psTrace(".psLib.dataManip.psSpline.fullInterpolate1D##TYPE", 4, \
    146146            "---- fullInterpolate1D##TYPE() end ----\n"); \
    147147    \
     
    181181    psS32 origin;
    182182
    183     psTrace(".psLib.dataManip.psFunctions.interpolate1DF32", 4,
     183    psTrace(".psLib.dataManip.psSpline.interpolate1DF32", 4,
    184184            "---- interpolate1DF32() begin ----\n");
    185185
     
    202202    }
    203203
    204     psTrace(".psLib.dataManip.psFunctions.interpolate1DF32", 4,
     204    psTrace(".psLib.dataManip.psSpline.interpolate1DF32", 4,
    205205            "---- interpolate1DF32() end ----\n");
    206206    return(fullInterpolate1DF32(&domain[origin], &range[origin], order+1, x));
     
    349349    psS32 mid; \
    350350    \
    351     psTrace(".psLib.dataManip.psFunctions.vectorBinDisect##TYPE", 4, \
     351    psTrace(".psLib.dataManip.psSpline.vectorBinDisect##TYPE", 4, \
    352352            "---- Calling vectorBinDisect##TYPE(%f)\n", x); \
    353353    \
     
    371371    \
    372372    while (min != max) { \
    373         psTrace(".psLib.dataManip.psFunctions.vectorBinDisect##TYPE", 4, \
     373        psTrace(".psLib.dataManip.psSpline.vectorBinDisect##TYPE", 4, \
    374374                "(min, mid, max) is (%d, %d, %d): (x, bins) is (%f, %f)\n", \
    375375                min, mid, max, x, bins[mid]); \
    376376        \
    377377        if (x == bins[mid]) { \
    378             psTrace(".psLib.dataManip.psFunctions.vectorBinDisect##TYPE", 4, \
     378            psTrace(".psLib.dataManip.psSpline.vectorBinDisect##TYPE", 4, \
    379379                    "---- Exiting vectorBinDisect##TYPE(): bin %d\n", mid); \
    380380            return(mid); \
     
    387387    } \
    388388    \
    389     psTrace(".psLib.dataManip.psFunctions.vectorBinDisect##TYPE", 4, \
     389    psTrace(".psLib.dataManip.psSpline.vectorBinDisect##TYPE", 4, \
    390390            "---- Exiting vectorBinDisect##TYPE(): bin %d\n", min); \
    391391    return(min); \
     
    441441        PS_TYPE_NAME(strType,x->type.type);
    442442        psError(PS_ERR_BAD_PARAMETER_TYPE,
    443                 PS_ERRORTEXT_psFunctions_TYPE_NOT_SUPPORTED,
     443                PS_ERRORTEXT_psSpline_TYPE_NOT_SUPPORTED,
    444444                strType);
    445445        return 0;
     
    447447        PS_TYPE_NAME(strType,x->type.type);
    448448        psError(PS_ERR_BAD_PARAMETER_TYPE,
    449                 PS_ERRORTEXT_psFunctions_TYPE_NOT_SUPPORTED,
     449                PS_ERRORTEXT_psSpline_TYPE_NOT_SUPPORTED,
    450450                strType);
    451451        return 0;
     
    453453        PS_TYPE_NAME(strType,x->type.type);
    454454        psError(PS_ERR_BAD_PARAMETER_TYPE,
    455                 PS_ERRORTEXT_psFunctions_TYPE_NOT_SUPPORTED,
     455                PS_ERRORTEXT_psSpline_TYPE_NOT_SUPPORTED,
    456456                strType);
    457457        return 0;
     
    487487    psVector *range32 = NULL;
    488488    psVector *domain32 = NULL;
    489     psTrace(".psLib.dataManip.psFunctions.p_psVectorInterpolate", 4,
     489    psTrace(".psLib.dataManip.psSpline.p_psVectorInterpolate", 4,
    490490            "---- p_psVectorInterpolate() begin ----\n");
    491491
    492492    if (order > (domain->n - 1)) {
    493493        psError(PS_ERR_BAD_PARAMETER_SIZE, true,
    494                 PS_ERRORTEXT_psFunctions_NOT_ENOUGH_DATAPOINTS,
     494                PS_ERRORTEXT_psSpline_NOT_ENOUGH_DATAPOINTS,
    495495                order);
    496496        return(NULL);
     
    498498
    499499    if (x->type.type == PS_TYPE_F32) {
    500         psTrace(".psLib.dataManip.psFunctions.p_psVectorInterpolate", 4,
     500        psTrace(".psLib.dataManip.psSpline.p_psVectorInterpolate", 4,
    501501                "---- p_psVectorInterpolate() end ----\n");
    502502        return(psScalarAlloc(interpolate1DF32(domain->data.F32,
     
    519519        psFree(domain32);
    520520
    521         psTrace(".psLib.dataManip.psFunctions.p_psVectorInterpolate", 4,
     521        psTrace(".psLib.dataManip.psSpline.p_psVectorInterpolate", 4,
    522522                "---- p_psVectorInterpolate() end ----\n");
    523523        // XXX: Convert data type to F64?
     
    528528        PS_TYPE_NAME(strType,x->type.type);
    529529        psError(PS_ERR_BAD_PARAMETER_TYPE,
    530                 PS_ERRORTEXT_psFunctions_TYPE_NOT_SUPPORTED,
     530                PS_ERRORTEXT_psSpline_TYPE_NOT_SUPPORTED,
    531531                strType);
    532532    }
    533533
    534     psTrace(".psLib.dataManip.psFunctions.p_psVectorInterpolate", 4,
     534    psTrace(".psLib.dataManip.psSpline.p_psVectorInterpolate", 4,
    535535            "return(NULL)\n");
    536     psTrace(".psLib.dataManip.psFunctions.p_psVectorInterpolate", 4,
     536    psTrace(".psLib.dataManip.psSpline.p_psVectorInterpolate", 4,
    537537            "---- p_psVectorInterpolate() end ----\n");
    538538
     
    622622        PS_TYPE_NAME(strType,x->type.type);
    623623        psError(PS_ERR_BAD_PARAMETER_TYPE,
    624                 PS_ERRORTEXT_psFunctions_TYPE_NOT_SUPPORTED,
     624                PS_ERRORTEXT_psSpline_TYPE_NOT_SUPPORTED,
    625625                strType);
    626626        return(NULL);
  • trunk/psLib/src/psErrorText_en.dat

    r4827 r4971  
    203203psStats_STATS_POLY_MEDIAN_OUT_OF_RANGE The requested y-value does not fall with the specified range of x-values.  Returning NAN.
    204204#
    205 psFunctions_INVALID_POLYNOMIAL_TYPE    Unknown polynomial type 0x%x found.  Evaluation failed.
    206 psFunctions_TYPE_NOT_SUPPORTED         Input psVector type, %s, is not supported.
    207 psFunctions_NOT_ENOUGH_DATAPOINTS      Given vector does not have enough data points for %d-order interpolation.
     205psPolynomial_INVALID_POLYNOMIAL_TYPE    Unknown polynomial type 0x%x found.  Evaluation failed.
     206psPolynomial_TYPE_NOT_SUPPORTED         Input psVector type, %s, is not supported.
     207psPolynomial_NOT_ENOUGH_DATAPOINTS      Given vector does not have enough data points for %d-order interpolation.
     208psSpline_INVALID_POLYNOMIAL_TYPE    Unknown polynomial type 0x%x found.  Evaluation failed.
     209psSpline_TYPE_NOT_SUPPORTED         Input psVector type, %s, is not supported.
     210psSpline_NOT_ENOUGH_DATAPOINTS      Given vector does not have enough data points for %d-order interpolation.
    208211#
    209212psRandom_UNKNOWN_RANDFOM_NUMBER_GENERATOR_TYPE Unknown Random Number Generator Type
  • trunk/psLib/src/pslib_strict.h

    r4790 r4971  
    99*  @author Eric Van Alst, MHPCC
    1010*
    11 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2005-08-16 21:17:15 $
     11*  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     12*  @date $Date: 2005-09-08 00:15:15 $
    1313*
    1414*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    7272#include "psMinimize.h"
    7373#include "psRandom.h"
    74 #include "psFunctions.h"
     74#include "psPolynomial.h"
     75#include "psSpline.h"
    7576#include "psStats.h"
    7677#include "psUnaryOp.h"
  • trunk/psLib/src/sys/psMemory.c

    r4920 r4971  
    88*  @author Robert Lupton, Princeton University
    99*
    10 *  @version $Revision: 1.63 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2005-08-31 02:07:11 $
     10*  @version $Revision: 1.64 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2005-09-08 00:17:26 $
    1212*
    1313*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3737//#include "psScalar.h"
    3838//#include "psVector.h"
    39 //#include "psFunctions.h"
    4039//#include "psTime.h"
    4140//#include "psCoord.h"
Note: See TracChangeset for help on using the changeset viewer.