00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00019
00020 #ifndef _MISC_H_
00021 #define _MISC_H_
00022
00023
00024 #define LM_BLAS_PREFIX // none
00025
00026
00027
00028 #define LCAT_(a, b) #a b
00029 #define LCAT(a, b) LCAT_(a, b) // force substitution
00030 #define RCAT_(a, b) a #b
00031 #define RCAT(a, b) RCAT_(a, b) // force substitution
00032
00033 #define __BLOCKSZ__ 32
00034
00035
00036
00037
00038
00039
00040 #define __BLOCKSZ__SQ (__BLOCKSZ__)*(__BLOCKSZ__)
00041
00042 #ifdef _MSC_VER
00043 #define inline __inline //MSVC
00044 #elif !defined(__GNUC__)
00045 #define inline //other than MSVC, GCC: define empty
00046 #endif
00047
00048
00049 #define LM_CAT__(a, b) a ## b
00050 #define LM_CAT_(a, b) LM_CAT__(a, b) // force substitution
00051 #define LM_ADD_PREFIX(s) LM_CAT_(LM_PREFIX, s)
00052
00053 #ifdef __cplusplus
00054 extern "C" {
00055 #endif
00056
00057
00058 extern void strans_mat_mat_mult(float *a, float *b, int n, int m);
00059 extern void dtrans_mat_mat_mult(double *a, double *b, int n, int m);
00060
00061
00062 extern void sfdif_forw_jac_approx(void (*func)(float *p, float *hx, int m, int n, void *adata),
00063 float *p, float *hx, float *hxx, float delta,
00064 float *jac, int m, int n, void *adata);
00065 extern void dfdif_forw_jac_approx(void (*func)(double *p, double *hx, int m, int n, void *adata),
00066 double *p, double *hx, double *hxx, double delta,
00067 double *jac, int m, int n, void *adata);
00068
00069
00070 extern void sfdif_cent_jac_approx(void (*func)(float *p, float *hx, int m, int n, void *adata),
00071 float *p, float *hxm, float *hxp, float delta,
00072 float *jac, int m, int n, void *adata);
00073 extern void dfdif_cent_jac_approx(void (*func)(double *p, double *hx, int m, int n, void *adata),
00074 double *p, double *hxm, double *hxp, double delta,
00075 double *jac, int m, int n, void *adata);
00076
00077
00078 extern int slevmar_covar(float *JtJ, float *C, float sumsq, int m, int n);
00079 extern int dlevmar_covar(double *JtJ, double *C, double sumsq, int m, int n);
00080
00081 #ifdef __cplusplus
00082 }
00083 #endif
00084
00085 #endif