Changeset 7693 for trunk/projects/slimcurve/src
 Timestamp:
 04/12/11 15:16:15 (9 years ago)
 Location:
 trunk/projects/slimcurve/src/main/c
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

trunk/projects/slimcurve/src/main/c/loci_curvefitter_SLIMCurveFitter.c
r7691 r7693 13 13 jdoubleArray fitted, jdoubleArray chi_square, jdouble chi_square_target) { 14 14 15 jdouble *y_array; 16 jdouble *instr_array; 17 jdouble *sig_array; 18 jdouble *fitted_array; 19 jdouble *z_ref; 20 jdouble *a_ref; 21 jdouble *tau_ref; 22 jdouble *chi_square_ref; 23 int return_value; 24 15 25 // convert the arrays 16 jdouble *y_array = (*env)>GetDoubleArrayElements(env, y, 0);17 jdouble *instr_array = NULL;26 y_array = (*env)>GetDoubleArrayElements(env, y, 0); 27 instr_array = NULL; 18 28 if (NULL != instr) { 19 29 instr_array = (*env)>GetDoubleArrayElements(env, instr, 0); 20 30 } 21 jdouble *sig_array = NULL;31 sig_array = NULL; 22 32 if (NULL != sig) { 23 33 sig_array = (*env)>GetDoubleArrayElements(env, sig, 0); 24 34 } 25 jdouble *fitted_array = (*env)>GetDoubleArrayElements(env, fitted, 0);35 fitted_array = (*env)>GetDoubleArrayElements(env, fitted, 0); 26 36 27 37 // also handle double by reference as arrays 28 jdouble *z_ref = (*env)>GetDoubleArrayElements(env, z, 0);29 jdouble *a_ref = (*env)>GetDoubleArrayElements(env, z, 0);30 jdouble *tau_ref = (*env)>GetDoubleArrayElements(env, tau, 0);31 jdouble *chi_square_ref = (*env)>GetDoubleArrayElements(env, chi_square, 0);38 z_ref = (*env)>GetDoubleArrayElements(env, z, 0); 39 a_ref = (*env)>GetDoubleArrayElements(env, z, 0); 40 tau_ref = (*env)>GetDoubleArrayElements(env, tau, 0); 41 chi_square_ref = (*env)>GetDoubleArrayElements(env, chi_square, 0); 32 42 33 intreturn_value = RLD_fit(x_inc, y_array, fit_start, fit_end,43 return_value = RLD_fit(x_inc, y_array, fit_start, fit_end, 34 44 instr_array, n_instr, sig_array, z_ref, a_ref, tau_ref, 35 45 fitted_array, chi_square_ref, chi_square_target); … … 65 75 jdoubleArray fitted, jdoubleArray chi_square, jdouble chi_square_target) { 66 76 77 jdouble *y_array; 78 jdouble *instr_array; 79 jdouble *sig_array; 80 jdouble *param_array; 81 jint *param_free_array; 82 jdouble *fitted_array; 83 jdouble *chi_square_ref; 84 int return_value; 85 67 86 // convert the arrays 68 jdouble *y_array = (*env)>GetDoubleArrayElements(env, y, 0);69 jdouble *instr_array = NULL;87 y_array = (*env)>GetDoubleArrayElements(env, y, 0); 88 instr_array = NULL; 70 89 if (NULL != instr) { 71 90 instr_array = (*env)>GetDoubleArrayElements(env, instr, 0); 72 91 } 73 jdouble *sig_array = NULL;92 sig_array = NULL; 74 93 if (NULL != sig) { 75 94 sig_array = (*env)>GetDoubleArrayElements(env, sig, 0); 76 95 } 77 jdouble *param_array = (*env)>GetDoubleArrayElements(env, param, 0);78 jint *param_free_array = (*env)>GetIntArrayElements(env, param_free, 0);79 jdouble *fitted_array = (*env)>GetDoubleArrayElements(env, fitted, 0);96 param_array = (*env)>GetDoubleArrayElements(env, param, 0); 97 param_free_array = (*env)>GetIntArrayElements(env, param_free, 0); 98 fitted_array = (*env)>GetDoubleArrayElements(env, fitted, 0); 80 99 81 100 // also handle double by reference as array 82 jdouble *chi_square_ref = (*env)>GetDoubleArrayElements(env, chi_square, 0);101 chi_square_ref = (*env)>GetDoubleArrayElements(env, chi_square, 0); 83 102 84 intreturn_value = LMA_fit(x_inc, y_array, fit_start, fit_end,103 return_value = LMA_fit(x_inc, y_array, fit_start, fit_end, 85 104 instr_array, n_instr, sig_array, param_array, param_free_array, n_param, 86 105 fitted_array, chi_square_ref, chi_square_target); 
trunk/projects/slimcurve/src/main/c/loci_curvefitter_SLIMCurveFitter.h
r7691 r7693 12 12 * Class: loci_curvefitter_SLIMCurveFitter 13 13 * Method: RLD_fit 14 * Signature: (D[DII[DI[D Ljava/lang/Double;Ljava/lang/Double;Ljava/lang/Double;[DLjava/lang/Double;D)I14 * Signature: (D[DII[DI[D[D[D[D[D[DD)I 15 15 */ 16 16 JNIEXPORT jint JNICALL Java_loci_curvefitter_SLIMCurveFitter_RLD_1fit 17 (JNIEnv *, jobject, jdouble, jdoubleArray, jint, jint, jdoubleArray, jint, jdoubleArray, j object, jobject, jobject, jdoubleArray, jobject, jdouble);17 (JNIEnv *, jobject, jdouble, jdoubleArray, jint, jint, jdoubleArray, jint, jdoubleArray, jdoubleArray, jdoubleArray, jdoubleArray, jdoubleArray, jdoubleArray, jdouble); 18 18 19 19 /* 20 20 * Class: loci_curvefitter_SLIMCurveFitter 21 21 * Method: LMA_fit 22 * Signature: (D[DII[DI[D[D[II[D Ljava/lang/Double;D)I22 * Signature: (D[DII[DI[D[D[II[D[DD)I 23 23 */ 24 24 JNIEXPORT jint JNICALL Java_loci_curvefitter_SLIMCurveFitter_LMA_1fit 25 (JNIEnv *, jobject, jdouble, jdoubleArray, jint, jint, jdoubleArray, jint, jdoubleArray, jdoubleArray, jintArray, jint, jdoubleArray, j object, jdouble);25 (JNIEnv *, jobject, jdouble, jdoubleArray, jint, jint, jdoubleArray, jint, jdoubleArray, jdoubleArray, jintArray, jint, jdoubleArray, jdoubleArray, jdouble); 26 26 27 27 #ifdef __cplusplus
Note: See TracChangeset
for help on using the changeset viewer.