Changeset 7872 for trunk/projects


Ignore:
Timestamp:
01/27/12 19:41:10 (8 years ago)
Author:
aivar
Message:

Added 'noise' and 'chi_square_delta' parameters to EcfWrapper and JNI interface.

Location:
trunk/projects/slim-curve/src/main/c
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/projects/slim-curve/src/main/c/EcfWrapper.c

    r7781 r7872  
    3030        double instr[], 
    3131        int n_instr, 
     32        int noise, 
    3233        double sig[], 
    3334        double *z, 
     
    3940        ) { 
    4041 
    41     int noise = 0; 
    4242    int n_data = fit_end + 1; 
    4343    float *y_float = (float *)malloc(n_data * sizeof(float)); 
     
    119119        double instr[], 
    120120        int n_instr, 
     121        int noise, 
    121122        double sig[], 
    122123        double param[], 
     
    125126        double fitted[], 
    126127        double *chi_square, 
    127         double chi_square_target 
     128        double chi_square_target, 
     129        double chi_square_delta 
    128130        ) { 
    129131 
    130     int noise = 0; 
    131132    int restrain = 0; 
    132     float chi_square_delta = 0; 
    133133    float chi_square_percent = 500; 
     134 
    134135    int n_data = fit_end + 1; 
    135136    float *y_float = (float *)malloc(n_data * sizeof(float)); 
  • trunk/projects/slim-curve/src/main/c/EcfWrapper.h

    r7781 r7872  
    3939        double instr[], 
    4040        int n_instr, 
     41        int noise, 
    4142        double sig[], 
    4243        double *z, 
     
    5556        double instr[], 
    5657        int n_instr, 
     58        int noise, 
    5759        double sig[], 
    5860        double param[], 
     
    6163        double fitted[], 
    6264        double *chi_square, 
    63         double chi_square_target 
     65        double chi_square_target, 
     66        double chi_square_delta 
    6467        ); 
    6568 
  • trunk/projects/slim-curve/src/main/c/loci_curvefitter_SLIMCurveFitter.c

    r7781 r7872  
    2424 * Class:     loci_curvefitter_SLIMCurveFitter 
    2525 * Method:    RLD_fit 
    26  * Signature: (D[DII[DI[D[D[D[D[D[DD)I 
     26 * Signature: (D[DII[DII[D[D[D[D[D[DD)I 
    2727 */ 
    2828JNIEXPORT jint JNICALL Java_loci_curvefitter_SLIMCurveFitter_RLD_1fit 
    2929  (JNIEnv *env, jobject obj, jdouble x_inc, jdoubleArray y, 
    3030        jint fit_start, jint fit_end, jdoubleArray instr, jint n_instr, 
    31         jdoubleArray sig, jdoubleArray z, jdoubleArray a, jdoubleArray tau, 
     31        jint noise, jdoubleArray sig, 
     32        jdoubleArray z, jdoubleArray a, jdoubleArray tau, 
    3233        jdoubleArray fitted, jdoubleArray chi_square, jdouble chi_square_target) { 
    3334 
     
    6162 
    6263    return_value = RLD_fit(x_inc, y_array, fit_start, fit_end, 
    63             instr_array, n_instr, sig_array, z_ref, a_ref, tau_ref, 
     64            instr_array, n_instr, noise, sig_array, z_ref, a_ref, tau_ref, 
    6465            fitted_array, chi_square_ref, chi_square_target); 
    6566 
     
    8687 * Class:     loci_curvefitter_SLIMCurveFitter 
    8788 * Method:    LMA_fit 
    88  * Signature: (D[DII[DI[D[D[II[D[DD)I 
     89 * Signature: (D[DII[DII[D[D[II[D[DDD)I 
    8990 */ 
    9091JNIEXPORT jint JNICALL Java_loci_curvefitter_SLIMCurveFitter_LMA_1fit 
    9192  (JNIEnv *env, jobject obj, jdouble x_inc, jdoubleArray y, 
    9293        jint fit_start, jint fit_end, jdoubleArray instr, jint n_instr, 
    93         jdoubleArray sig, jdoubleArray param, jintArray param_free, jint n_param, 
    94         jdoubleArray fitted, jdoubleArray chi_square, jdouble chi_square_target) { 
     94        jint noise, jdoubleArray sig, 
     95        jdoubleArray param, jintArray param_free, jint n_param, 
     96        jdoubleArray fitted, jdoubleArray chi_square, 
     97        jdouble chi_square_target, jdouble chi_square_delta) { 
    9598 
    9699    jdouble *y_array; 
     
    121124 
    122125    return_value = LMA_fit(x_inc, y_array, fit_start, fit_end, 
    123             instr_array, n_instr, sig_array, param_array, param_free_array, n_param, 
    124             fitted_array, chi_square_ref, chi_square_target); 
     126            instr_array, n_instr, noise, sig_array, 
     127            param_array, param_free_array, n_param, 
     128            fitted_array, chi_square_ref, chi_square_target, chi_square_delta); 
    125129 
    126130    // pass back the arrays 
  • trunk/projects/slim-curve/src/main/c/loci_curvefitter_SLIMCurveFitter.h

    r7724 r7872  
    1212 * Class:     loci_curvefitter_SLIMCurveFitter 
    1313 * Method:    RLD_fit 
    14  * Signature: (D[DII[DI[D[D[D[D[D[DD)I 
     14 * Signature: (D[DII[DII[D[D[D[D[D[DD)I 
    1515 */ 
    1616JNIEXPORT jint JNICALL Java_loci_curvefitter_SLIMCurveFitter_RLD_1fit 
    17   (JNIEnv *, jobject, jdouble, jdoubleArray, jint, jint, jdoubleArray, jint, jdoubleArray, jdoubleArray, jdoubleArray, jdoubleArray, jdoubleArray, jdoubleArray, jdouble); 
     17  (JNIEnv *, jobject, jdouble, jdoubleArray, jint, jint, jdoubleArray, jint, jint, jdoubleArray, jdoubleArray, jdoubleArray, jdoubleArray, jdoubleArray, jdoubleArray, jdouble); 
    1818 
    1919/* 
    2020 * Class:     loci_curvefitter_SLIMCurveFitter 
    2121 * Method:    LMA_fit 
    22  * Signature: (D[DII[DI[D[D[II[D[DD)I 
     22 * Signature: (D[DII[DII[D[D[II[D[DDD)I 
    2323 */ 
    2424JNIEXPORT jint JNICALL Java_loci_curvefitter_SLIMCurveFitter_LMA_1fit 
    25   (JNIEnv *, jobject, jdouble, jdoubleArray, jint, jint, jdoubleArray, jint, jdoubleArray, jdoubleArray, jintArray, jint, jdoubleArray, jdoubleArray, jdouble); 
     25  (JNIEnv *, jobject, jdouble, jdoubleArray, jint, jint, jdoubleArray, jint, jint, jdoubleArray, jdoubleArray, jintArray, jint, jdoubleArray, jdoubleArray, jdouble, jdouble); 
    2626 
    2727#ifdef __cplusplus 
Note: See TracChangeset for help on using the changeset viewer.