diff options
42 files changed, 1071 insertions, 23 deletions
diff --git a/2.3-1/includes/sci2clib.h b/2.3-1/includes/sci2clib.h index 5fecac83..11c3f23e 100644 --- a/2.3-1/includes/sci2clib.h +++ b/2.3-1/includes/sci2clib.h @@ -176,6 +176,12 @@ extern "C" { /*interfacing nthroot*/ #include "nthroot.h" #include "int_nthroot.h" +/*interfacing pmodulo*/ +#include "pmodulo.h" +#include "int_pmodulo.h" +/*interfacing nanmax*/ +#include "nanmax.h" +#include "int_nanmax.h" /*interfacing issquare*/ #include "issquare.h" #include "int_issquare.h" diff --git a/2.3-1/jar/scilab_en_US_help.jar b/2.3-1/jar/scilab_en_US_help.jar Binary files differindex be66237f..33a02e67 100644 --- a/2.3-1/jar/scilab_en_US_help.jar +++ b/2.3-1/jar/scilab_en_US_help.jar diff --git a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci index aacc909a..2c5740cc 100644 --- a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci +++ b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci @@ -982,6 +982,70 @@ PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file', INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+// -------------------
+// --- Class Pmodulo. ---
+// -------------------
+ClassName = 'Pmodulo';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y');
+//Was FA_TP_USER
+//Cause some trouble if user specify some precision and if input(and also output) is complex.
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+//---Function list class. ----
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0d0'+ArgSeparator+'d0',ClassFileName,'file','y');
+PrintStringInfo('d2d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s0s0'+ArgSeparator+'s0',ClassFileName,'file','y');
+PrintStringInfo('s2s2'+ArgSeparator+'s2',ClassFileName,'file','y');
+PrintStringInfo('i160i160'+ArgSeparator+'i160',ClassFileName,'file','y');
+PrintStringInfo('i162i162'+ArgSeparator+'i162',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'pmodulo';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+// -------------------
+// --- Class Nanmax. ---
+// -------------------
+ClassName = 'Nanmax';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= FA_SZ_SEL1(IN(1).SZ(1),IN(2).VAL)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= FA_SZ_SEL2(IN(1).SZ(2),IN(2).VAL)',ClassFileName,'file','y');
+//---Function list class. ----
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d2'+ArgSeparator+'d0',ClassFileName,'file','y');
+PrintStringInfo('d2g2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s2'+ArgSeparator+'s0',ClassFileName,'file','y');
+PrintStringInfo('s2g2'+ArgSeparator+'s2',ClassFileName,'file','y');
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'nanmax';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
// -------------------
// --- Class Issquare. ---
// -------------------
@@ -1139,6 +1203,8 @@ PrintStringInfo('g2'+ArgSeparator+'g0',ClassFileName,'file','y'); PrintStringInfo('g0'+ArgSeparator+'g0',ClassFileName,'file','y');
PrintStringInfo('z2'+ArgSeparator+'g0',ClassFileName,'file','y');
PrintStringInfo('z0'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('u162'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('u160'+ArgSeparator+'g0',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'ismatrix';
diff --git a/2.3-1/macros/findDeps/getAllHeaders.sci b/2.3-1/macros/findDeps/getAllHeaders.sci index 6f9a272e..82f07fd2 100644 --- a/2.3-1/macros/findDeps/getAllHeaders.sci +++ b/2.3-1/macros/findDeps/getAllHeaders.sci @@ -132,6 +132,8 @@ function allHeaders = getAllHeaders(SharedInfo) "src/c/elementaryFunctions/includes/asech.h" "src/c/elementaryFunctions/includes/isrow.h" "src/c/elementaryFunctions/includes/nthroot.h" + "src/c/elementaryFunctions/includes/pmodulo.h" + "src/c/elementaryFunctions/includes/nanmax.h" "src/c/elementaryFunctions/includes/issquare.h" "src/c/elementaryFunctions/includes/isscalar.h" "src/c/elementaryFunctions/includes/isvector.h" diff --git a/2.3-1/macros/findDeps/getAllInterfaces.sci b/2.3-1/macros/findDeps/getAllInterfaces.sci index b826bb03..8bc347dd 100644 --- a/2.3-1/macros/findDeps/getAllInterfaces.sci +++ b/2.3-1/macros/findDeps/getAllInterfaces.sci @@ -103,6 +103,8 @@ function allInterfaces = getAllInterfaces(SharedInfo) "src/c/elementaryFunctions/interfaces/int_linspace.h" "src/c/elementaryFunctions/interfaces/int_isrow.h" "src/c/elementaryFunctions/interfaces/int_nthroot.h" + "src/c/elementaryFunctions/interfaces/int_pmodulo.h" + "src/c/elementaryFunctions/interfaces/int_nanmax.h" "src/c/elementaryFunctions/interfaces/int_issquare.h" "src/c/elementaryFunctions/interfaces/int_isscalar.h" "src/c/elementaryFunctions/interfaces/int_isvector.h" diff --git a/2.3-1/macros/findDeps/getAllSources.sci b/2.3-1/macros/findDeps/getAllSources.sci index 79bfd2bd..bdd6400b 100644 --- a/2.3-1/macros/findDeps/getAllSources.sci +++ b/2.3-1/macros/findDeps/getAllSources.sci @@ -804,6 +804,18 @@ function allSources = getAllSources(SharedInfo,BuildTool) "src/c/elementaryFunctions/nthroot/snthroota.c" "src/c/elementaryFunctions/nthroot/snthroot1a.c" "src/c/elementaryFunctions/nthroot/snthroots.c" + "src/c/elementaryFunctions/pmodulo/dpmodulos.c" + "src/c/elementaryFunctions/pmodulo/dpmoduloa.c" + "src/c/elementaryFunctions/pmodulo/spmodulos.c" + "src/c/elementaryFunctions/pmodulo/spmoduloa.c" + "src/c/elementaryFunctions/pmodulo/i16pmodulos.c" + "src/c/elementaryFunctions/pmodulo/i16pmoduloa.c" +"src/c/elementaryFunctions/nanmax/dnanmaxa.c" +"src/c/elementaryFunctions/nanmax/dnanmaxcola.c" +"src/c/elementaryFunctions/nanmax/dnanmaxrowa.c" +"src/c/elementaryFunctions/nanmax/snanmaxa.c" +"src/c/elementaryFunctions/nanmax/snanmaxcola.c" +"src/c/elementaryFunctions/nanmax/snanmaxrowa.c" "src/c/elementaryFunctions/isscalar/disscalara.c" "src/c/elementaryFunctions/isscalar/disscalars.c" "src/c/elementaryFunctions/isscalar/gisscalars.c" @@ -832,12 +844,14 @@ function allSources = getAllSources(SharedInfo,BuildTool) "src/c/elementaryFunctions/isvector/zisvectors.c" "src/c/elementaryFunctions/ismatrix/dismatrixa.c" "src/c/elementaryFunctions/ismatrix/dismatrixs.c" - //"src/c/elementaryFunctions/ismatrix/gismatrixs.c" - //"src/c/elementaryFunctions/ismatrix/gismatrixa.c" - //"src/c/elementaryFunctions/ismatrix/sismatrixs.c" - //"src/c/elementaryFunctions/ismatrix/sismatrixa.c" - //"src/c/elementaryFunctions/ismatrix/zismatrixa.c" - //"src/c/elementaryFunctions/ismatrix/zismatrixs.c" + "src/c/elementaryFunctions/ismatrix/gismatrixs.c" + "src/c/elementaryFunctions/ismatrix/gismatrixa.c" + "src/c/elementaryFunctions/ismatrix/sismatrixs.c" + "src/c/elementaryFunctions/ismatrix/sismatrixa.c" + "src/c/elementaryFunctions/ismatrix/zismatrixa.c" + "src/c/elementaryFunctions/ismatrix/zismatrixs.c" + "src/c/elementaryFunctions/ismatrix/u16ismatrixa.c" + "src/c/elementaryFunctions/ismatrix/u16ismatrixs.c" "src/c/elementaryFunctions/acscd/dacscda.c" "src/c/elementaryFunctions/acscd/dacscds.c" "src/c/elementaryFunctions/acscd/sacscda.c" diff --git a/2.3-1/src/c/elementaryFunctions/includes/ismatrix.h b/2.3-1/src/c/elementaryFunctions/includes/ismatrix.h index 072bfdcb..0dd8b4a3 100644 --- a/2.3-1/src/c/elementaryFunctions/includes/ismatrix.h +++ b/2.3-1/src/c/elementaryFunctions/includes/ismatrix.h @@ -17,6 +17,7 @@ #include "types.h" #include "doubleComplex.h" #include "floatComplex.h" +#include "uint16.h" #ifdef __cplusplus extern "C" { @@ -30,6 +31,8 @@ char gismatrixa(char*); char gismatrixs(char); char zismatrixa(doubleComplex*); char zismatrixs(doubleComplex); +char u16ismatrixa(uint16*); +char u16ismatrixs(uint16); #ifdef __cplusplus } /* extern "C" */ diff --git a/2.3-1/src/c/elementaryFunctions/includes/isvector.h b/2.3-1/src/c/elementaryFunctions/includes/isvector.h index 5f45abbe..75599cdd 100644 --- a/2.3-1/src/c/elementaryFunctions/includes/isvector.h +++ b/2.3-1/src/c/elementaryFunctions/includes/isvector.h @@ -22,13 +22,13 @@ extern "C" { #endif -char disvectora(double* , int); +char disvectora(double* , int, int); char disvectors(double); -char sisvectora( float* , int); +char sisvectora( float* , int, int); char sisvectors( float); -char gisvectora(char* , int); +char gisvectora(char* , int, int ); char gisvectors(char); -char zisvectora(doubleComplex*, int); +char zisvectora(doubleComplex*, int, int); char zisvectors(doubleComplex); #ifdef __cplusplus diff --git a/2.3-1/src/c/elementaryFunctions/includes/nanmax.h b/2.3-1/src/c/elementaryFunctions/includes/nanmax.h new file mode 100644 index 00000000..bea83f78 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/includes/nanmax.h @@ -0,0 +1,40 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __NANMAX_H__ +#define __NANMAX_H__ + + +#include "types.h" +#include "doubleComplex.h" +#include "floatComplex.h" +#include "int16.h" + +#ifdef __cplusplus +extern "C" { +#endif + +double dnanmaxa (double* , int); +void dnanmaxrowa (double*, int , int, double*); +void dnanmaxcola (double*, int , int, double*); + +float snanmaxa (float* , int); +void snanmaxrowa (float*, int , int, float*); +void snanmaxcola (float*, int , int, float*); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/2.3-1/src/c/elementaryFunctions/includes/pmodulo.h b/2.3-1/src/c/elementaryFunctions/includes/pmodulo.h new file mode 100644 index 00000000..d46febc3 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/includes/pmodulo.h @@ -0,0 +1,40 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __PMODULO_H__ +#define __PMODULO_H__ + + +#include "types.h" +#include "doubleComplex.h" +#include "floatComplex.h" +#include "int16.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dpmoduloa(double*, int ,double*, double*); +double dpmodulos(double, double); + +void spmoduloa(float*, int ,float*, float*); +float spmodulos(float, float); + +void i16pmoduloa(int16*, int ,int16*, int16*); +int16 i16pmodulos(int16, int16); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/2.3-1/src/c/elementaryFunctions/interfaces/int_ismatrix.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_ismatrix.h index 56dfc856..96352d13 100644 --- a/2.3-1/src/c/elementaryFunctions/interfaces/int_ismatrix.h +++ b/2.3-1/src/c/elementaryFunctions/interfaces/int_ismatrix.h @@ -21,6 +21,8 @@ #define g0ismatrixg0(in) gismatrixs(in) #define z2ismatrixg0(in, size) zismatrixa(in) #define z0ismatrixg0(in) zismatrixs(in) +#define u162ismatrixg0(in, size) u16ismatrixa(in) +#define u160ismatrixg0(in) u16ismatrixs(in) #endif diff --git a/2.3-1/src/c/elementaryFunctions/interfaces/int_isvector.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_isvector.h index 6d943bd3..a4edaea4 100644 --- a/2.3-1/src/c/elementaryFunctions/interfaces/int_isvector.h +++ b/2.3-1/src/c/elementaryFunctions/interfaces/int_isvector.h @@ -13,13 +13,13 @@ #ifndef __INT_ISVECTOR_H__ #define __INT_ISVECTOR_H__ -#define d2isvectorg0(in, size ) disvectora(in, size[0]) +#define d2isvectorg0(in, size ) disvectora(in, size[0], size[1]) #define d0isvectorg0(in) disvectors(in) -#define s2isvectorg0(in , size) sisvectora(in, size[0]) +#define s2isvectorg0(in , size) sisvectora(in, size[0], size[1]) #define s0isvectorg0(in) sisvectors(in) -#define g2isvectorg0(in, size) gisvectora(in, size[0]) +#define g2isvectorg0(in, size) gisvectora(in, size[0], size[1]) #define g0isvectorg0(in) gisvectors(in) -#define z2isvectorg0(in, size) zisvectora(in , size[0]) +#define z2isvectorg0(in, size) zisvectora(in , size[0], size[1]) #define z0isvectorg0(in) zisvectors(in) diff --git a/2.3-1/src/c/elementaryFunctions/interfaces/int_nanmax.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_nanmax.h new file mode 100644 index 00000000..dd3df71d --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/interfaces/int_nanmax.h @@ -0,0 +1,27 @@ + /*This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + + +#ifndef __INT_NANMAX_H__ +#define __INT_NANMAX_H__ + +#define d2nanmaxd0(in1, size) dnanmaxa(in1,size[0]* size[1]) +#define d2g2nanmaxd2(in1, size1, in2, size2, out) (in2[0]=='r') ? dnanmaxrowa(in1, size1[0], size1[1], out) : dnanmaxcola(in1, size1[0] , size1[1], out) + +#define s2nanmaxs0(in1, size) snanmaxa(in1,size[0]* size[1]) +#define s2g2nanmaxs2(in1, size1, in2, size2, out) (in2[0]=='r') ? snanmaxrowa(in1, size1[0], size1[1], out) : snanmaxcola(in1, size1[0] , size1[1], out) + + +//#define i160i160pmoduloi160(in1, in2) i16pmodulos(in1,in2) +//#define i162i162pmoduloi162(in1, size1, in2, size2, out) i16pmoduloa(in1,size1[0]*size1[1],in2, out) + + +#endif diff --git a/2.3-1/src/c/elementaryFunctions/interfaces/int_pmodulo.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_pmodulo.h new file mode 100644 index 00000000..72b12770 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/interfaces/int_pmodulo.h @@ -0,0 +1,26 @@ + /*This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + + +#ifndef __INT_PMODULO_H__ +#define __INT_PMODULO_H__ + +#define d0d0pmodulod0(in1, in2) dpmodulos(in1,in2) +#define d2d2pmodulod2(in1, size1, in2, size2, out) dpmoduloa(in1,size1[0]*size1[1],in2, out) + +#define s0s0pmodulos0(in1, in2) spmodulos(in1,in2) +#define s2s2pmodulos2(in1, size1, in2, size2, out) spmoduloa(in1,size1[0]*size1[1],in2, out) + +#define i160i160pmoduloi160(in1, in2) i16pmodulos(in1,in2) +#define i162i162pmoduloi162(in1, size1, in2, size2, out) i16pmoduloa(in1,size1[0]*size1[1],in2, out) + + +#endif diff --git a/2.3-1/src/c/elementaryFunctions/ismatrix/dismatrixs.c b/2.3-1/src/c/elementaryFunctions/ismatrix/dismatrixs.c index f1c99dc4..15edcf22 100644 --- a/2.3-1/src/c/elementaryFunctions/ismatrix/dismatrixs.c +++ b/2.3-1/src/c/elementaryFunctions/ismatrix/dismatrixs.c @@ -17,6 +17,6 @@ #include "types.h" char dismatrixs(double in) { - char out= 'F' ; + char out= 'T' ; return out; } diff --git a/2.3-1/src/c/elementaryFunctions/ismatrix/gismatrixa.c b/2.3-1/src/c/elementaryFunctions/ismatrix/gismatrixa.c new file mode 100644 index 00000000..f7288145 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/ismatrix/gismatrixa.c @@ -0,0 +1,22 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "ismatrix.h" +#include "types.h" +char gismatrixa(char* in) +{ + char out= 'T' ; + return out; +} diff --git a/2.3-1/src/c/elementaryFunctions/ismatrix/gismatrixs.c b/2.3-1/src/c/elementaryFunctions/ismatrix/gismatrixs.c new file mode 100644 index 00000000..61a3062a --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/ismatrix/gismatrixs.c @@ -0,0 +1,22 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "ismatrix.h" +#include "types.h" +char gismatrixs(char in) +{ + char out= 'T' ; + return out; +} diff --git a/2.3-1/src/c/elementaryFunctions/ismatrix/sismatrixa.c b/2.3-1/src/c/elementaryFunctions/ismatrix/sismatrixa.c new file mode 100644 index 00000000..44335b81 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/ismatrix/sismatrixa.c @@ -0,0 +1,22 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "ismatrix.h" +#include "types.h" +char sismatrixa(float* in) +{ + char out= 'T' ; + return out; +} diff --git a/2.3-1/src/c/elementaryFunctions/ismatrix/sismatrixs.c b/2.3-1/src/c/elementaryFunctions/ismatrix/sismatrixs.c new file mode 100644 index 00000000..d6c6f233 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/ismatrix/sismatrixs.c @@ -0,0 +1,22 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "ismatrix.h" +#include "types.h" +char sismatrixs(float in) +{ + char out= 'T' ; + return out; +} diff --git a/2.3-1/src/c/elementaryFunctions/ismatrix/u16ismatrixa.c b/2.3-1/src/c/elementaryFunctions/ismatrix/u16ismatrixa.c new file mode 100644 index 00000000..c16d54c8 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/ismatrix/u16ismatrixa.c @@ -0,0 +1,23 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "ismatrix.h" +#include "types.h" +#include "uint16.h" +char u16ismatrixa(uint16* in) +{ + char out= 'T' ; + return out; +} diff --git a/2.3-1/src/c/elementaryFunctions/ismatrix/u16ismatrixs.c b/2.3-1/src/c/elementaryFunctions/ismatrix/u16ismatrixs.c new file mode 100644 index 00000000..64313577 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/ismatrix/u16ismatrixs.c @@ -0,0 +1,23 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "ismatrix.h" +#include "types.h" +#include "uint16.h" +char u16ismatrixs(uint16 in) +{ + char out= 'T' ; + return out; +} diff --git a/2.3-1/src/c/elementaryFunctions/ismatrix/zismatrixa.c b/2.3-1/src/c/elementaryFunctions/ismatrix/zismatrixa.c new file mode 100644 index 00000000..32d72605 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/ismatrix/zismatrixa.c @@ -0,0 +1,24 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "ismatrix.h" +#include "types.h" +#include "uint16.h" +#include "doubleComplex.h" +char zismatrixa(doubleComplex* in) +{ + char out= 'T' ; + return out; +} diff --git a/2.3-1/src/c/elementaryFunctions/ismatrix/zismatrixs.c b/2.3-1/src/c/elementaryFunctions/ismatrix/zismatrixs.c new file mode 100644 index 00000000..d38592c7 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/ismatrix/zismatrixs.c @@ -0,0 +1,24 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "ismatrix.h" +#include "types.h" +#include "uint16.h" +#include "doubleComplex.h" +char zismatrixs(doubleComplex in) +{ + char out= 'T' ; + return out; +} diff --git a/2.3-1/src/c/elementaryFunctions/isvector/disvectora.c b/2.3-1/src/c/elementaryFunctions/isvector/disvectora.c index 3c41027f..a96485be 100644 --- a/2.3-1/src/c/elementaryFunctions/isvector/disvectora.c +++ b/2.3-1/src/c/elementaryFunctions/isvector/disvectora.c @@ -15,9 +15,9 @@ #include <math.h> #include "isvector.h" #include "types.h" -char disvectora(double* inp, int size1) +char disvectora(double* inp, int row, int col) { - if(size1 ==1) + if(row ==1 || col==1) return 'T'; return 'F'; } diff --git a/2.3-1/src/c/elementaryFunctions/isvector/gisvectora.c b/2.3-1/src/c/elementaryFunctions/isvector/gisvectora.c index d2e261e9..758fa879 100644 --- a/2.3-1/src/c/elementaryFunctions/isvector/gisvectora.c +++ b/2.3-1/src/c/elementaryFunctions/isvector/gisvectora.c @@ -16,9 +16,9 @@ #include "isvector.h" #include "types.h" #include "string.h" -char gisvectora(char *inp, int size1) +char gisvectora(char *inp, int row, int col) { - if(size1 ==1) + if(row ==1 || col==1) return 'T'; return 'F'; } diff --git a/2.3-1/src/c/elementaryFunctions/isvector/sisvectora.c b/2.3-1/src/c/elementaryFunctions/isvector/sisvectora.c index 09ad6515..d6a4821b 100644 --- a/2.3-1/src/c/elementaryFunctions/isvector/sisvectora.c +++ b/2.3-1/src/c/elementaryFunctions/isvector/sisvectora.c @@ -15,9 +15,9 @@ #include <math.h> #include "isvector.h" #include "types.h" -char sisvectora(float* inp, int size1) +char sisvectora(float* inp, int row, int col) { - if(size1 ==1) + if(row ==1 || col==1) return 'T'; return 'F'; } diff --git a/2.3-1/src/c/elementaryFunctions/isvector/zisvectora.c b/2.3-1/src/c/elementaryFunctions/isvector/zisvectora.c index fba78124..0ed64a63 100644 --- a/2.3-1/src/c/elementaryFunctions/isvector/zisvectora.c +++ b/2.3-1/src/c/elementaryFunctions/isvector/zisvectora.c @@ -17,9 +17,9 @@ #include "isvector.h" #include "types.h" -char zisvectora(doubleComplex *inp, int size1) +char zisvectora(doubleComplex *inp, int row, int col) { - if(size1 ==1) + if(row ==1 || col==1) return 'T'; return 'F'; } diff --git a/2.3-1/src/c/elementaryFunctions/nanmax/dnanmaxa.c b/2.3-1/src/c/elementaryFunctions/nanmax/dnanmaxa.c new file mode 100644 index 00000000..4ff4a1a8 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/nanmax/dnanmaxa.c @@ -0,0 +1,53 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "nanmax.h" +#include "types.h" +double dnanmaxa(double* in, int size) +{ +double high; +for(int i=0; i<size; i++) +{ + if( !(isnan(in[i])) ) + { + high= in[i]; + break; + + } +} + + + + for(int i=0; i< size; i++) + { + if( !(isnan(in[i])) ) + { + if( in[i] > high) + { + high= in[i]; + + } + + + } + + + } + + + +return high; + +} diff --git a/2.3-1/src/c/elementaryFunctions/nanmax/dnanmaxcola.c b/2.3-1/src/c/elementaryFunctions/nanmax/dnanmaxcola.c new file mode 100644 index 00000000..9db07423 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/nanmax/dnanmaxcola.c @@ -0,0 +1,35 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "nanmax.h" +#include "types.h" +#include "uint16.h" + +void dnanmaxcola(double *in, int row, int col, double* out) +{ + double inter[col]; + + +for(int i=0; i< row; i++) + { + for(int j=0 ; j< col; j++) + { + inter[j]= in[i+ (j*row)]; + + } + out[i]= dnanmaxa( inter, col); + + } + + +} diff --git a/2.3-1/src/c/elementaryFunctions/nanmax/dnanmaxrowa.c b/2.3-1/src/c/elementaryFunctions/nanmax/dnanmaxrowa.c new file mode 100644 index 00000000..191fa012 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/nanmax/dnanmaxrowa.c @@ -0,0 +1,36 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "nanmax.h" +#include "types.h" +#include "uint16.h" + +void dnanmaxrowa(double *in, int row, int col, double* out) +{ + double inter[row]; + + + +for(int i=0; i< col; i++) + { + for(int j=0 ; j< row; j++) + { + inter[j]= in[j+ (i*row)]; + + } + out[i]= dnanmaxa( inter, row); + + } + + +} diff --git a/2.3-1/src/c/elementaryFunctions/nanmax/snanmaxa.c b/2.3-1/src/c/elementaryFunctions/nanmax/snanmaxa.c new file mode 100644 index 00000000..1eab1ac1 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/nanmax/snanmaxa.c @@ -0,0 +1,53 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "nanmax.h" +#include "types.h" +float snanmaxa(float* in, int size) +{ +float high; +for(int i=0; i<size; i++) +{ + if( !(isnan(in[i])) ) + { + high= in[i]; + break; + + } +} + + + + for(int i=0; i< size; i++) + { + if( !(isnan(in[i])) ) + { + if( in[i] > high) + { + high= in[i]; + + } + + + } + + + } + + + +return high; + +} diff --git a/2.3-1/src/c/elementaryFunctions/nanmax/snanmaxcola.c b/2.3-1/src/c/elementaryFunctions/nanmax/snanmaxcola.c new file mode 100644 index 00000000..b4080525 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/nanmax/snanmaxcola.c @@ -0,0 +1,35 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "nanmax.h" +#include "types.h" +#include "uint16.h" + +void snanmaxcola(float *in, int row, int col, float* out) +{ + float inter[col]; + + +for(int i=0; i< row; i++) + { + for(int j=0 ; j< col; j++) + { + inter[j]= in[i+ (j*row)]; + + } + out[i]= snanmaxa( inter, col); + + } + + +} diff --git a/2.3-1/src/c/elementaryFunctions/nanmax/snanmaxrowa.c b/2.3-1/src/c/elementaryFunctions/nanmax/snanmaxrowa.c new file mode 100644 index 00000000..ab1ce0cb --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/nanmax/snanmaxrowa.c @@ -0,0 +1,36 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "nanmax.h" +#include "types.h" +#include "uint16.h" + +void snanmaxrowa(float *in, int row, int col, float* out) +{ + float inter[row]; + + + +for(int i=0; i< col; i++) + { + for(int j=0 ; j< row; j++) + { + inter[j]= in[j+ (i*row)]; + + } + out[i]= snanmaxa( inter, row); + + } + + +} diff --git a/2.3-1/src/c/elementaryFunctions/nanmax/znanmaxa.c b/2.3-1/src/c/elementaryFunctions/nanmax/znanmaxa.c new file mode 100644 index 00000000..6283bf16 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/nanmax/znanmaxa.c @@ -0,0 +1,57 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "nanmax.h" +#include "types.h" +#include "doubleComplex.h" +#include "abs.h" + +doubleComplex znanmaxa(doubleComplex* in, int size) +{ +doubleComplex high=0; int k=0; +for(int i=0; i<size; i++) +{ + if( !(isnan(in[i])) ) + { + high= in[i]; + break; + k= 1; + } +} + + + + for(int i=0; i< size; i++) + { + if( !(isnan(in[i])) ) + { + if( zabss(in[i]) > zabss(high)) + { + high= in[i]; + + } + + + } + + + } + + +if(k != 0) +return high; +else +return - 0.0/0.0; +} diff --git a/2.3-1/src/c/elementaryFunctions/nanmax/znanmaxcola.c b/2.3-1/src/c/elementaryFunctions/nanmax/znanmaxcola.c new file mode 100644 index 00000000..ffb96b20 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/nanmax/znanmaxcola.c @@ -0,0 +1,36 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "nanmax.h" +#include "types.h" +#include "uint16.h" +#include "doubleComplex.h" + +void znanmaxcola(doubleComplex *in, int row, int col, doubleComplex* out) +{ + doubleComplex inter[col]; + + +for(int i=0; i< row; i++) + { + for(int j=0 ; j< col; j++) + { + inter[j]= in[i+ (j*row)]; + + } + out[i]= znanmaxa( inter, col); + + } + + +} diff --git a/2.3-1/src/c/elementaryFunctions/nanmax/znanmaxrowa.c b/2.3-1/src/c/elementaryFunctions/nanmax/znanmaxrowa.c new file mode 100644 index 00000000..e035e778 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/nanmax/znanmaxrowa.c @@ -0,0 +1,37 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "nanmax.h" +#include "types.h" +#include "uint16.h" +#include "doubleComplex.h" + +void znanmaxrowa(doubleComplex *in, int row, int col, doubleComplex* out) +{ + doubleComplex inter[row]; + + + +for(int i=0; i< col; i++) + { + for(int j=0 ; j< row; j++) + { + inter[j]= in[j+ (i*row)]; + + } + out[i]= znanmaxa( inter, row); + + } + + +} diff --git a/2.3-1/src/c/elementaryFunctions/pmodulo/dpmoduloa.c b/2.3-1/src/c/elementaryFunctions/pmodulo/dpmoduloa.c new file mode 100644 index 00000000..0817987a --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/pmodulo/dpmoduloa.c @@ -0,0 +1,32 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "pmodulo.h" +#include "types.h" +void dpmoduloa(double* inp1, int size, double* inp2, double* out) +{ + + + for(int i=0; i< size; i++) + { + + out[i]= dpmodulos(inp1[i], inp2[i]); + + } + + + + +} diff --git a/2.3-1/src/c/elementaryFunctions/pmodulo/dpmodulos.c b/2.3-1/src/c/elementaryFunctions/pmodulo/dpmodulos.c new file mode 100644 index 00000000..61441777 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/pmodulo/dpmodulos.c @@ -0,0 +1,54 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "pmodulo.h" +#include "types.h" + +double dpmodulos(double inp1, double inp2) +{ + if( inp1>0 && inp2>0) + + { + return fmod(inp1,inp2); + + } + + + if( inp1>0 && inp2<0) + + { + + return fmod(inp1,inp2); + + } + + + if(inp1<0 && inp2>0) + + { + + return ((fmod(inp1,inp2))+(inp2)); + + + } + + if(inp1<0 && inp2<0) + { + + return ((fmod(inp1,inp2))-(inp2)); + + } + +} diff --git a/2.3-1/src/c/elementaryFunctions/pmodulo/i16pmoduloa.c b/2.3-1/src/c/elementaryFunctions/pmodulo/i16pmoduloa.c new file mode 100644 index 00000000..bb76d7ff --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/pmodulo/i16pmoduloa.c @@ -0,0 +1,33 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "int16.h" +#include "pmodulo.h" +#include "types.h" +void i16pmoduloa(int16* inp1, int size, int16* inp2, int16* out) +{ + + + for(int i=0; i< size; i++) + { + + out[i]= i16pmodulos(inp1[i], inp2[i]); + + } + + + + +} diff --git a/2.3-1/src/c/elementaryFunctions/pmodulo/i16pmodulos.c b/2.3-1/src/c/elementaryFunctions/pmodulo/i16pmodulos.c new file mode 100644 index 00000000..f7f86c5b --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/pmodulo/i16pmodulos.c @@ -0,0 +1,55 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "int16.h" +#include "pmodulo.h" +#include "types.h" + +int16 i16pmodulos(int16 inp1, int16 inp2) +{ + if( inp1>0 && inp2>0) + + { + return inp1%inp2; + + } + + + if( inp1>0 && inp2<0) + + { + + return inp1%inp2; + + } + + + if(inp1<0 && inp2>0) + + { + + return ((inp1%inp2)+(inp2)); + + + } + + if(inp1<0 && inp2<0) + { + + return ((inp1%inp2)-(inp2)); + + } + +} diff --git a/2.3-1/src/c/elementaryFunctions/pmodulo/spmoduloa.c b/2.3-1/src/c/elementaryFunctions/pmodulo/spmoduloa.c new file mode 100644 index 00000000..87b2a2fb --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/pmodulo/spmoduloa.c @@ -0,0 +1,32 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "pmodulo.h" +#include "types.h" +void spmoduloa(float* inp1, int size, float* inp2, float* out) +{ + + + for(int i=0; i< size; i++) + { + + out[i]= spmodulos(inp1[i], inp2[i]); + + } + + + + +} diff --git a/2.3-1/src/c/elementaryFunctions/pmodulo/spmodulos.c b/2.3-1/src/c/elementaryFunctions/pmodulo/spmodulos.c new file mode 100644 index 00000000..9ab6bc49 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/pmodulo/spmodulos.c @@ -0,0 +1,54 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "pmodulo.h" +#include "types.h" + +float spmodulos(float inp1, float inp2) +{ + if( inp1>0 && inp2>0) + + { + return fmod(inp1,inp2); + + } + + + if( inp1>0 && inp2<0) + + { + + return fmod(inp1,inp2); + + } + + + if(inp1<0 && inp2>0) + + { + + return ((fmod(inp1,inp2))+(inp2)); + + + } + + if(inp1<0 && inp2<0) + { + + return ((fmod(inp1,inp2))-(inp2)); + + } + +} |