Index: mttroot/mtt/cc/include/useful-functions.hh ================================================================== --- mttroot/mtt/cc/include/useful-functions.hh +++ mttroot/mtt/cc/include/useful-functions.hh @@ -1,9 +1,16 @@ #ifndef HAVE_USEFUL_FUNCTIONS_HH #define HAVE_USEFUL_FUNCTIONS_HH +/* Code generation directives */ +#define STANDALONE 0 +#define OCTAVEDLD 1 +#define MATLABMEX 2 +#if (! defined (CODEGENTARGET)) +#define CODEGENTARGET -1 +#endif /* (! defined (CODEGENTARGET)) */ #ifndef __cplusplus #define inline /* strip */ #define cast_to_double (double) /* @@ -39,10 +46,11 @@ return cast_to_double ((x > 0) ? +1 : (x < 0) ? -1 : 0); } /* Octave functions */ +#if ((CODEGENTARGET == STANDALONE) || (CODEGENTARGET == OCTAVEDLD)) #ifdef __cplusplus static Matrix ones (const int r = 1, const int c = 1) { Matrix m (r, c, 1.0); @@ -82,9 +90,10 @@ { Matrix m (r, c, 0.0); return m; } #endif /* __cplusplus */ +#endif /* ((CODEGENTARGET == STANDALONE) || (CODEGENTARGET == OCTAVEDLD)) */ #endif /* HAVE_USEFUL_FUNCTIONS_HH */