From 9a70aa3ff473b7bc72d849c2cc2ecece57d4c388 Mon Sep 17 00:00:00 2001 From: Abhinav Dronamraju Date: Fri, 14 Jul 2017 16:30:11 +0530 Subject: Isvector and NNZ added --- includes/sci2clib.h | 6 ++ jar/scilab_en_US_help.jar | Bin 0 -> 11210 bytes macros/ASTManagement/lib | Bin 2008 -> 1956 bytes macros/CCodeGeneration/lib | Bin 1056 -> 1004 bytes macros/ErrorMessages/lib | Bin 520 -> 468 bytes macros/FunctionAnnotation/lib | Bin 2412 -> 2360 bytes macros/FunctionList/lib | Bin 588 -> 536 bytes macros/GeneralFunctions/lib | Bin 1132 -> 1080 bytes macros/Hardware/AVR/lib | Bin 972 -> 920 bytes macros/Hardware/RasberryPi/lib | Bin 976 -> 924 bytes macros/ImageProcessing/core/lib | Bin 524 -> 472 bytes macros/ImageProcessing/highgui/lib | Bin 584 -> 532 bytes macros/ImageProcessing/imgproc/lib | Bin 752 -> 700 bytes macros/Scilab-Arduino/lib | Bin 716 -> 664 bytes macros/SymbolTable/lib | Bin 752 -> 700 bytes .../ToolInitialization/INIT_FillSCI2LibCDirs.sci | 77 +++++++++++++++++---- macros/ToolInitialization/lib | Bin 804 -> 752 bytes macros/findDeps/getAllHeaders.sci | 2 + macros/findDeps/getAllInterfaces.sci | 2 + macros/findDeps/getAllSources.sci | 14 ++++ macros/findDeps/lib | Bin 620 -> 568 bytes macros/lib | Bin 536 -> 484 bytes src/c/elementaryFunctions/includes/isvector.h | 38 ++++++++++ .../elementaryFunctions/interfaces/int_isvector.h | 26 +++++++ src/c/elementaryFunctions/isvector/disvectora.c | 23 ++++++ src/c/elementaryFunctions/isvector/disvectors.c | 24 +++++++ src/c/elementaryFunctions/isvector/gisvectora.c | 24 +++++++ src/c/elementaryFunctions/isvector/gisvectors.c | 24 +++++++ src/c/elementaryFunctions/isvector/sisvectora.c | 23 ++++++ src/c/elementaryFunctions/isvector/sisvectors.c | 24 +++++++ src/c/elementaryFunctions/isvector/zisvectora.c | 25 +++++++ src/c/elementaryFunctions/isvector/zisvectors.c | 25 +++++++ src/c/matrixOperations/includes/nnz.h | 37 ++++++++++ src/c/matrixOperations/interfaces/int_nnz.h | 35 ++++++++++ src/c/matrixOperations/nnz/dnnza.c | 33 +++++++++ src/c/matrixOperations/nnz/dnnzs.c | 25 +++++++ src/c/matrixOperations/nnz/snnza.c | 33 +++++++++ src/c/matrixOperations/nnz/snnzs.c | 25 +++++++ src/c/matrixOperations/nnz/znnza.c | 33 +++++++++ src/c/matrixOperations/nnz/znnzs.c | 26 +++++++ 40 files changed, 592 insertions(+), 12 deletions(-) create mode 100644 jar/scilab_en_US_help.jar create mode 100644 src/c/elementaryFunctions/includes/isvector.h create mode 100644 src/c/elementaryFunctions/interfaces/int_isvector.h create mode 100644 src/c/elementaryFunctions/isvector/disvectora.c create mode 100644 src/c/elementaryFunctions/isvector/disvectors.c create mode 100644 src/c/elementaryFunctions/isvector/gisvectora.c create mode 100644 src/c/elementaryFunctions/isvector/gisvectors.c create mode 100644 src/c/elementaryFunctions/isvector/sisvectora.c create mode 100644 src/c/elementaryFunctions/isvector/sisvectors.c create mode 100644 src/c/elementaryFunctions/isvector/zisvectora.c create mode 100644 src/c/elementaryFunctions/isvector/zisvectors.c create mode 100644 src/c/matrixOperations/includes/nnz.h create mode 100644 src/c/matrixOperations/interfaces/int_nnz.h create mode 100644 src/c/matrixOperations/nnz/dnnza.c create mode 100644 src/c/matrixOperations/nnz/dnnzs.c create mode 100644 src/c/matrixOperations/nnz/snnza.c create mode 100644 src/c/matrixOperations/nnz/snnzs.c create mode 100644 src/c/matrixOperations/nnz/znnza.c create mode 100644 src/c/matrixOperations/nnz/znnzs.c diff --git a/includes/sci2clib.h b/includes/sci2clib.h index b070a904..47bf1c78 100644 --- a/includes/sci2clib.h +++ b/includes/sci2clib.h @@ -172,6 +172,9 @@ extern "C" { /*interfacing isscalar*/ #include "isscalar.h" #include "int_isscalar.h" +/*interfacing isvector*/ +#include "isvector.h" +#include "int_isvector.h" /*interfacing iscolumn*/ #include "iscolumn.h" #include "int_iscolumn.h" @@ -451,6 +454,9 @@ extern "C" { /*interfacing matrix*/ #include "int_matrix.h" #include "matrix.h" +/*interfacing nnz*/ +#include "int_nnz.h" +#include "nnz.h" /*interfacing cumprod*/ #include "int_cumprod.h" #include "cumprod.h" diff --git a/jar/scilab_en_US_help.jar b/jar/scilab_en_US_help.jar new file mode 100644 index 00000000..beb9c10b Binary files /dev/null and b/jar/scilab_en_US_help.jar differ diff --git a/macros/ASTManagement/lib b/macros/ASTManagement/lib index 5978ea72..e9d351a5 100644 Binary files a/macros/ASTManagement/lib and b/macros/ASTManagement/lib differ diff --git a/macros/CCodeGeneration/lib b/macros/CCodeGeneration/lib index 31819793..f2696fef 100644 Binary files a/macros/CCodeGeneration/lib and b/macros/CCodeGeneration/lib differ diff --git a/macros/ErrorMessages/lib b/macros/ErrorMessages/lib index 794d4c01..1500b1fa 100644 Binary files a/macros/ErrorMessages/lib and b/macros/ErrorMessages/lib differ diff --git a/macros/FunctionAnnotation/lib b/macros/FunctionAnnotation/lib index bb1f47c6..5eb9bc2f 100644 Binary files a/macros/FunctionAnnotation/lib and b/macros/FunctionAnnotation/lib differ diff --git a/macros/FunctionList/lib b/macros/FunctionList/lib index c3274f18..e101853b 100644 Binary files a/macros/FunctionList/lib and b/macros/FunctionList/lib differ diff --git a/macros/GeneralFunctions/lib b/macros/GeneralFunctions/lib index 1cf5c1f5..846ca1b2 100644 Binary files a/macros/GeneralFunctions/lib and b/macros/GeneralFunctions/lib differ diff --git a/macros/Hardware/AVR/lib b/macros/Hardware/AVR/lib index 069c520e..53e56599 100644 Binary files a/macros/Hardware/AVR/lib and b/macros/Hardware/AVR/lib differ diff --git a/macros/Hardware/RasberryPi/lib b/macros/Hardware/RasberryPi/lib index 4c85475b..dc759fe8 100644 Binary files a/macros/Hardware/RasberryPi/lib and b/macros/Hardware/RasberryPi/lib differ diff --git a/macros/ImageProcessing/core/lib b/macros/ImageProcessing/core/lib index d80305c4..7f003c8e 100644 Binary files a/macros/ImageProcessing/core/lib and b/macros/ImageProcessing/core/lib differ diff --git a/macros/ImageProcessing/highgui/lib b/macros/ImageProcessing/highgui/lib index 1e7f7507..787c25fa 100644 Binary files a/macros/ImageProcessing/highgui/lib and b/macros/ImageProcessing/highgui/lib differ diff --git a/macros/ImageProcessing/imgproc/lib b/macros/ImageProcessing/imgproc/lib index a83978b5..93c83909 100644 Binary files a/macros/ImageProcessing/imgproc/lib and b/macros/ImageProcessing/imgproc/lib differ diff --git a/macros/Scilab-Arduino/lib b/macros/Scilab-Arduino/lib index f3d5b2fc..5b7beab0 100644 Binary files a/macros/Scilab-Arduino/lib and b/macros/Scilab-Arduino/lib differ diff --git a/macros/SymbolTable/lib b/macros/SymbolTable/lib index e66158d4..c42cf1a5 100644 Binary files a/macros/SymbolTable/lib and b/macros/SymbolTable/lib differ diff --git a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci index 7dcae8a8..2af61403 100644 --- a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci +++ b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci @@ -1047,6 +1047,39 @@ PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file', INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun); INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun); + +// ------------------- +// --- Class Isvector. --- +// ------------------- +ClassName = 'Isvector'; + +// --- 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'); +//Was FA_TP_USER +//Cause some trouble if user specify some precision and if input(and also output) is complex. +PrintStringInfo('OUT(1).TP= ''g''',ClassFileName,'file','y'); +PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y'); +PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y'); +//---Function list class. ---- +ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls); +PrintStringInfo('d0'+ArgSeparator+'g0',ClassFileName,'file','y'); +PrintStringInfo('d2'+ArgSeparator+'g0',ClassFileName,'file','y'); +PrintStringInfo('s2'+ArgSeparator+'g0',ClassFileName,'file','y'); +PrintStringInfo('s0'+ArgSeparator+'g0',ClassFileName,'file','y'); +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'); + +// --- Annotation Function And Function List Function. --- +FunctionName = 'isvector'; +PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y'); +INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun); +INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun); + // ------------------- // --- Class Iscolumn. --- // ------------------- @@ -7118,30 +7151,50 @@ PrintStringInfo('OUT(1).SZ(2)= IN(3).VAL',ClassFileName,'file','y'); ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls); PrintStringInfo('d2d0d0'+ArgSeparator+'d2',ClassFileName,'file','y'); PrintStringInfo('d2s0s0'+ArgSeparator+'d2',ClassFileName,'file','y'); -PrintStringInfo('d2u160u160'+ArgSeparator+'d2',ClassFileName,'file','y'); -PrintStringInfo('d2u80u80'+ArgSeparator+'d2',ClassFileName,'file','y'); PrintStringInfo('z2d0d0'+ArgSeparator+'z2',ClassFileName,'file','y'); PrintStringInfo('z2s0s0'+ArgSeparator+'z2',ClassFileName,'file','y'); - PrintStringInfo('s2d0d0'+ArgSeparator+'s2',ClassFileName,'file','y'); PrintStringInfo('s2s0s0'+ArgSeparator+'s2',ClassFileName,'file','y'); -PrintStringInfo('s2u160u160'+ArgSeparator+'s2',ClassFileName,'file','y'); -PrintStringInfo('s2u80u80'+ArgSeparator+'s2',ClassFileName,'file','y'); -PrintStringInfo('u162'+ArgSeparator+'u162',ClassFileName,'file','y'); -PrintStringInfo('i162'+ArgSeparator+'i162',ClassFileName,'file','y'); - PrintStringInfo('u162d0d0'+ArgSeparator+'u162',ClassFileName,'file','y'); PrintStringInfo('u162s0s0'+ArgSeparator+'u162',ClassFileName,'file','y'); -PrintStringInfo('u82g2'+ArgSeparator+'u82',ClassFileName,'file','y'); -PrintStringInfo('i82g2'+ArgSeparator+'i82',ClassFileName,'file','y'); -PrintStringInfo('u162g2'+ArgSeparator+'u162',ClassFileName,'file','y'); -PrintStringInfo('i162g2'+ArgSeparator+'i162',ClassFileName,'file','y'); + // --- Annotation Function And Function List Function. --- FunctionName = 'matrix'; PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y'); INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun); INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun); +//------------------------------------ +//---- Class NNZ--------------------- +//------------------------------------ +ClassName = 'NNZ'; + +// --- Class Annotation. --- +PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y'); +ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls); + +//Arguements specified: initial value, start time, time vector, ode function +PrintStringInfo('NIN= 1',ClassFileName,'file','y'); +PrintStringInfo('NOUT= 1',ClassFileName,'file','y'); +PrintStringInfo('OUT(1).TP= ''u16''',ClassFileName,'file','y'); +PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y'); +PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y'); + +// --- Function List Class. --- +ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls); +PrintStringInfo('d2'+ArgSeparator+'u160',ClassFileName,'file','y'); +PrintStringInfo('d0'+ArgSeparator+'u160',ClassFileName,'file','y'); +PrintStringInfo('z2'+ArgSeparator+'u160',ClassFileName,'file','y'); +PrintStringInfo('z0'+ArgSeparator+'u160',ClassFileName,'file','y'); +PrintStringInfo('s2'+ArgSeparator+'u160',ClassFileName,'file','y'); +PrintStringInfo('s0'+ArgSeparator+'u160',ClassFileName,'file','y'); + +// --- Annotation Function And Function List Function. --- +FunctionName = 'nnz'; +PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y'); +INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun); +INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun); + //------------------------------------ //---- Class TRIU --------------------- diff --git a/macros/ToolInitialization/lib b/macros/ToolInitialization/lib index 670a52e0..267c9c9f 100644 Binary files a/macros/ToolInitialization/lib and b/macros/ToolInitialization/lib differ diff --git a/macros/findDeps/getAllHeaders.sci b/macros/findDeps/getAllHeaders.sci index 67444f93..986829ea 100644 --- a/macros/findDeps/getAllHeaders.sci +++ b/macros/findDeps/getAllHeaders.sci @@ -66,6 +66,7 @@ function allHeaders = getAllHeaders(SharedInfo) "src/c/matrixOperations/includes/diag.h" "src/c/matrixOperations/includes/cumsum.h" "src/c/matrixOperations/includes/matrix.h" + "src/c/matrixOperations/includes/nnz.h" "src/c/matrixOperations/includes/cumprod.h" "src/c/matrixOperations/includes/triu.h" "src/c/matrixOperations/includes/tril.h" @@ -133,6 +134,7 @@ function allHeaders = getAllHeaders(SharedInfo) "src/c/elementaryFunctions/includes/nthroot.h" "src/c/elementaryFunctions/includes/issquare.h" "src/c/elementaryFunctions/includes/isscalar.h" + "src/c/elementaryFunctions/includes/isvector.h" "src/c/elementaryFunctions/includes/iscolumn.h" "src/c/elementaryFunctions/includes/ismatrix.h" "src/c/elementaryFunctions/includes/asind.h" diff --git a/macros/findDeps/getAllInterfaces.sci b/macros/findDeps/getAllInterfaces.sci index da910a0e..02c671f2 100644 --- a/macros/findDeps/getAllInterfaces.sci +++ b/macros/findDeps/getAllInterfaces.sci @@ -54,6 +54,7 @@ function allInterfaces = getAllInterfaces(SharedInfo) "src/c/matrixOperations/interfaces/int_diag.h" "src/c/matrixOperations/interfaces/int_cumsum.h" "src/c/matrixOperations/interfaces/int_matrix.h" + "src/c/matrixOperations/interfaces/int_nnz.h" "src/c/matrixOperations/interfaces/int_cumprod.h" "src/c/matrixOperations/interfaces/int_triu.h" "src/c/matrixOperations/interfaces/int_tril.h" @@ -104,6 +105,7 @@ function allInterfaces = getAllInterfaces(SharedInfo) "src/c/elementaryFunctions/interfaces/int_nthroot.h" "src/c/elementaryFunctions/interfaces/int_issquare.h" "src/c/elementaryFunctions/interfaces/int_isscalar.h" + "src/c/elementaryFunctions/interfaces/int_isvector.h" "src/c/elementaryFunctions/interfaces/int_iscolumn.h" "src/c/elementaryFunctions/interfaces/int_ismatrix.h" "src/c/elementaryFunctions/interfaces/int_logspace.h" diff --git a/macros/findDeps/getAllSources.sci b/macros/findDeps/getAllSources.sci index 3422a955..6b2495de 100644 --- a/macros/findDeps/getAllSources.sci +++ b/macros/findDeps/getAllSources.sci @@ -308,6 +308,12 @@ function allSources = getAllSources(SharedInfo,BuildTool) "src/c/matrixOperations/matrix/smatrixa.c" "src/c/matrixOperations/matrix/u16matrixa.c" "src/c/matrixOperations/matrix/zmatrixa.c" + "src/c/matrixOperations/nnz/dnnza.c" + "src/c/matrixOperations/nnz/dnnzs.c" + "src/c/matrixOperations/nnz/snnza.c" + "src/c/matrixOperations/nnz/snnzs.c" + "src/c/matrixOperations/nnz/znnza.c" + "src/c/matrixOperations/nnz/znnzs.c" "src/c/matrixOperations/triu/dtriua.c" "src/c/matrixOperations/triu/striua.c" "src/c/matrixOperations/triu/u8triua.c" @@ -816,6 +822,14 @@ function allSources = getAllSources(SharedInfo,BuildTool) "src/c/elementaryFunctions/iscolumn/ziscolumns.c" "src/c/elementaryFunctions/iscolumn/u16iscolumna.c" "src/c/elementaryFunctions/iscolumn/u16iscolumns.c" + "src/c/elementaryFunctions/isvector/disvectora.c" + "src/c/elementaryFunctions/isvector/disvectors.c" + "src/c/elementaryFunctions/isvector/gisvectors.c" + "src/c/elementaryFunctions/isvector/gisvectora.c" + "src/c/elementaryFunctions/isvector/sisvectors.c" + "src/c/elementaryFunctions/isvector/sisvectora.c" + "src/c/elementaryFunctions/isvector/zisvectora.c" + "src/c/elementaryFunctions/isvector/zisvectors.c" "src/c/elementaryFunctions/ismatrix/dismatrixa.c" "src/c/elementaryFunctions/ismatrix/dismatrixs.c" //"src/c/elementaryFunctions/ismatrix/gismatrixs.c" diff --git a/macros/findDeps/lib b/macros/findDeps/lib index afcd3cab..69c3c0e1 100644 Binary files a/macros/findDeps/lib and b/macros/findDeps/lib differ diff --git a/macros/lib b/macros/lib index 551263ea..f759663f 100644 Binary files a/macros/lib and b/macros/lib differ diff --git a/src/c/elementaryFunctions/includes/isvector.h b/src/c/elementaryFunctions/includes/isvector.h new file mode 100644 index 00000000..5f45abbe --- /dev/null +++ b/src/c/elementaryFunctions/includes/isvector.h @@ -0,0 +1,38 @@ +/* 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 __ISVECTOR_H__ +#define __ISVECTOR_H__ + + +#include "types.h" +#include "doubleComplex.h" +#include "floatComplex.h" + +#ifdef __cplusplus +extern "C" { +#endif + +char disvectora(double* , int); +char disvectors(double); +char sisvectora( float* , int); +char sisvectors( float); +char gisvectora(char* , int); +char gisvectors(char); +char zisvectora(doubleComplex*, int); +char zisvectors(doubleComplex); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/c/elementaryFunctions/interfaces/int_isvector.h b/src/c/elementaryFunctions/interfaces/int_isvector.h new file mode 100644 index 00000000..6d943bd3 --- /dev/null +++ b/src/c/elementaryFunctions/interfaces/int_isvector.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_ISVECTOR_H__ +#define __INT_ISVECTOR_H__ + +#define d2isvectorg0(in, size ) disvectora(in, size[0]) +#define d0isvectorg0(in) disvectors(in) +#define s2isvectorg0(in , size) sisvectora(in, size[0]) +#define s0isvectorg0(in) sisvectors(in) +#define g2isvectorg0(in, size) gisvectora(in, size[0]) +#define g0isvectorg0(in) gisvectors(in) +#define z2isvectorg0(in, size) zisvectora(in , size[0]) +#define z0isvectorg0(in) zisvectors(in) + + +#endif diff --git a/src/c/elementaryFunctions/isvector/disvectora.c b/src/c/elementaryFunctions/isvector/disvectora.c new file mode 100644 index 00000000..3c41027f --- /dev/null +++ b/src/c/elementaryFunctions/isvector/disvectora.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 +#include +#include +#include "isvector.h" +#include "types.h" +char disvectora(double* inp, int size1) +{ + if(size1 ==1) + return 'T'; + return 'F'; +} diff --git a/src/c/elementaryFunctions/isvector/disvectors.c b/src/c/elementaryFunctions/isvector/disvectors.c new file mode 100644 index 00000000..703e6673 --- /dev/null +++ b/src/c/elementaryFunctions/isvector/disvectors.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 +#include +#include +#include "isvector.h" +#include "types.h" + +char disvectors(double inp) +{ + double out='F'; + + return out; +} diff --git a/src/c/elementaryFunctions/isvector/gisvectora.c b/src/c/elementaryFunctions/isvector/gisvectora.c new file mode 100644 index 00000000..d2e261e9 --- /dev/null +++ b/src/c/elementaryFunctions/isvector/gisvectora.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 +#include +#include +#include "isvector.h" +#include "types.h" +#include "string.h" +char gisvectora(char *inp, int size1) +{ + if(size1 ==1) + return 'T'; + return 'F'; +} diff --git a/src/c/elementaryFunctions/isvector/gisvectors.c b/src/c/elementaryFunctions/isvector/gisvectors.c new file mode 100644 index 00000000..72118603 --- /dev/null +++ b/src/c/elementaryFunctions/isvector/gisvectors.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 +#include +#include +#include "isvector.h" +#include "types.h" + +char gisvectors(char inp) +{ + char out='F'; + + return out; +} diff --git a/src/c/elementaryFunctions/isvector/sisvectora.c b/src/c/elementaryFunctions/isvector/sisvectora.c new file mode 100644 index 00000000..09ad6515 --- /dev/null +++ b/src/c/elementaryFunctions/isvector/sisvectora.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 +#include +#include +#include "isvector.h" +#include "types.h" +char sisvectora(float* inp, int size1) +{ + if(size1 ==1) + return 'T'; + return 'F'; +} diff --git a/src/c/elementaryFunctions/isvector/sisvectors.c b/src/c/elementaryFunctions/isvector/sisvectors.c new file mode 100644 index 00000000..019bd464 --- /dev/null +++ b/src/c/elementaryFunctions/isvector/sisvectors.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 +#include +#include +#include "isvector.h" +#include "types.h" + +char sisvectors(float inp) +{ + char out='F'; + + return out; +} diff --git a/src/c/elementaryFunctions/isvector/zisvectora.c b/src/c/elementaryFunctions/isvector/zisvectora.c new file mode 100644 index 00000000..fba78124 --- /dev/null +++ b/src/c/elementaryFunctions/isvector/zisvectora.c @@ -0,0 +1,25 @@ +/* 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 +#include +#include +#include "doubleComplex.h" +#include "isvector.h" +#include "types.h" + +char zisvectora(doubleComplex *inp, int size1) +{ + if(size1 ==1) + return 'T'; + return 'F'; +} diff --git a/src/c/elementaryFunctions/isvector/zisvectors.c b/src/c/elementaryFunctions/isvector/zisvectors.c new file mode 100644 index 00000000..bc9e5ce6 --- /dev/null +++ b/src/c/elementaryFunctions/isvector/zisvectors.c @@ -0,0 +1,25 @@ +/* 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 +#include +#include +#include "isvector.h" +#include "types.h" +#include "doubleComplex.h" + +char zisvectors(doubleComplex inp) +{ + char out='F'; + + return out; +} diff --git a/src/c/matrixOperations/includes/nnz.h b/src/c/matrixOperations/includes/nnz.h new file mode 100644 index 00000000..c7d2d491 --- /dev/null +++ b/src/c/matrixOperations/includes/nnz.h @@ -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 +*/ + + +#ifndef __NNZ_H__ +#define __NNZ_H__ + +#include "types.h" +#include "doubleComplex.h" +#include "uint16.h" + +#ifdef __cplusplus +extern "C" { +#endif + +uint16 dnnza(double* , int , int); +uint16 dnnzs(double); +uint16 snnza( float* , int , int); +uint16 snnzs( float); +uint16 znnza(doubleComplex *, int , int); +uint16 znnzs(doubleComplex); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__NNZ_H__*/ diff --git a/src/c/matrixOperations/interfaces/int_nnz.h b/src/c/matrixOperations/interfaces/int_nnz.h new file mode 100644 index 00000000..0ef39536 --- /dev/null +++ b/src/c/matrixOperations/interfaces/int_nnz.h @@ -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 +*/ + +#ifndef __INT_NNZ_H__ +#define __INT_NNZ_H__ + + +#ifdef __cplusplus +extern "C" { +#endif + +#define d2nnzu160(in1, size) dnnza(in1, size[0], size[1]) +#define d0nnzu160(in) dnnzs(in) + +#define s2nnzu160(in1, size) snnza(in1, size[0], size[1]) +#define s0nnzu160(in) snnzs(in) + +#define z2nnzu160(in1, size) znnza(in1, size[0], size[1]) +#define z0nnzu160(in) znnzs(in) + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_NNZ_H__*/ diff --git a/src/c/matrixOperations/nnz/dnnza.c b/src/c/matrixOperations/nnz/dnnza.c new file mode 100644 index 00000000..b4d40bd8 --- /dev/null +++ b/src/c/matrixOperations/nnz/dnnza.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 +*/ + +/*Function returns cumulative sum of members of array/matrix*/ + +#include "nnz.h" +#include "types.h" +#include "uint16.h" + +uint16 dnnza(double *in, int irow, int icolumn) +{ + int i; + uint16 final=0; + for(i=0; i< irow*icolumn ; i++) + { + if( in[i] != 0) + { + final++; + + } + + } +return final; +} diff --git a/src/c/matrixOperations/nnz/dnnzs.c b/src/c/matrixOperations/nnz/dnnzs.c new file mode 100644 index 00000000..c878d331 --- /dev/null +++ b/src/c/matrixOperations/nnz/dnnzs.c @@ -0,0 +1,25 @@ +/* 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 +*/ + +/*Function returns cumulative sum of members of array/matrix*/ + +#include "nnz.h" +#include "types.h" +#include "uint16.h" + +uint16 dnnzs(double in) +{ + if(in !=0) + return 1; + else + return 0; +} diff --git a/src/c/matrixOperations/nnz/snnza.c b/src/c/matrixOperations/nnz/snnza.c new file mode 100644 index 00000000..df27f0fe --- /dev/null +++ b/src/c/matrixOperations/nnz/snnza.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 +*/ + +/*Function returns cumulative sum of members of array/matrix*/ + +#include "nnz.h" +#include "types.h" +#include "uint16.h" + +uint16 snnza(float*in, int irow, int icolumn) +{ + int i; + uint16 final=0; + for(i=0; i< irow*icolumn ; i++) + { + if( in[i] != 0) + { + final++; + + } + + } +return final; +} diff --git a/src/c/matrixOperations/nnz/snnzs.c b/src/c/matrixOperations/nnz/snnzs.c new file mode 100644 index 00000000..674d4fac --- /dev/null +++ b/src/c/matrixOperations/nnz/snnzs.c @@ -0,0 +1,25 @@ +/* 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 +*/ + +/*Function returns cumulative sum of members of array/matrix*/ + +#include "nnz.h" +#include "types.h" +#include "uint16.h" + +uint16 snnzs(float in) +{ + if(in !=0) + return 1; + else + return 0; +} diff --git a/src/c/matrixOperations/nnz/znnza.c b/src/c/matrixOperations/nnz/znnza.c new file mode 100644 index 00000000..3b913e8b --- /dev/null +++ b/src/c/matrixOperations/nnz/znnza.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 +*/ + +/*Function returns cumulative sum of members of array/matrix*/ + +#include "nnz.h" +#include "types.h" +#include "uint16.h" +#include "doubleComplex.h" +uint16 znnza(doubleComplex* in, int irow, int icolumn) +{ + int i; + uint16 final=0; + for(i=0; i< irow*icolumn ; i++) + { + if(( zreals(in[i]) !=0 )||( zimags(in[i])!=0)) + { + final++; + + } + + } +return final; +} diff --git a/src/c/matrixOperations/nnz/znnzs.c b/src/c/matrixOperations/nnz/znnzs.c new file mode 100644 index 00000000..2907afcf --- /dev/null +++ b/src/c/matrixOperations/nnz/znnzs.c @@ -0,0 +1,26 @@ +/* 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 +*/ + +/*Function returns cumulative sum of members of array/matrix*/ + +#include "nnz.h" +#include "types.h" +#include "uint16.h" +#include "doubleComplex.h" + +uint16 znnzs(doubleComplex in) +{ + if((zreals(in)== 0 ) && (zimags(in)==0)) + return 0; + else + return 1; +} -- cgit