diff options
Diffstat (limited to '2.3-1/src/c/statisticsFunctions/includes')
-rw-r--r-- | 2.3-1/src/c/statisticsFunctions/includes/statMax.h | 82 | ||||
-rw-r--r-- | 2.3-1/src/c/statisticsFunctions/includes/statMin.h | 82 |
2 files changed, 150 insertions, 14 deletions
diff --git a/2.3-1/src/c/statisticsFunctions/includes/statMax.h b/2.3-1/src/c/statisticsFunctions/includes/statMax.h index 3538bc1a..7ac659ce 100644 --- a/2.3-1/src/c/statisticsFunctions/includes/statMax.h +++ b/2.3-1/src/c/statisticsFunctions/includes/statMax.h @@ -12,30 +12,60 @@ #ifndef __STAT_MAX_H__ #define __STAT_MAX_H__ - +//#ifndef __MAX_H__ +//#define __MAX_H__ #include "dynlib_statisticsfunctions.h" +#include "types.h" #ifdef __cplusplus extern "C" { #endif +#define max(a,b) (a>=b?a:b) + +#define maxa(a,size1,b,size2,out) {int i;\ + for (i=0;i<size1[0]*size2[1];i++) out[i]=max(a[i],b[i]);\ + } + /* -** \brief Sum of a scalar element, just returns it +** \brief max of a scalar element, just returns it */ -#define smaxs(in) in +#define smaxs(in) in #define srowmaxs(in) in #define scolumnmaxs(in) in #define smatlabmaxs(in) in /* -** \brief Sum of a scalar element, just returns it +** \brief max of a scalar element, just returns it */ -#define dmaxs(in) in +#define dmaxs(in) in #define drowmaxs(in) in #define dcolumnmaxs(in) in #define dmatlabmaxs(in) in /* +** \brief max of a scalar element, just returns it +*/ +#define u8maxs(in) (uint8)in +#define u8rowmaxs(in) (uint8)in +#define u8columnmaxs(in) (uint8)in +#define u8matlabmaxs(in) (uint8)in +#define u16maxs(in) (uint16)in +#define u16rowmaxs(in) (uint16)in +#define u16columnmaxs(in) (uint16)in +#define u16matlabmaxs(in) (uint16)in +#define i8maxs(in) (int8)in +#define i8rowmaxs(in) (int8)in +#define i8columnmaxs(in) (int8)in +#define i8matlabmaxs(in) (int8)in +#define i16maxs(in) (int16)in +#define i16rowmaxs(in) (int16)in +#define i16columnmaxs(in) (int16)in +#define i16matlabmaxs(in) (int16)in + + + +/* ** \brief Sum of a float array ** \param in the float array to process ** \param size, the size of the array @@ -55,9 +85,47 @@ EXTERN_STATFUNC double dmaxa(double *in, int size); EXTERN_STATFUNC void drowmaxa(double *in, int lines, int columns, double* out); EXTERN_STATFUNC void dcolumnmaxa(double *in, int lines, int columns, double* out); +/* +** \brief Sum of a uint8 array +** \param in the uint8 array to process +** \param size, the size of the array +** \returns the max. +*/ +EXTERN_STATFUNC uint8 u8maxa(uint8 *in, int size); +EXTERN_STATFUNC void u8rowmaxa(uint8 *in, int lines, int columns, uint8* out); +EXTERN_STATFUNC void u8columnmaxa(uint8 *in, int lines, int columns, uint8* out); + +/* +** \brief Sum of a uint16 array +** \param in the uint16 array to process +** \param size, the size of the array +** \returns the max. +*/ +EXTERN_STATFUNC uint16 u16maxa(uint16 *in, int size); +EXTERN_STATFUNC void u16rowmaxa(uint16 *in, int lines, int columns, uint16* out); +EXTERN_STATFUNC void u16columnmaxa(uint16 *in, int lines, int columns, uint16* out); + +/* +** \brief Sum of a int8 array +** \param in the int8 array to process +** \param size, the size of the array +** \returns the max. +*/ +EXTERN_STATFUNC int8 i8maxa(int8 *in, int size); +EXTERN_STATFUNC void i8rowmaxa(int8 *in, int lines, int columns, int8* out); +EXTERN_STATFUNC void i8columnmaxa(int8 *in, int lines, int columns, int8* out); + +/* +** \brief Sum of a int16 array +** \param in the int16 array to process +** \param size, the size of the array +** \returns the max. +*/ +EXTERN_STATFUNC int16 i16maxa(int16 *in, int size); +EXTERN_STATFUNC void i16rowmaxa(int16 *in, int lines, int columns, int16* out); +EXTERN_STATFUNC void i16columnmaxa(int16 *in, int lines, int columns, int16* out); + #ifdef __cplusplus } /* extern "C" */ #endif - - #endif /* !__STAT_MAX_H__ */ diff --git a/2.3-1/src/c/statisticsFunctions/includes/statMin.h b/2.3-1/src/c/statisticsFunctions/includes/statMin.h index 9528d9f4..4381abd1 100644 --- a/2.3-1/src/c/statisticsFunctions/includes/statMin.h +++ b/2.3-1/src/c/statisticsFunctions/includes/statMin.h @@ -12,30 +12,60 @@ #ifndef __STAT_MIN_H__ #define __STAT_MIN_H__ - +//#ifndef __MIN_H__ +//#define __MIN_H__ #include "dynlib_statisticsfunctions.h" +#include "types.h" #ifdef __cplusplus extern "C" { #endif +#define min(a,b) (a<=b?a:b) + +#define mina(a,size1,b,size2,out) {int i;\ + for (i=0;i<size1[0]*size2[1];i++) out[i]=min(a[i],b[i]);\ + } + /* -** \brief Sum of a scalar element, just returns it +** \brief min of a scalar element, just returns it */ #define smins(in) in #define srowmins(in) in -#define scolumnmins(in) in +#define scolumnmins(in) in #define smatlabmins(in) in /* -** \brief Sum of a scalar element, just returns it +** \brief min of a scalar element, just returns it */ #define dmins(in) in #define drowmins(in) in -#define dcolumnmins(in) in +#define dcolumnmins(in) in #define dmatlabmins(in) in /* +** \brief min of a scalar element, just returns it +*/ +#define u8mins(in) (uint8)in +#define u8rowmins(in) (uint8)in +#define u8columnmins(in) (uint8)in +#define u8matlabmins(in) (uint8)in +#define u16mins(in) (uint16)in +#define u16rowmins(in) (uint16)in +#define u16columnmins(in) (uint16)in +#define u16matlabmins(in) (uint16)in +#define i8mins(in) (int8)in +#define i8rowmins(in) (int8)in +#define i8columnmins(in) (int8)in +#define i8matlabmins(in) (int8)in +#define i16mins(in) (int16)in +#define i16rowmins(in) (int16)in +#define i16columnmins(in) (int16)in +#define i16matlabmins(in) (int16)in + + + +/* ** \brief Sum of a float array ** \param in the float array to process ** \param size, the size of the array @@ -55,9 +85,47 @@ EXTERN_STATFUNC double dmina(double *in, int size); EXTERN_STATFUNC void drowmina(double *in, int lines, int columns, double* out); EXTERN_STATFUNC void dcolumnmina(double *in, int lines, int columns, double* out); +/* +** \brief Sum of a uint8 array +** \param in the uint8 array to process +** \param size, the size of the array +** \returns the min. +*/ +EXTERN_STATFUNC uint8 u8mina(uint8 *in, int size); +EXTERN_STATFUNC void u8rowmina(uint8 *in, int lines, int columns, uint8* out); +EXTERN_STATFUNC void u8columnmina(uint8 *in, int lines, int columns, uint8* out); + +/* +** \brief Sum of a uint16 array +** \param in the uint16 array to process +** \param size, the size of the array +** \returns the min. +*/ +EXTERN_STATFUNC uint16 u16mina(uint16 *in, int size); +EXTERN_STATFUNC void u16rowmina(uint16 *in, int lines, int columns, uint16* out); +EXTERN_STATFUNC void u16columnmina(uint16 *in, int lines, int columns, uint16* out); + +/* +** \brief Sum of a int8 array +** \param in the int8 array to process +** \param size, the size of the array +** \returns the min. +*/ +EXTERN_STATFUNC int8 i8mina(int8 *in, int size); +EXTERN_STATFUNC void i8rowmina(int8 *in, int lines, int columns, int8* out); +EXTERN_STATFUNC void i8columnmina(int8 *in, int lines, int columns, int8* out); + +/* +** \brief Sum of a int16 array +** \param in the int16 array to process +** \param size, the size of the array +** \returns the min. +*/ +EXTERN_STATFUNC int16 i16mina(int16 *in, int size); +EXTERN_STATFUNC void i16rowmina(int16 *in, int lines, int columns, int16* out); +EXTERN_STATFUNC void i16columnmina(int16 *in, int lines, int columns, int16* out); + #ifdef __cplusplus } /* extern "C" */ #endif - - #endif /* !__STAT_MIN_H__ */ |