diff options
-rw-r--r-- | demos/Abhinav_Demos/test_pertrans.sci | 31 | ||||
-rw-r--r-- | includes/sci2clib.h | 3 | ||||
-rw-r--r-- | jar/scilab_en_US_help.jar | bin | 11210 -> 11210 bytes | |||
-rw-r--r-- | macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci | 33 | ||||
-rw-r--r-- | macros/findDeps/getAllHeaders.sci | 1 | ||||
-rw-r--r-- | macros/findDeps/getAllInterfaces.sci | 1 | ||||
-rw-r--r-- | macros/findDeps/getAllSources.sci | 7 | ||||
-rw-r--r-- | src/c/matrixOperations/includes/pertrans.h | 38 | ||||
-rw-r--r-- | src/c/matrixOperations/interfaces/int_pertrans.h | 34 | ||||
-rw-r--r-- | src/c/matrixOperations/pertrans/dpertransa.c | 36 | ||||
-rw-r--r-- | src/c/matrixOperations/pertrans/dpertranss.c | 23 | ||||
-rw-r--r-- | src/c/matrixOperations/pertrans/spertransa.c | 36 | ||||
-rw-r--r-- | src/c/matrixOperations/pertrans/spertranss.c | 23 | ||||
-rw-r--r-- | src/c/matrixOperations/pertrans/zpertransa.c | 37 | ||||
-rw-r--r-- | src/c/matrixOperations/pertrans/zpertranss.c | 24 | ||||
-rw-r--r-- | src/c/signalProcessing/hank/dhanka.c | 6 |
16 files changed, 332 insertions, 1 deletions
diff --git a/demos/Abhinav_Demos/test_pertrans.sci b/demos/Abhinav_Demos/test_pertrans.sci new file mode 100644 index 0000000..a84f725 --- /dev/null +++ b/demos/Abhinav_Demos/test_pertrans.sci @@ -0,0 +1,31 @@ +// Test file for "Column" function for the data types double, float, double complex, string , uint16. +// All the below statements are added to initialize variables in different data types +//The function written doesn't work for string or character scalar as of now. + + +function test_pertrans() + a= [1 2 3; 4 5 6; 7 8 9] + b= pertrans(a) + disp('Double') + disp(b) + disp('') + disp(pertrans(6)) + disp('') + c= float(a) + d=pertrans(c) + e= float(2) + disp('Float') + disp(d) + disp('') + disp(pertrans(e)) + disp('') + f=[%i*121+12; 4+%i*7;1] + g= pertrans(f) + disp('Double Complex') + disp(g) + disp('') + disp(pertrans(%i*8712+12)) + disp('') + + +endfunction diff --git a/includes/sci2clib.h b/includes/sci2clib.h index 4a986c6..b0a951d 100644 --- a/includes/sci2clib.h +++ b/includes/sci2clib.h @@ -502,6 +502,9 @@ extern "C" { /*interfacing nnz*/ #include "int_nnz.h" #include "nnz.h" +/*interfacing pertrans*/ +#include "int_pertrans.h" +#include "pertrans.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 Binary files differindex c78f0c2..0b7c607 100644 --- a/jar/scilab_en_US_help.jar +++ b/jar/scilab_en_US_help.jar diff --git a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci index 4e7dd67..85157ec 100644 --- a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci +++ b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci @@ -7657,6 +7657,39 @@ PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file', INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
+//---- Class PERTRANS---------------------
+//------------------------------------
+ClassName = 'PERTRANS';
+
+// --- 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= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(1)',ClassFileName,'file','y');
+
+// --- Function List Class. ---
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0'+ArgSeparator+'d0',ClassFileName,'file','y');
+PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s0'+ArgSeparator+'s0',ClassFileName,'file','y');
+PrintStringInfo('s2'+ArgSeparator+'s2',ClassFileName,'file','y');
+PrintStringInfo('z0'+ArgSeparator+'z0',ClassFileName,'file','y');
+PrintStringInfo('z2'+ArgSeparator+'z2',ClassFileName,'file','y');
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'pertrans';
+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/findDeps/getAllHeaders.sci b/macros/findDeps/getAllHeaders.sci index c3376e3..ee773ec 100644 --- a/macros/findDeps/getAllHeaders.sci +++ b/macros/findDeps/getAllHeaders.sci @@ -67,6 +67,7 @@ function allHeaders = getAllHeaders(SharedInfo) "src/c/matrixOperations/includes/cumsum.h" "src/c/matrixOperations/includes/matrix.h" "src/c/matrixOperations/includes/nnz.h" + "src/c/matrixOperations/includes/pertrans.h" "src/c/matrixOperations/includes/cumprod.h" "src/c/matrixOperations/includes/triu.h" "src/c/matrixOperations/includes/tril.h" diff --git a/macros/findDeps/getAllInterfaces.sci b/macros/findDeps/getAllInterfaces.sci index d16aadb..7884cd7 100644 --- a/macros/findDeps/getAllInterfaces.sci +++ b/macros/findDeps/getAllInterfaces.sci @@ -55,6 +55,7 @@ function allInterfaces = getAllInterfaces(SharedInfo) "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_pertrans.h" "src/c/matrixOperations/interfaces/int_cumprod.h" "src/c/matrixOperations/interfaces/int_triu.h" "src/c/matrixOperations/interfaces/int_tril.h" diff --git a/macros/findDeps/getAllSources.sci b/macros/findDeps/getAllSources.sci index dc27e0a..73b85a7 100644 --- a/macros/findDeps/getAllSources.sci +++ b/macros/findDeps/getAllSources.sci @@ -314,6 +314,13 @@ function allSources = getAllSources(SharedInfo,BuildTool) "src/c/matrixOperations/nnz/snnzs.c" "src/c/matrixOperations/nnz/znnza.c" "src/c/matrixOperations/nnz/znnzs.c" + "src/c/matrixOperations/pertrans/dpertransa.c" + "src/c/matrixOperations/pertrans/dpertranss.c" + "src/c/matrixOperations/pertrans/spertransa.c" + "src/c/matrixOperations/pertrans/spertranss.c" + "src/c/matrixOperations/pertrans/zpertransa.c" + "src/c/matrixOperations/pertrans/zpertranss.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" diff --git a/src/c/matrixOperations/includes/pertrans.h b/src/c/matrixOperations/includes/pertrans.h new file mode 100644 index 0000000..2c385ac --- /dev/null +++ b/src/c/matrixOperations/includes/pertrans.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 __PERTRANS_H__ +#define __PERTRANS_H__ + +#include "types.h" +#include "doubleComplex.h" +#include "uint16.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dpertransa(double *in, int row, int col, double* out); +double dpertranss(double in); + +void spertransa(float *in, int row, int col, float* out); +float spertranss(float in); + +void zpertransa(doubleComplex *in, int row, int col, doubleComplex* out); +doubleComplex zpertranss(doubleComplex in); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__PERTRANS_H__*/ diff --git a/src/c/matrixOperations/interfaces/int_pertrans.h b/src/c/matrixOperations/interfaces/int_pertrans.h new file mode 100644 index 0000000..8aa8ec5 --- /dev/null +++ b/src/c/matrixOperations/interfaces/int_pertrans.h @@ -0,0 +1,34 @@ +/* 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_PERTRANS_H__ +#define __INT_PERTRANS_H__ + + +#ifdef __cplusplus +extern "C" { +#endif + +#define d2pertransd2(in1, size, out) dpertransa(in1, size[0], size[1], out) +#define d0pertransd0(in1) dpertranss(in1) + +#define s2pertranss2(in1, size, out) spertransa(in1, size[0], size[1], out) +#define s0pertranss0(in1) spertranss(in1) + +#define z2pertransz2(in1, size, out) zpertransa(in1, size[0], size[1], out) +#define z0pertransz0(in1) zpertranss(in1) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_PERTRANS_H__*/ diff --git a/src/c/matrixOperations/pertrans/dpertransa.c b/src/c/matrixOperations/pertrans/dpertransa.c new file mode 100644 index 0000000..36b963e --- /dev/null +++ b/src/c/matrixOperations/pertrans/dpertransa.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 "pertrans.h" +#include "types.h" +#include "matrixTranspose.h" + +void dpertransa(double *in, int row, int col, double* out) +{ + + double middle[row*col]; + int j=0; + + dtransposea(in, row, col, middle); + + for(int i= row*col-1; i>=0; i=i-1) + { + + out[j]= middle[i]; + j=j+1; + + } + + + + +} diff --git a/src/c/matrixOperations/pertrans/dpertranss.c b/src/c/matrixOperations/pertrans/dpertranss.c new file mode 100644 index 0000000..10c2d03 --- /dev/null +++ b/src/c/matrixOperations/pertrans/dpertranss.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 "pertrans.h" +#include "types.h" +#include "matrixTranspose.h" + +double dpertranss(double in) +{ + + return in; + + +} diff --git a/src/c/matrixOperations/pertrans/spertransa.c b/src/c/matrixOperations/pertrans/spertransa.c new file mode 100644 index 0000000..4eba2f1 --- /dev/null +++ b/src/c/matrixOperations/pertrans/spertransa.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 "pertrans.h" +#include "types.h" +#include "matrixTranspose.h" + +void spertransa(float *in, int row, int col, float* out) +{ + + float middle[row*col]; + int j=0; + + stransposea(in, row, col, middle); + + for(int i= row*col-1; i>=0; i=i-1) + { + + out[j]= middle[i]; + j=j+1; + + } + + + + +} diff --git a/src/c/matrixOperations/pertrans/spertranss.c b/src/c/matrixOperations/pertrans/spertranss.c new file mode 100644 index 0000000..694c231 --- /dev/null +++ b/src/c/matrixOperations/pertrans/spertranss.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 "pertrans.h" +#include "types.h" +#include "matrixTranspose.h" + +float spertranss(float in) +{ + + return in; + + +} diff --git a/src/c/matrixOperations/pertrans/zpertransa.c b/src/c/matrixOperations/pertrans/zpertransa.c new file mode 100644 index 0000000..c52fdbc --- /dev/null +++ b/src/c/matrixOperations/pertrans/zpertransa.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 "pertrans.h" +#include "types.h" +#include "matrixTranspose.h" +#include "doubleComplex.h" + +void zpertransa(doubleComplex *in, int row, int col, doubleComplex* out) +{ + + doubleComplex middle[row*col]; + int j=0; + + ztransposea(in, row, col, middle); + + for(int i= row*col-1; i>=0; i=i-1) + { + + out[j]= middle[i]; + j=j+1; + + } + + + + +} diff --git a/src/c/matrixOperations/pertrans/zpertranss.c b/src/c/matrixOperations/pertrans/zpertranss.c new file mode 100644 index 0000000..73e6e61 --- /dev/null +++ b/src/c/matrixOperations/pertrans/zpertranss.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 "pertrans.h" +#include "types.h" +#include "matrixTranspose.h" +#include "doubleComplex.h" + +doubleComplex zpertranss(doubleComplex in) +{ + + return in; + + +} diff --git a/src/c/signalProcessing/hank/dhanka.c b/src/c/signalProcessing/hank/dhanka.c index 1857cc2..37008fd 100644 --- a/src/c/signalProcessing/hank/dhanka.c +++ b/src/c/signalProcessing/hank/dhanka.c @@ -20,6 +20,8 @@ void dhanka(int m, int n, double*seq_conv, int row, int col, double*out) { + +// Variable Declaration Start int mr, nr; mr= m* row; nr= n* row; @@ -31,8 +33,9 @@ void dhanka(int m, int n, double*seq_conv, int row, int col, double*out) double middle2[m*nr]; double index[m*nr]; double final[row*m*nr]; +// Variable Declaration End - +// Algorithm Start donesa(ones1, 1 , nr); donesa(ones2, m , 1); int j=0; @@ -106,5 +109,6 @@ printf("\n"); */ dmatrixa(final, row, m*nr, mr, (row*m*nr)/mr, out); +//Algorith Ends } |