diff options
127 files changed, 2804 insertions, 4730 deletions
diff --git a/demos/FilterResponse.dem.sce b/demos/FilterResponse.dem.sce new file mode 100644 index 0000000..7104836 --- /dev/null +++ b/demos/FilterResponse.dem.sce @@ -0,0 +1,18 @@ +// Copyright (C) 2017 - 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: Ankit Raj +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// + + + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/test_filterResponse/scilabcode/main.sci",TMPDIR,SCI2CHOME+"/tests/unit_tests/test_filterResponse/scilabcode"); diff --git a/demos/Jacobi.dem.sce b/demos/Jacobi.dem.sce new file mode 100644 index 0000000..0b1618c --- /dev/null +++ b/demos/Jacobi.dem.sce @@ -0,0 +1,18 @@ +// Copyright (C) 2017 - 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: Ankit Raj +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/test_jacobi/scilabcode/main.sci",TMPDIR,SCI2CHOME+"/tests/unit_tests/test_jacobi/scilabcode"); + diff --git a/demos/SVD.dem.sce b/demos/SVD.dem.sce new file mode 100644 index 0000000..d466964 --- /dev/null +++ b/demos/SVD.dem.sce @@ -0,0 +1,20 @@ +// Copyright (C) 2017 - 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: Sandeep Gupta +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"tests/unit_tests/testLinearAlgebra/testsvd/testsvd.sci", TMPDIR); + +editor(TMPDIR+"/main.c"); + + diff --git a/demos/analogFilter.dem.sce b/demos/analogFilter.dem.sce new file mode 100644 index 0000000..674c954 --- /dev/null +++ b/demos/analogFilter.dem.sce @@ -0,0 +1,18 @@ +// Copyright (C) 2017 - 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: Ankit Raj +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// + + + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/test_analogFilters/scilabcode/main.sci",TMPDIR,SCI2CHOME+"/tests/unit_tests/test_analogFilters/scilabcode"); diff --git a/demos/scilab2c.dem.gateway.sce b/demos/scilab2c.dem.gateway.sce index 71372e2..011e474 100644 --- a/demos/scilab2c.dem.gateway.sce +++ b/demos/scilab2c.dem.gateway.sce @@ -16,6 +16,10 @@ subdemolist = ["Trigonometric Identity" , "TrigonometricIdentity.dem.sce"; "Linear Regression" , "LinearRegression.dem.sce"; "Symbols", "Symbols.dem.sce"; "High Pass Filter", "Filter.dem.sce"; + "Jacobi functions","Jacobi.dem.sce"; + "Analog Filters","analogFilter.dem.sce"; + "String Functions","string.dem.sce"; + "Filter Responses","FilterResponse.dem.sce"; ]; -subdemolist(:,2) = demopath + subdemolist(:,2);
\ No newline at end of file +subdemolist(:,2) = demopath + subdemolist(:,2); diff --git a/demos/string.dem.sce b/demos/string.dem.sce new file mode 100644 index 0000000..db90905 --- /dev/null +++ b/demos/string.dem.sce @@ -0,0 +1,16 @@ +// Copyright (C) 2017 - 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: Ankit Raj +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME+"/tests/unit_tests/test_string/scilabcode/main.sci",TMPDIR,SCI2CHOME+"/tests/unit_tests/test_string/scilabcode"); diff --git a/includes/lapack.h b/includes/lapack.h index 5f12bc2..d3f6cb3 100644 --- a/includes/lapack.h +++ b/includes/lapack.h @@ -195,6 +195,13 @@ extern doubleComplex zgesvd_( char* , char* , int* , int* ,doubleComplex *,\ int* , double* ,doubleComplex* , int* ,doubleComplex* , int* ,\ doubleComplex* , int* , double* , int* ); +/*USed in QR decompsition*/ +extern double dgeqrf_(int *,int *,double *,int *,double *,double *,int *,int *); +extern double dgeqpf_(int *,int *,double *,int *,int *,double *,double *,int *); +extern double dorgqr_(int *,int *,int *,double *,int *,double *,double *,int *,int *); +extern void dlaset_(char *,int *,int *,double *,double *,double *,int *); + + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/includes/sci2clib.h b/includes/sci2clib.h index 1a8b557..ec34007 100644 --- a/includes/sci2clib.h +++ b/includes/sci2clib.h @@ -449,6 +449,11 @@ extern "C" { #include "int_norm.h" #include "norm.h" +/*interface Toeplitz */ +#include "toeplitz.h" +#include "int_toeplitz.h" + + /* SIGNAL PROCESSING */ @@ -660,8 +665,27 @@ extern "C" { #include "hess.h" /* Linear Algebra - Hess function */ #include "int_hess.h" -#include "sva.h" -#include "int_sva.h" /*Linear Algebra - SVA function */ +#include "sva.h" /* Linear Algebra - SVA function */ +#include "int_sva.h" + +#include "sqroot.h" /* Linear Algebra - Sqroot function */ +#include "int_sqroot.h" + +#include "givens.h" /* Linear Algebra - Givens Function */ +#include "int_givens.h" + +#include "householder.h" /* Linear Algebra - Householder function */ +#include "int_householder.h" + +#include "fullrf.h" /* Linear Algebra - Full rank factoziation */ +#include "int_fullrf.h" + +#include "rowcomp.h" /* Linear Algebra - row compression, range */ +#include "int_rowcomp.h" + + +#include "qr.h" /* Linear Algebra - QR decomposition */ +#include "int_qr.h" /*Functions related to opencv*/ /*#include "cvcore.hpp" diff --git a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci index ead59a2..a588ec5 100644 --- a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci +++ b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci @@ -4525,6 +4525,57 @@ PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file', INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
+//---- Class TOEPLITZ ----------------
+//------------------------------------
+ClassName = 'toeplitz';
+
+// --- 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');
+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(2).SZ(2)',ClassFileName,'file','y');
+
+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(2)',ClassFileName,'file','y');
+
+
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d2d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('u82u82'+ArgSeparator+'u82',ClassFileName,'file','y');
+PrintStringInfo('u82'+ArgSeparator+'u82',ClassFileName,'file','y');
+PrintStringInfo('u162u162'+ArgSeparator+'u162',ClassFileName,'file','y');
+PrintStringInfo('u162'+ArgSeparator+'u162',ClassFileName,'file','y');
+PrintStringInfo('g2g2'+ArgSeparator+'g2',ClassFileName,'file','y');
+PrintStringInfo('g2'+ArgSeparator+'g2',ClassFileName,'file','y');
+PrintStringInfo('z2z2'+ArgSeparator+'z2',ClassFileName,'file','y');
+PrintStringInfo('z2'+ArgSeparator+'z2',ClassFileName,'file','y');
+PrintStringInfo('s2s2'+ArgSeparator+'s2',ClassFileName,'file','y');
+PrintStringInfo('s2'+ArgSeparator+'s2',ClassFileName,'file','y');
+PrintStringInfo('c2c2'+ArgSeparator+'c2',ClassFileName,'file','y');
+PrintStringInfo('c2'+ArgSeparator+'c2',ClassFileName,'file','y');
+PrintStringInfo('i82i82'+ArgSeparator+'i82',ClassFileName,'file','y');
+PrintStringInfo('i82'+ArgSeparator+'i82',ClassFileName,'file','y');
+PrintStringInfo('i162i162'+ArgSeparator+'i162',ClassFileName,'file','y');
+PrintStringInfo('i162'+ArgSeparator+'i162',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'toeplitz';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
// -------------------
// --- Class Spec. ---
// -------------------
@@ -7782,6 +7833,315 @@ PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file', INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+//------------------------------------
+//---- Class SQROOT ---------------------
+//------------------------------------
+ClassName = 'SQROOT';
+
+// --- 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)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'sqroot';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+//------------------------------------
+//---- Class GIVENS ---------------------
+//------------------------------------
+ClassName = 'GIVENS';
+
+// --- 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)= ''2''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''2''',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 2',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''2''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''2''',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= ''2''',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).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)= ''2''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''2''',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 2',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''2''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''2''',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= ''2''',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= ''1''',ClassFileName,'file','y');
+
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('d2'+ArgSeparator+'d2d2',ClassFileName,'file','y');
+PrintStringInfo('d0d0'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('d0d0'+ArgSeparator+'d2d2',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'givens';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+//------------------------------------
+//---- Class HOUSEHOLDER---------------------
+//------------------------------------
+ClassName = 'HOUSEHOLDER';
+
+// --- 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)= IN(1).SZ(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)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('d2d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'householder';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+//------------------------------------
+//---- Class FULLRF---------------------
+//------------------------------------
+ClassName = 'FULLRF';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 3',ClassFileName,'file','y');
+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');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(2)= ''1''',ClassFileName,'file','y');
+
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 3',ClassFileName,'file','y');
+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(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d2'+ArgSeparator+'d2d2d0',ClassFileName,'file','y');
+PrintStringInfo('d2d0'+ArgSeparator+'d2d2d0',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'fullrf';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+//------------------------------------
+//---- Class ROWCOMP ---------------------
+//------------------------------------
+ClassName = 'ROWCOMP';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 2',ClassFileName,'file','y');
+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(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= ''1''',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 2',ClassFileName,'file','y');
+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(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= ''1''',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 3',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 2',ClassFileName,'file','y');
+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(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= ''1''',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d2'+ArgSeparator+'d2d0',ClassFileName,'file','y');
+PrintStringInfo('d2g2'+ArgSeparator+'d2d0',ClassFileName,'file','y');
+PrintStringInfo('d2g2d0'+ArgSeparator+'d2d0',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'rowcomp';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+//------------------------------------
+//---- Class QR---------------------
+//------------------------------------
+ClassName = 'QR';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 2',ClassFileName,'file','y');
+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(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 3',ClassFileName,'file','y');
+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(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(1)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 2',ClassFileName,'file','y');
+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)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 3',ClassFileName,'file','y');
+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)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');;
+PrintStringInfo('OUT(3).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(1)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 4',ClassFileName,'file','y');
+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)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');;
+PrintStringInfo('OUT(3).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(2)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(4).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(4).SZ(1)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(4).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 4',ClassFileName,'file','y');
+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)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');;
+PrintStringInfo('OUT(3).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(2)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(4).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(4).SZ(1)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(4).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d2'+ArgSeparator+'d2d2',ClassFileName,'file','y');
+PrintStringInfo('d2'+ArgSeparator+'d2d2d2',ClassFileName,'file','y');
+PrintStringInfo('d2g2'+ArgSeparator+'d2d2',ClassFileName,'file','y');
+PrintStringInfo('d2g2'+ArgSeparator+'d2d2d2',ClassFileName,'file','y');
+PrintStringInfo('d2d0'+ArgSeparator+'d2d2d0d2',ClassFileName,'file','y');
+PrintStringInfo('d2'+ArgSeparator+'d2d2d0d2',ClassFileName,'file','y');
+
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'qr';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
//------------------------------------
//---- Class svd ---------------------
//------------------------------------
@@ -7815,8 +8175,8 @@ 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(1)',ClassFileName,'file','y');
PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
-PrintStringInfo('OUT(2).SZ(1)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
-PrintStringInfo('OUT(2).SZ(2)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
PrintStringInfo('OUT(3).TP= IN(1).TP',ClassFileName,'file','y');
PrintStringInfo('OUT(3).SZ(1)= IN(1).SZ(2)',ClassFileName,'file','y');
PrintStringInfo('OUT(3).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
@@ -7845,11 +8205,41 @@ 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(1)',ClassFileName,'file','y');
PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
-PrintStringInfo('OUT(2).SZ(1)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
-PrintStringInfo('OUT(2).SZ(2)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(1)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 4',ClassFileName,'file','y');
+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(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(1)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(3).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(4).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(4).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(4).SZ(2)= ''1''',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 4',ClassFileName,'file','y');
+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(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
PrintStringInfo('OUT(3).TP= IN(1).TP',ClassFileName,'file','y');
PrintStringInfo('OUT(3).SZ(1)= IN(1).SZ(2)',ClassFileName,'file','y');
PrintStringInfo('OUT(3).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(4).TP= ''d''',ClassFileName,'file','y');
+PrintStringInfo('OUT(4).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(4).SZ(2)= ''1''',ClassFileName,'file','y');
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
@@ -7858,6 +8248,8 @@ PrintStringInfo('d2'+ArgSeparator+'d2d2d2',ClassFileName,'file','y'); PrintStringInfo('z2'+ArgSeparator+'z2',ClassFileName,'file','y');
PrintStringInfo('z2g2'+ArgSeparator+'z2z2z2',ClassFileName,'file','y');
PrintStringInfo('z2'+ArgSeparator+'z2z2z2',ClassFileName,'file','y');
+PrintStringInfo('d2'+ArgSeparator+'d2d2d2d0',ClassFileName,'file','y');
+PrintStringInfo('d2d0'+ArgSeparator+'d2d2d2d0',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'svd';
@@ -7901,7 +8293,6 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,E INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
-
//------------------------------------
//---- Class SVA ---------------------
//------------------------------------
@@ -7927,7 +8318,7 @@ PrintStringInfo('NIN= 2',ClassFileName,'file','y'); PrintStringInfo('NOUT= 3',ClassFileName,'file','y');
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)= FA_SZ_U_SVA(IN(1),IN(2).VAL)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
PrintStringInfo('OUT(2).SZ(1)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
PrintStringInfo('OUT(2).SZ(2)= FA_MIN(IN(1).SZ(1),IN(1).SZ(2))',ClassFileName,'file','y');
@@ -7945,6 +8336,7 @@ PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file', INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
//------------------------------------
//---- Class balanc ------------------
//------------------------------------
@@ -9741,7 +10133,7 @@ ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls); PrintStringInfo('NIN= 3',ClassFileName,'file','y');
PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
-PrintStringInfo('OUT(1).TP= IN(3).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''d''',ClassFileName,'file','y');
PrintStringInfo('OUT(1).SZ(1)= IN(3).SZ(1)',ClassFileName,'file','y');
PrintStringInfo('OUT(1).SZ(2)= IN(3).SZ(2)',ClassFileName,'file','y');
diff --git a/macros/findDeps/getAllHeaders.sci b/macros/findDeps/getAllHeaders.sci index 0435976..9eb019a 100644 --- a/macros/findDeps/getAllHeaders.sci +++ b/macros/findDeps/getAllHeaders.sci @@ -60,7 +60,6 @@ function allHeaders = getAllHeaders(SharedInfo) "src/c/matrixOperations/includes/logm.h" "src/c/matrixOperations/includes/ones.h" "src/c/matrixOperations/includes/matrixSquaredMagnitude.h" - "src/c/linearAlgebra/includes/spec.h" "src/c/matrixOperations/includes/matrixTranspose.h" "src/c/matrixOperations/includes/determ.h" "src/c/matrixOperations/includes/matrixMultiplication.h" @@ -72,6 +71,7 @@ function allHeaders = getAllHeaders(SharedInfo) "src/c/matrixOperations/includes/kron.h" "src/c/matrixOperations/includes/flipdim.h" "src/c/matrixOperations/includes/norm.h" + "src/c/matrixOperations/includes/toeplitz.h" "src/c/interpolation/includes/interp1.h" "src/c/elementaryFunctions/includes/nextpow2.h" "src/c/elementaryFunctions/includes/gcd.h" @@ -220,14 +220,19 @@ function allHeaders = getAllHeaders(SharedInfo) "src/c/CACSD/includes/lqr.h" "src/c/CACSD/includes/lqe.h" "src/c/CACSD/includes/obscont.h" - "src/c/linearAlgebra/includes/sva.h" - "src/c/linearAlgebra/includes/svd.h" "src/c/linearAlgebra/includes/schur.h" "src/c/linearAlgebra/includes/balanc.h" "src/c/linearAlgebra/includes/svd.h" - "src/c/linearAlgebra/includes/hess.h" - "src/c/linearAlgebra/includes/sva.h" - "src/c/linearAlgebra/includes/rcond.h"]; + "src/c/linearAlgebra/includes/hess.h" + "src/c/linearAlgebra/includes/sva.h" + "src/c/linearAlgebra/includes/sqroot.h" + "src/c/linearAlgebra/includes/givens.h" + "src/c/linearAlgebra/includes/householder.h" + "src/c/linearAlgebra/includes/fullrf.h" + "src/c/linearAlgebra/includes/rowcomp.h" + "src/c/linearAlgebra/includes/rcond.h" + "src/c/linearAlgebra/includes/qr.h" + "src/c/linearAlgebra/includes/spec.h"]; //Header files required for "Arduino" output diff --git a/macros/findDeps/getAllInterfaces.sci b/macros/findDeps/getAllInterfaces.sci index e629779..4c8475a 100644 --- a/macros/findDeps/getAllInterfaces.sci +++ b/macros/findDeps/getAllInterfaces.sci @@ -32,7 +32,6 @@ function allInterfaces = getAllInterfaces(SharedInfo) "src/c/type/int_real.h" "src/c/matrixOperations/interfaces/int_vmagn.h" "src/c/matrixOperations/interfaces/int_ones.h" - "src/c/linearAlgebra/interfaces/int_spec.h" "src/c/matrixOperations/interfaces/int_cat.h" "src/c/matrixOperations/interfaces/int_zeros.h" "src/c/matrixOperations/interfaces/int_OpBackSlash.h" @@ -61,6 +60,7 @@ function allInterfaces = getAllInterfaces(SharedInfo) "src/c/matrixOperations/interfaces/int_flipdim.h" "src/c/matrixOperations/interfaces/int_permute.h" "src/c/matrixOperations/interfaces/int_norm.h" + "src/c/matrixOperations/interfaces/int_toeplitz.h" "src/c/interpolation/interfaces/int_interp1.h" "src/c/elementaryFunctions/interfaces/int_nextpow2.h" "src/c/elementaryFunctions/interfaces/int_gcd.h" @@ -215,13 +215,18 @@ function allInterfaces = getAllInterfaces(SharedInfo) "src/c/CACSD/interfaces/int_lqr.h" "src/c/CACSD/interfaces/int_lqe.h" "src/c/CACSD/interfaces/int_obscont.h" - "src/c/linearAlgebra/interfaces/int_sva.h" - "src/c/linearAlgebra/interfaces/int_svd.h" + "src/c/linearAlgebra/interfaces/int_spec.h" "src/c/linearAlgebra/interfaces/int_schur.h" "src/c/linearAlgebra/interfaces/int_balanc.h" "src/c/linearAlgebra/interfaces/int_svd.h" + "src/c/linearAlgebra/interfaces/int_sqroot.h" "src/c/linearAlgebra/interfaces/int_hess.h" - "src/c/linearAlgebra/interfaces/int_sva.h" + "src/c/linearAlgebra/interfaces/int_sva.h" + "src/c/linearAlgebra/interfaces/int_givens.h" + "src/c/linearAlgebra/interfaces/int_householder.h" + "src/c/linearAlgebra/interfaces/int_fullrf.h" + "src/c/linearAlgebra/interfaces/int_rowcomp.h" + "src/c/linearAlgebra/interfaces/int_qr.h"; "src/c/linearAlgebra/interfaces/int_rcond.h"]; diff --git a/macros/findDeps/getAllSources.sci b/macros/findDeps/getAllSources.sci index 0891aef..ff60652 100644 --- a/macros/findDeps/getAllSources.sci +++ b/macros/findDeps/getAllSources.sci @@ -155,18 +155,10 @@ function allSources = getAllSources(SharedInfo) "src/c/matrixOperations/powm/spowma.c" "src/c/matrixOperations/powm/zpowma.c" "src/c/matrixOperations/powm/cpowma.c" - "src/c/linearAlgebra/spec/cspeca.c" - "src/c/linearAlgebra/spec/dspeca.c" - "src/c/linearAlgebra/spec/sspeca.c" - "src/c/linearAlgebra/spec/zspeca.c" "src/c/matrixOperations/transpose/ztransposea.c" "src/c/matrixOperations/transpose/stransposea.c" "src/c/matrixOperations/transpose/ctransposea.c" "src/c/matrixOperations/transpose/dtransposea.c" - "src/c/linearAlgebra/spec2/zspec2a.c" - "src/c/linearAlgebra/spec2/sspec2a.c" - "src/c/linearAlgebra/spec2/dspec2a.c" - "src/c/linearAlgebra/spec2/cspec2a.c" "src/c/matrixOperations/trace/stracea.c" "src/c/matrixOperations/trace/dtracea.c" "src/c/matrixOperations/trace/ctracea.c" @@ -334,6 +326,15 @@ function allSources = getAllSources(SharedInfo) "src/c/matrixOperations/kron/skrona.c" "src/c/matrixOperations/norm/dnormv.c" "src/c/matrixOperations/norm/dnorma.c" + "src/c/matrixOperations/toeplitz/dtoeplitza.c" + "src/c/matrixOperations/toeplitz/u8toeplitza.c" + "src/c/matrixOperations/toeplitz/u16toeplitza.c" + "src/c/matrixOperations/toeplitz/gtoeplitza.c" + "src/c/matrixOperations/toeplitz/ztoeplitza.c" + "src/c/matrixOperations/toeplitz/stoeplitza.c" + "src/c/matrixOperations/toeplitz/ctoeplitza.c" + "src/c/matrixOperations/toeplitz/i8toeplitza.c" + "src/c/matrixOperations/toeplitz/i16toeplitza.c" "src/c/elementaryFunctions/nextpow2/dnextpow2a.c" "src/c/elementaryFunctions/isreal/sisreals.c" "src/c/elementaryFunctions/isreal/disreals.c" @@ -1263,16 +1264,28 @@ function allSources = getAllSources(SharedInfo) "src/c/CACSD/lqr/dlqra.c" "src/c/CACSD/lqe/dlqea.c" "src/c/CACSD/obscont/dobsconta.c" - "src/c/linearAlgebra/sva/dsvaa.c" - "src/c/linearAlgebra/svd/dsvda.c" + "src/c/linearAlgebra/spec2/zspec2a.c" + "src/c/linearAlgebra/spec2/sspec2a.c" + "src/c/linearAlgebra/spec2/dspec2a.c" + "src/c/linearAlgebra/spec2/cspec2a.c" + "src/c/linearAlgebra/spec/cspeca.c" + "src/c/linearAlgebra/spec/dspeca.c" + "src/c/linearAlgebra/spec/sspeca.c" + "src/c/linearAlgebra/spec/zspeca.c" "src/c/linearAlgebra/schur/dschura.c" "src/c/linearAlgebra/schur/dgschura.c" "src/c/linearAlgebra/balanc/dbalanca.c" "src/c/linearAlgebra/svd/dsvda.c" "src/c/linearAlgebra/svd/zsvda.c" + "src/c/linearAlgebra/sqroot/dsqroota.c" "src/c/linearAlgebra/hess/dhessa.c" + "src/c/linearAlgebra/givens/dgivensa.c" + "src/c/linearAlgebra/householder/dhouseholdera.c" "src/c/linearAlgebra/sva/dsvaa.c" "src/c/linearAlgebra/spec/dspec1a.c" + "src/c/linearAlgebra/fullrf/dfullrfa.c" + "src/c/linearAlgebra/rowcomp/drowcompa.c" + "src/c/linearAlgebra/qr/dqra.c" "src/c/linearAlgebra/rcond/drconda.c"]; //Files to be inserted only if output format selected is 'Arduino'. diff --git a/macros/scilab2c.sci b/macros/scilab2c.sci index 197c88b..70290d0 100644 --- a/macros/scilab2c.sci +++ b/macros/scilab2c.sci @@ -57,7 +57,7 @@ function scilab2c(varargin) RunMode = "All"; BuildTool = getNativeBuildTool(); Target = "StandAlone" - //Board_name = "uno" + Board_name = "uno" // // scilab2c(UserScilabMainFile, CCodeOutputDir, UserSciFilesPaths, RunMode) // diff --git a/src/c/linearAlgebra/fullrf/dfullrfa.c b/src/c/linearAlgebra/fullrf/dfullrfa.c new file mode 100644 index 0000000..a409ae3 --- /dev/null +++ b/src/c/linearAlgebra/fullrf/dfullrfa.c @@ -0,0 +1,112 @@ +/* Copyright (C) 2017 - 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: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +/* FULL Rank factorization function in scilab */ + +/* + //[Q,M,rk]=fullrf(A) + //Full rank factorization : A=Q.M + //with range(Q)=range(A) and ker(M)=ker(A), + //Q full column rank , M full row rank + // rk = rank(A) = #columns(Q) = #rows(M) + //F.D. +*/ + +#include "fullrf.h" +#include <stdio.h> +#include <stdlib.h> +#include "svd.h" +#include <math.h> +#include "norm.h" +#include "matrixTranspose.h" +#include "matrixMultiplication.h" + +double dfullrfa(int ninp,double *inp1,int row,int col,double tol,double *out1,double *out2){ + + int i,j; + /* norm inp1 - norm(inp1,1)*/ + double na1; + na1 = dnorma(inp1,row,col,1); + + if(ninp == 1){ + tol = sqrt(pow(2,-52)); + } + + if(na1 < pow(1,-10)){ + out1 = NULL; + out2 = NULL; + return 0; + } + + double tol1; + tol1 = tol*na1; + + double *U,*S,*V; + U = (double *)malloc(row*row*sizeof(double)); + S = (double *)malloc(row*col*sizeof(double)); + V = (double *)malloc(col*col*sizeof(double)); + + double rk; + rk = dsvda(tol1,inp1,row,col,0,4,U,S,V); + + /* sq = sqrt(s) */ + for(i=0;i<row;i++){ + for(j=0;j<col;j++){ + if(i == j){ + S[i*row+j] = pow(S[i*row+j],0.5); + } + else{ + S[i*row+j] = 0; + } + } + } + + double *Q; + Q = (double *)malloc(row*col*sizeof(double)); + dmulma(U,row,row,S,row,col,Q); + + double *VT; + VT = (double *)malloc(col*col*sizeof(double)); + dtransposea(V,col,col,VT); + + /* multiplication of sq*V' or S*VT */ + double *M; + M = (double *)malloc(row*col*sizeof(double)); + dmulma(S,row,col,VT,col,col,M); + + /* This Program is not yet completed properly, as it outputs the whole matrix, instead of the exact output. + + if anyone finds, how to fix the size in INITFILLscidir.sci +please change there and change below few lines of codes accordingly. + +*/ + for(i=0;i<row;i++){ + for(j=0;j<col;j++){ + //if(j < rk) + out1[i*col+j] = Q[i*col+j]; + //else + // out1[i*col+j] = 0; + } + //printf("\n"); + } + + for(i=0;i<row;i++){ + for(j=0;j<col;j++){ + //if(i < rk) + out2[i*col+j] = M[i*col+j]; + //else + // out2[i*col+j] = 0; + } + } + + return rk; +} diff --git a/src/c/linearAlgebra/givens/dgivensa.c b/src/c/linearAlgebra/givens/dgivensa.c new file mode 100644 index 0000000..9bf0637 --- /dev/null +++ b/src/c/linearAlgebra/givens/dgivensa.c @@ -0,0 +1,76 @@ +/* Copyright (C) 2017 - 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: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +/* GIVENS scilab function + Syntax : u=givens(xy) + u=givens(x,y) + xy = [x;y], u=givens(xy) + returns a 2*2 matrix u such that u*xy=[r;0]. + c is equal to u*xy + givens(x,y)=givens([x;y]) +*/ + +#include "givens.h" +#include <stdio.h> +#include <math.h> +#include "norm.h" + +/* All variable names are according to scilab code */ + +void dgivensa(int ninp,double *inp1,int row,int col,double *inp2,int row1,int col1,int nout,double *out1,double *out2){ + double *x; + double r; + x = (double *)malloc((double)2*sizeof(double)); + if(ninp == 2){ + if(row != 1 || col != 1 || row1 != 1 || col1 != 1){ + printf("Wrong size for input argument: A column vector expected.\n"); + return; + } + *(x) = *(inp1); + *(x+1) = *(inp2); + } + else{ + //printf("(%d %d)",row,col); + if(row != 2 || col != 1){ + printf("Wrong size for input argument: A column vector expected.\n"); + return; + } + //printf("(%lf %lf)",inp1[0],inp1[1]); + x[0] = inp1[0]; + x[1] = inp1[1]; + } + if(*(x+1) != 0){ + //printf("(%lf %lf)",x[0],x[1]); + /*Norm of type 2 - find the maximum singular value*/ + r = dnorma(x,2,1,2); + //printf("%lf \n",r); + *(out1) = (*(x))/r; + *(out1+1) = -(*(x+1))/r; + *(out1+2) = (*(x+1))/r; + *(out1+3) = (*(x))/r; + if(nout == 2){ + *(out2) = r; + *(out2+1) = 0; + } + + } + else{ + *(out1) = 1; + *(out1+1) = 0; + *(out1+2) = 1; + *(out1+3) = 0; + if(nout == 2){ + *(out2) = *(x); + *(out2+1) = *(x+1); + } + } +} diff --git a/src/c/linearAlgebra/hess/dhessa.c b/src/c/linearAlgebra/hess/dhessa.c index 57f81b3..e1f2e2d 100644 --- a/src/c/linearAlgebra/hess/dhessa.c +++ b/src/c/linearAlgebra/hess/dhessa.c @@ -20,11 +20,13 @@ #include "matrixTranspose.h" #include "matrixMultiplication.h" +/* Lapack subroutines - which are used*/ extern int dgehrd_(int *, int *,int *,double *,int *,double *,double *,int *,int *); extern int dorghr_(int *, int *,int *,double *,int *,double *,double *,int *,int *); - +/* All the vairbale names are given exactly the same name as scilab source code */ void dhessa(double *in1,int size,int nout,double *out1, double *out2){ +/* Variables names are done through, Lapack library. */ int i,j,k; int N = size; int ILO=1; @@ -41,11 +43,11 @@ void dhessa(double *in1,int size,int nout,double *out1, double *out2){ WORK = (double *)malloc((double)LWORK*sizeof(double)); dgehrd_(&N,&ILO,&IHI,A,&LDA,TAU,WORK,&N,&INFO); - for(i=0;i<N;i++) + for(i=0;i<N;i++) /* copying it in output */ for(j=0;j<N;j++) out2[i+j*N] = A[i+j*N]; - for(j=1;j<=N-2;j++){ + for(j=1;j<=N-2;j++){ /* copying it in output */ for(i=j+2;i<=N;i++){ out2[(i-1)+(j-1)*N] = 0; } diff --git a/src/c/linearAlgebra/householder/dhouseholdera.c b/src/c/linearAlgebra/householder/dhouseholdera.c new file mode 100644 index 0000000..5a98bfa --- /dev/null +++ b/src/c/linearAlgebra/householder/dhouseholdera.c @@ -0,0 +1,90 @@ +/* Copyright (C) 2017 - 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: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +/* Householder orthogonal reflexion matrix */ + +/* +Syntax :- + //u=householder(v [,w]) + //Description + //given 2 column vectors v w of same size householder(v,w) returns a unitary + //column vector u, such that (eye-2*u*u')*v is proportional to w. + //(eye-2*u*u') is the orthogonal Householder reflexion matrix + // + // w default value is eye(v). In this case vector (eye-2*u*u')*v is the + // vector eye(v)*(+-norm(v)) +*/ +#include <stdio.h> +#include <stdlib.h> +#include "householder.h" +#include "eye.h" +#include "matrixTranspose.h" +#include "matrixMultiplication.h" +#include <math.h> +#include "norm.h" + +void dhouseholdera(int ninp,double *inp1,int row,double *inp2,double *out1){ + + int i,j; + double *x; + x = (double *)malloc(row*sizeof(double)); + + for(i=0;i<row;i++) + x[i] = inp1[i]; + + if(ninp < 2){ + deyea(x,row,1); + } + else{ + for(i=0;i<row;i++){ + x[i] = inp2[i]; + } + } + + /* vt transpose of inp1 */ + + double *vt; + vt = (double *)malloc(row*sizeof(double)); + dtransposea(inp1,row,1,vt); + + /*wt transpose of inp2 */ + double *wt; + wt = (double *)malloc(row*sizeof(double)); + dtransposea(x,row,1,wt); + + /* vvt = inp1*vt */ + double *vvt; + vvt = (double *)malloc(1*1*sizeof(double)); + dmulma(vt,1,row,inp1,row,1,vvt); + + /* wwt = inp2*wt */ + double *wwt; + wwt = (double *)malloc(1*1*sizeof(double)); + dmulma(wt,1,row,x,row,1,wwt); + + /* a=-sqrt((v'*v)/(w'*w)) */ + double a; + //a = (double *)malloc(1*1*sizeof(double)); + a = -sqrt(vvt[0]/wwt[0]); + + for(i=0;i<row;i++){ + out1[i] = x[i]*a+inp1[i]; + } + + /* norm of out1 */ + double r; + r = dnorma(out1,row,1,2); + + for(i=0;i<row;i++){ + out1[i]=out1[i]/r; + } +} diff --git a/src/c/linearAlgebra/includes/fullrf.h b/src/c/linearAlgebra/includes/fullrf.h new file mode 100644 index 0000000..cc0a33d --- /dev/null +++ b/src/c/linearAlgebra/includes/fullrf.h @@ -0,0 +1,26 @@ + /* Copyright (C) 2017 - 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: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __FULLRF_H__ +#define __FULLRF_H__ +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +double dfullrfa(int ninp,double *in1,int row,int col,double tol,double *out1,double *out2); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__FULLRF_H__*/ diff --git a/src/c/linearAlgebra/includes/givens.h b/src/c/linearAlgebra/includes/givens.h new file mode 100644 index 0000000..4aac91b --- /dev/null +++ b/src/c/linearAlgebra/includes/givens.h @@ -0,0 +1,25 @@ + /* Copyright (C) 2017 - 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: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __GIVENS_H__ +#define __GIVENS_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +void dgivensa(int ninp,double *inp1,int row,int col,double *inp2,int row1,int col1,int nout,double *out1,double *out2); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__givens_H__*/ diff --git a/src/c/linearAlgebra/includes/householder.h b/src/c/linearAlgebra/includes/householder.h new file mode 100644 index 0000000..64350a1 --- /dev/null +++ b/src/c/linearAlgebra/includes/householder.h @@ -0,0 +1,26 @@ + /* Copyright (C) 2017 - 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: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __HOUSEHOLDER_H__ +#define __HOUSEHOLDER_H__ +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dhouseholdera(int ninp,double *inp1,int row,double *inp2,double *out1); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__HOUSEHOLDER_H__*/ diff --git a/src/c/linearAlgebra/includes/qr.h b/src/c/linearAlgebra/includes/qr.h new file mode 100644 index 0000000..2ed12e3 --- /dev/null +++ b/src/c/linearAlgebra/includes/qr.h @@ -0,0 +1,26 @@ + /* Copyright (C) 2017 - 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: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __QR_H__ +#define __QR_H__ +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +double dqra(int ninp,int nout,double *inp1,int M,int N,double tol,double *out1,double *out2,double *out3); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__QR_H__*/ diff --git a/src/c/linearAlgebra/includes/rowcomp.h b/src/c/linearAlgebra/includes/rowcomp.h new file mode 100644 index 0000000..faf5a2a --- /dev/null +++ b/src/c/linearAlgebra/includes/rowcomp.h @@ -0,0 +1,26 @@ + /* Copyright (C) 2017 - 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: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __ROWCOMP_H__ +#define __ROWCOMP_H__ +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +double drowcompa(int ninp,double *A,int row,int col,char *flag,double tol,double *w); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__ROWCOMP_H__*/ diff --git a/src/c/linearAlgebra/includes/sqroot.h b/src/c/linearAlgebra/includes/sqroot.h new file mode 100644 index 0000000..9c1d965 --- /dev/null +++ b/src/c/linearAlgebra/includes/sqroot.h @@ -0,0 +1,26 @@ + /* Copyright (C) 2017 - 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: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __SQROOT_H__ +#define __SQROOT_H__ +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dsqroota(double *inp,int row,int col,double *out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__SQROOT_H__*/ diff --git a/src/c/linearAlgebra/interfaces/int_fullrf.h b/src/c/linearAlgebra/interfaces/int_fullrf.h new file mode 100644 index 0000000..1b8a067 --- /dev/null +++ b/src/c/linearAlgebra/interfaces/int_fullrf.h @@ -0,0 +1,28 @@ + /* Copyright (C) 2017 - 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: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __INT_FULLRF_H__ +#define __INT_FULLRF_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define d2fullrfd2d2d0(in1,size,out1,out2) dfullrfa(1,in1,size[0],size[1],0,out1,out2); +#define d2d0fullrfd2d2d0(in1,size,in2,out1,out2) dfullrfa(2,in1,size[0],size[1],in2,out1,out2); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_FULLRF_H__*/ + diff --git a/src/c/linearAlgebra/interfaces/int_givens.h b/src/c/linearAlgebra/interfaces/int_givens.h new file mode 100644 index 0000000..ba30dbc --- /dev/null +++ b/src/c/linearAlgebra/interfaces/int_givens.h @@ -0,0 +1,32 @@ + /* Copyright (C) 2017 - 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: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __INT_GIVENS_H__ +#define __INT_GIVENS_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define d2givensd2(in1,size,out1) dgivensa(1,in1,size[0],size[1],NULL,0,0,1,out1,NULL); +#define d2givensd2d2(in1,size,out1,out2) dgivensa(1,in1,size[0],size[1],NULL,0,0,2,out1,out2); + +#define d0d0givensd2d2(in1,in2,out1,out2) dgivensa(2,&in1,1,1,&in2,1,1,2,out1,out2); +#define d0d0givensd2(in1,out1) dgivensa(2,&in1,1,1,&in2,1,1,1,out1,NULL); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_GIVENS_H__*/ + diff --git a/src/c/linearAlgebra/interfaces/int_householder.h b/src/c/linearAlgebra/interfaces/int_householder.h new file mode 100644 index 0000000..f863719 --- /dev/null +++ b/src/c/linearAlgebra/interfaces/int_householder.h @@ -0,0 +1,28 @@ + /* Copyright (C) 2017 - 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: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __INT_HOUSEHOLDER_H__ +#define __INT_HOUSEHOLDER_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define d2householderd2(in1,size,out1) dhouseholdera(1,in1,size[0],NULL,out2); +#define d2d2householderd2(in1,size1,in2,size2,out1) dhouseholdera(2,in1,size1[0],in2,out1); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_HOUSEHOLDER_H__*/ + diff --git a/src/c/linearAlgebra/interfaces/int_qr.h b/src/c/linearAlgebra/interfaces/int_qr.h new file mode 100644 index 0000000..d34d8f4 --- /dev/null +++ b/src/c/linearAlgebra/interfaces/int_qr.h @@ -0,0 +1,34 @@ + /* Copyright (C) 2017 - 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: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __INT_QR_H__ +#define __INT_QR_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define d2qrd2d2(in1,size,out1,out2) dqra(1,2,in1,size[0],size[1],0,out1,out2,NULL); +#define d2qrd2d2d2(in1,size,out1,out2,out3) dqra(1,3,in1,size[0],size[1],0,out1,out2,out3); +#define d2g2qrd2d2(in1,size,in2,size1,out1,out2) dqra(2,2,in1,size[0],size[1],0,out1,out2,NULL); +#define d2g2qrd2d2d2(in1,size,in2,size1,out1,out2,out3) dqra(2,3,in1,size[0],size[1],0,out1,out2,out3); +#define d2d0qrd2d2d0d2(in1,size,in2,out1,out2,out3) dqra(2,4,in1,size[0],size[1],in2,out1,out2,out3); +#define d2qrd2d2d0d2(in1,size,out1,out2,out3) dqra(1,4,in1,size[0],size[1],0,out1,out2,out3); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_HESS_H__*/ + diff --git a/src/c/linearAlgebra/interfaces/int_rowcomp.h b/src/c/linearAlgebra/interfaces/int_rowcomp.h new file mode 100644 index 0000000..b72687d --- /dev/null +++ b/src/c/linearAlgebra/interfaces/int_rowcomp.h @@ -0,0 +1,29 @@ + /* Copyright (C) 2017 - 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: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __INT_ROWCOMP_H__ +#define __INT_ROWCOMP_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define d2rowcompd2d0(in1,size,out1) drowcompa(1,in1,size[0],size[1],NULL,0,out1); +#define d2g2rowcompd2d0(in1,size,flag,size1,out1) drowcompa(2,in1,size[0],size[1],flag,0,out1); +#define d2g2d0rowcompd2d0(in1,size,flag,size1,tol,out1) drowcompa(2,in1,size[0],size[1],flag,tol,out1); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_ROWCOMP_H__*/ + diff --git a/src/c/linearAlgebra/interfaces/int_sqroot.h b/src/c/linearAlgebra/interfaces/int_sqroot.h new file mode 100644 index 0000000..57af2c0 --- /dev/null +++ b/src/c/linearAlgebra/interfaces/int_sqroot.h @@ -0,0 +1,27 @@ + /* Copyright (C) 2017 - 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: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __INT_SQROOT_H__ +#define __INT_SQROOT_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define d2sqrootd2(inp,size,out) dsqroota(inp,size[0],size[1],out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_HESS_H__*/ + diff --git a/src/c/linearAlgebra/proj/dproja.c b/src/c/linearAlgebra/proj/dproja.c new file mode 100644 index 0000000..e27cd6f --- /dev/null +++ b/src/c/linearAlgebra/proj/dproja.c @@ -0,0 +1,73 @@ +/* Copyright (C) 2017 - 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: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +/* Scilab function proj code in C */ + +#include <stdio.h> +#include <stdlib.h> +#include "proj.h" +#include "eye.h" +#include "matrixTranspose.h" +#include "matrixMultiplication.h" +#include <math.h> +#include "norm.h" + + +double dproja(double *x1,int l,int k,double *x2,int m2,int n2,double *y){ + int i,j; + double *w; + w = (double *)malloc(l*l*sizeof(double)); + double rk; + rk = drowcompa(1,x1,l,k,NULL,0,w); + + double *w1; + w1 = (double *)malloc(rk*l*sizeof(double)); + + for(i=0;i<l*rk;i++){ + w1[i]=w[i]; + } + + double *x1t; + x1t = (double *)malloc((l-n)*l*sizeof(double); + + for(i=n;i<l;i++){ + for(j=0;j<l;j++){ + x1t[i-n+j*l] = w1[i+j*l]; + } + } + + double x1x2; + x1x2 = (double *)malloc((l-n+1)*n2*sizeof(double)); + dmulma(x1t,l-n+1,l,x2,m2,n2,x1x2); + + double *inx1x2; + inx1x2 = (double *)malloc(); + + + + + + + + + + + + + + + + + + + +} diff --git a/src/c/linearAlgebra/projspec/dprojspeca.c b/src/c/linearAlgebra/projspec/dprojspeca.c new file mode 100644 index 0000000..aea9713 --- /dev/null +++ b/src/c/linearAlgebra/projspec/dprojspeca.c @@ -0,0 +1,67 @@ +/* Copyright (C) 2017 - 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: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +/* PROJSPEC function in scilab */ + +/* + //[S,P,D,index]=projspec(A) + //Spectral characteristics of A at 0 + //S = reduced resolvent at 0 (S=-Drazin_inverse(A)) + //P = spectral projection at 0 + //D = Nilpotent operator at 0 + //index = index of the 0 eigenvalue + //! + +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "norm.h" +#include "eye.h" + +#define eps pow(2,-52) + +double dprojspeca(double *inp1,int row,int col,double *out1,double *out2,double *out3){ + double tol = pow(10,-6); + int i,j,index; + /*norm(A,1)*/ + double nor; + nor = dnorma(inp1,row,col,1); + + /* P=eye(A),D=A,S=0*P;index=1; */ + if(nor < eps*row*row){ + memcpy(out2,inp1,row*col*sizeof(double)); + deyea(out2,row,col); + memcpy(out3,inp1,row*col*sizeof(double)); + for(i=0;i<row;i++){ + for(j=0;j<row;j++){ + out1[i*row+j] = 0; + } + } + index = 1; + } + + /* rcond(A) */ + double *rcon; + rcon = rcond(inp1,row); + if(rcon > tol){ + dinverma(inp1,out1,row); + for(i=0;i<row*col;i++){ + out2[i]=0; + out3[i]=0; + } + index = 0; + return index; + } + index = 1; +} diff --git a/src/c/linearAlgebra/qr/dqra.c b/src/c/linearAlgebra/qr/dqra.c new file mode 100644 index 0000000..bae4bc2 --- /dev/null +++ b/src/c/linearAlgebra/qr/dqra.c @@ -0,0 +1,298 @@ +/* Copyright (C) 2017 - 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: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +/* This C code is used to generate function for QR decomposition */ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "qr.h" +#include "lapack.h" +#include "string.h" +#include "matrixTranspose.h" + +/*For reference check Scilab source code & lapack library websites +Names of variable are almost same for convience. +*/ +/* +int min(int M,int N){ + if(M > N) return N; + return M; +} + +int max(int M,int N){ + if(M > N) return N; + return N; +}*/ + +/* External Function used of lapack library */ +extern double dgeqrf_(int *,int *,double *,int *,double *,double *,int *,int *); +extern double dlacpy_(char *,int *,int *,double *,int *,double *,int *); +extern double dgeqpf_(int *,int *,double *,int *,int *,double *,double *,int *); +extern double dorgqr_(int *,int *,int *,double *,int *,double *,double *,int *,int *); +extern void dlaset_(char *,int *,int *,double *,double *,double *,int *); + +/* function for finding qr */ +double dqra(int ninp,int nout,double *inp1,int M,int N,double tol,double *out1,double *out2,double *out3){ + int i,j; + char choice; + double alpha=0.0,beta=0.0; + int minMN = min(M,N); + + double *A; + A = (double *)malloc(M*N*sizeof(double)); + memcpy(A,inp1,M*N*sizeof(double)); + + if(M <= 0 || N <= 0){ + out1 = NULL; + out2 = NULL; + return 0; + } + /* doldqr */ + if(nout == 4){ /* [Q,R,rk,E]=qr(X [,tol]) */ + if(ninp == 1){ + tol = -1; + } + + int INFO,rk; + + int *JPVT; + JPVT = ( int *)malloc(N*sizeof(int)); + + double *TAU; + TAU = (double *)malloc(minMN*sizeof(double)); + + int LWORK = 3*N; + + double *WORK; + WORK = (double *)malloc(LWORK*sizeof(double)); + + for(i=1;i<=M;i++){ + JPVT[i-1]=0.0; + } + dgeqpf_(&M,&N,A,&M,JPVT,TAU,WORK,&INFO); + + choice = 'U'; + dlacpy_(&choice,&M,&N,A,&M,out2,&M); + + if(M > N){ + for(j=1;j<=N;j++){ + for(i=j+1;i<=M;i++){ + out2[i-1+(j-1)*M] = 0.0; + } + } + } + else{ + for(j=1;j<=M-1;j++){ + for(i=j+1;i<=M;i++){ + out2[i-1+(j-1)*M] = 0.0; + } + } + } + + if(M > N){ + choice = 'F'; + dlacpy_(&choice,&M,&N,A,&M,out1,&M); + for(j=N+1;j<=M;j++){ + for(i=1;i<=M;i++){ + out1[i-1+(j-1)*M] = 0.0; + } + } + } + else{ + choice = 'F'; + dlacpy_(&choice,&M,&M,A,&M,out1,&M); + } + + dorgqr_(&M,&M,&minMN,out1,&M,TAU,WORK,&LWORK,&INFO); + + choice = 'F'; + dlaset_(&choice,&N,&N,&alpha,&beta,out3,&N); + + for(j=1;j<=N;j++){ + i = JPVT[j-1]; + out3[i-1+(j-1)*N] = 1.0; + } + + double tt = abs(out2[0]); + + if(tol == -1){ + tol = (double)max(M,N)*pow(2,-52)*tt; + } + double ch; + //printf("%lf ",tol); + for(j=1;j<=minMN;j++){ + //printf("%e ",out2[(j-1)+(j-1)*M]); + if(out2[(j-1)+(j-1)*M] < 0){ + ch = -out2[(j-1)+(j-1)*M]; + } + else{ + ch = out2[(j-1)+(j-1)*M]; + } + if(ch > tol){ + rk = j; + } + else{ + break; + } + } + //printf("\n"); + return rk; + } + else if(ninp == 1){ + /* (intdgeqpf3) + [Q,R]=qr(A) + [Q,R,E]=qr(A) + */ + int LDA = M; + + double *TAU; + TAU = (double *)malloc(min(M,N)*sizeof(double)); + + int LWORK; + if(nout <= 2) + LWORK = N; + else + LWORK = 3*N; + + double *WORK; + WORK = (double *)malloc((LWORK+1)*sizeof(double)); + + int INFO; + + int *JPVT; + JPVT = (int *)malloc(N*sizeof(int)); + + if(nout <= 2){ + dgeqrf_(&M,&N,A,&M,TAU,WORK,&LWORK,&INFO); + } + else{ + for(i=0;i<N;i++){ + *(JPVT+i)=0.0; + } + dgeqpf_(&M,&N,A,&M,JPVT,TAU,WORK,&INFO); + } + + /* Copying code from A to R */ + choice = 'U'; + dlacpy_(&choice,&M,&N,A,&M,out2,&M); + /*for(i=0;i<M;i++){ + for(j=0;j<N-i;j++){ + out2[i+j*M] = A[i+j*M]; + } + }*/ + + if(M > N){ + for(j=1;j<=N;j++){ + for(i=j+1;i<=M;i++){ + out2[i-1+(j-1)*M] = 0.0; + } + } + } + else{ + for(j=1;j<=M-1;j++){ + for(i=j+1;i<=M;i++){ + out2[i-1+(j-1)*M] = 0.0; + } + } + } + /* lQ - out1 */ + if(M > N){ + choice = 'F'; + dlacpy_(&choice,&M,&N,A,&M,out1,&M); + /*for(i=0;i<M*N;i++){ + out1[i]=A[i]; + }*/ + for(j=N+1;j<=M;j++){ + for(i=1;i<=M;i++){ + out1[i+(j-1)*M] = 0.0; + } + } + } + else{ + choice = 'F'; + dlacpy_(&choice,&M,&M,A,&M,out1,&M); + /*for(i=0;i<M;i++){ + for(j=0;j<M;j++){ + out1 + } + }*/ + } + dorgqr_(&M,&M,&minMN,out1,&M,TAU,WORK,&LWORK,&INFO); + + if(nout > 2){ + choice = 'F'; + dlaset_(&choice,&N,&N,&alpha,&beta,out3,&N); + for(j=1;j<=N;j++){ + i = *(JPVT+j-1); + //printf("%d ",i-1+(j-1)*N); + *(out3+i-1+(j-1)*N) = 1.0; + } + //printf("\n"); + } + } + else{/* + [[Q,R]=qr(A,'e') + [Q,R,E]=qr(A,'e') ] */ + int *JPVT; + JPVT = (int *)malloc(N*sizeof(int)); + + double *TAU; + TAU = (double *)malloc(min(M,N)*sizeof(double)); + int LWORK; + if(nout <= 2){ + LWORK = N; + } + else{ + LWORK = 3*N; + } + + double *WORK; + WORK = (double *)malloc(LWORK*sizeof(double)); + + int INFO; + if(nout <= 2) + dgeqrf_(&M,&N,A,&M,TAU,WORK,&LWORK,&INFO); + else{ + for(i=1;i<=N;i++){ + JPVT[i-1]=0.0; + } + dgeqpf_(&M,&N,A,&M,JPVT,TAU,WORK,&INFO); + } + choice = 'U'; + + dlacpy_(&choice,&minMN,&N,A,&M,out2,&minMN); + + if(N >= 2){ + for(j=1;j<=N-1;j++){ + if(j+1 <= minMN){ + for(i=j+1;i<=minMN;i++){ + out2[i-1+(j-1)*minMN] = 0.0; + } + } + } + } + choice = 'F'; + dlacpy_(&choice,&M,&minMN,A,&M,out1,&M); + dorgqr_(&M,&minMN,&minMN,out1,&M,TAU,WORK,&LWORK,&INFO); + + if(nout > 2){ + choice = 'F'; + dlaset_(&choice,&N,&N,&alpha,&beta,out3,&N); + for(j=1;j<=N;j++){ + i = JPVT[j-1]; + out3[i-1+(j-1)*N] = 1.0; + } + } + } + return 0; +} diff --git a/src/c/linearAlgebra/rowcomp/drowcompa.c b/src/c/linearAlgebra/rowcomp/drowcompa.c new file mode 100644 index 0000000..3161a2d --- /dev/null +++ b/src/c/linearAlgebra/rowcomp/drowcompa.c @@ -0,0 +1,79 @@ +/* Copyright (C) 2017 - 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: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +/* This function is used to find row compression, range */ + +#include "rowcomp.h" +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "svd.h" +#include "norm.h" +#include "eye.h" +#include "matrixTranspose.h" +#include "qr.h" + +/* All variable names, are in consideration of scilab documentation. for reference please check the scilab code.*/ + +double drowcompa(int ninp,double *A,int row,int col,char *flag,double tol,double *w){ + double rk; + double *U; + double *S; + double *V; + double *q,*r,*e; + if(row == 0 || col == 0){ + w = NULL; + return 0; + } + + double nA1 = dnorma(A,row,col,1); + if(nA1 < sqrt(pow(2,-52))/10){ + deyea(w,row,col); + return 0; + } + if(ninp == 1){ + flag = "svd"; + tol = sqrt(pow(2,-52))*nA1; + } + else if(ninp == 2){ + tol = sqrt(pow(2,-52))*nA1; + } + else{ + if(tol < 0){ /* if tolerance is negative */ + printf(" Wrong values for input argument #: Non-negative scalar expected"); + } + } + int M = row,N=col; + int minMN = min(M,N); + char check[3]="qr"; + //printf(" %s ",flag); + if(strcmp(check,flag) == 0){ + /* calling qr function*/ + //printf(" * "); + q = (double *)malloc(M*min(M,N)*sizeof(double)); + r = (double *)malloc(minMN*N*sizeof(double)); + e = (double *)malloc(N*N*sizeof(double)); + rk = dqra(2,4,A,M,N,tol,q,r,e); + memcpy(w,q,row*col*sizeof(double)); + dtransposea(q,row,row,w); + return rk; + } + else{ + /* svd function type */ + U = (double *)malloc(row*row*sizeof(double)); + S = (double *)malloc(row*col*sizeof(double)); + V = (double *)malloc(col*col*sizeof(double)); + rk = dsvda(tol,A,row,col,0,4,U,S,V); + dtransposea(U,row,row,w); + return rk; + } +} diff --git a/src/c/linearAlgebra/sqroot/dsqroota.c b/src/c/linearAlgebra/sqroot/dsqroota.c new file mode 100644 index 0000000..1ba9726 --- /dev/null +++ b/src/c/linearAlgebra/sqroot/dsqroota.c @@ -0,0 +1,130 @@ +/* Copyright (C) 2017 - 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: Sandeep Gupta + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +/* Function - sqroot of scilab, W*W' hermitian factorization */ + +#include <stdio.h> +#include "stdlib.h" +#include "string.h" +#include <math.h> +#include "matrixTranspose.h" +#include "svd.h" +#include "matrixMultiplication.h" + +#define eps 2.22044604925e-16 + +/*It would be good, if you are doing conversoins for only valid inputs before + running the program, check all the conditions before hand. +*/ + +void dsqroota(double *inp,int row,int col, double *out){ + if(row != col){ + printf("Enter valid inputs only - matrix should be symetric\n"); + return; + } + int i,j; + double *U,*S,*V; + double *A,*B; + int rk; + + U = (double *)malloc((double)row*row*sizeof(double)); + S = (double *)malloc((double)Min(row,col)*Min(row,col)*sizeof(double)); + V = (double *)malloc((double)col*col*sizeof(double)); + A = (double *)malloc(rk*rk*sizeof(double)); + B = (double *)malloc(rk*row*sizeof(double)); + + double *Q1; + Q1 = (double *)malloc(row*col*sizeof(double)); + + dtransposea(inp,row,col,Q1); + + double *Q2; + Q2 = (double *)malloc(col*row*sizeof(double)); + + /* Q2 = (inp+inp1')/2; */ + for(i=0;i<row;i++){ + for(j=0;j<row;j++){ + Q2[i+j*row] = ((inp[i+j*row]+Q1[i+j*row])/2); + } + } + + /* norm(Q2-Q1,1) - finding the max value from sum of columns */ + double sum = 0; + double maxi=0; + for(i=0;i<row;i++){ + sum = 0; + for(j=0;j<col;j++) sum+=(Q2[i*row+j]-inp[i*row+j]); + if(maxi < sum){ + maxi = sum; + } + } + + /* if norm(Q1-Q,1) > 100*%eps then */ + if(maxi > 100*eps){ + printf("Warning: Wrong size for input argument and Symmetric expected\n"); + } + maxi = 0; + for(i=0;i<col;i++){ + sum=0; + for(j=0;j<row;j++) sum+=Q1[i*row+j]; + if(maxi < sum){ + maxi = sum; + } + } + + /*if norm(Q,1) < sqrt(%eps) then S=[];return;end*/ + + if(maxi < sqrt(eps)){ + out = NULL; + } + else{ + rk = dsvda(0,inp,row,col,0,4,U,S,V); + + /*Will be used in complex numbers*/ + //C = (double *)malloc(rk*row*sizeof(double)); + + /*for(i=0;i<row;i++){ + for(j=0;j<row;j++){ + printf("%lf ",S[i*row+j]); + } + printf("\n"); + }*/ + /*sqrt of S*/ + //printf("%d ",rk); + for(i=0;i<rk;i++){ + for(j=0;j<rk;j++){ + A[i*rk+j] = sqrt(S[i*row+j]); + //printf("%lf ",A[i*rk+j]); + } + } + for(i=0;i<col*rk;i++){ + B[i] = V[i]; + //printf("%lf ",B[i]); + } + //printf("\n"); + /*for(i=0;i<rk;i++){ + for(j=0;j<rk;j++){ + //A[i*rk+j] = sqrt(S[i*row+j]); + printf("%lf ",A[i*rk+j]); + } + printf("\n"); + }*/ + /*for(i=0;i<col;i++){ + for(j=0;j<rk;j++){ + //B[i*col+j] = VT[i*col+j]; + printf("%lf ",B[i*col+j]); + } + printf("\n"); + }*/ + dmulma(B,col,rk,A,rk,rk,out); + } +} diff --git a/src/c/linearAlgebra/sva/dsvaa.c b/src/c/linearAlgebra/sva/dsvaa.c index b7d07d8..691694e 100644 --- a/src/c/linearAlgebra/sva/dsvaa.c +++ b/src/c/linearAlgebra/sva/dsvaa.c @@ -20,6 +20,7 @@ #define eps 2.22044604925e-16 +/* Ref: Scilab source code */ void dsvaa(int ninp,double *in1,int row,int col,double in2,double *out1, \ double *out2,double *out3){ @@ -33,14 +34,14 @@ void dsvaa(int ninp,double *in1,int row,int col,double in2,double *out1, \ /* Calculation of svd of a given matrix */ double *U,*S,*V; - U = (double *)malloc((double)row*min(row,col)*sizeof(double)); - S = (double *)malloc((double)min(row,col)*min(row,col)*sizeof(double)); - V = (double *)malloc((double)col*min(row,col)*sizeof(double)); + U = (double *)malloc((double)row*Min(row,col)*sizeof(double)); + S = (double *)malloc((double)Min(row,col)*Min(row,col)*sizeof(double)); + V = (double *)malloc((double)col*Min(row,col)*sizeof(double)); dsvda(0,in1,M,N,1,3,U,S,V); if (ninp == 1){ /* [u,s,v] = sva(A) when input is only matrix */ - tol = max(row,col)*S[0]*eps; + tol = Max(row,col)*S[0]*eps; rk = 0; for(i=0;i<col;i++){ if(S[i+i*row] > tol){ @@ -52,7 +53,7 @@ void dsvaa(int ninp,double *in1,int row,int col,double in2,double *out1, \ tol = in2; if(tol > 1){ rk = tol; - if(rk > min(row,col)){ + if(rk > Min(row,col)){ printf("ERROR: Wrong value for input argument !"); out1 = NULL; out2 = NULL; @@ -70,21 +71,21 @@ void dsvaa(int ninp,double *in1,int row,int col,double in2,double *out1, \ } } arow = M; - acol = min(M,N); + acol = Min(M,N); /* Copying, the output in required format */ for(i=0;i<arow;i++){ for(j=0;j<rk;j++){ out1[i+j*row]=U[i+j*arow]; } } - arow = min(M,N); - for(i=0;i<rk;i++){ + arow = Min(M,N); + for(i=0;i<rk;i++){ /* Copying, the output in required format */ for(j=0;j<rk;j++){ out2[i+j*(int)rk] = S[i+j*arow]; } } arow = N; - acol = min(M,N); - for(i=0;i<arow;i++){ + acol = Min(M,N); + for(i=0;i<arow;i++){ /* Copying, the output in required format */ for(j=0;j<rk;j++){ out3[i+j*arow] = V[i+j*arow]; } diff --git a/src/c/linearAlgebra/svd/.1.c.swp b/src/c/linearAlgebra/svd/.1.c.swp Binary files differnew file mode 100644 index 0000000..81d9e9c --- /dev/null +++ b/src/c/linearAlgebra/svd/.1.c.swp diff --git a/src/c/linearAlgebra/svd/zsvda.c b/src/c/linearAlgebra/svd/zsvda.c index 0d36022..c75cc50 100644 --- a/src/c/linearAlgebra/svd/zsvda.c +++ b/src/c/linearAlgebra/svd/zsvda.c @@ -19,6 +19,7 @@ #include "matrixTranspose.h" #include "conj.h" +/* Lapack functions used . */ extern doubleComplex zgesvd_( char* , char* , int* , int* ,doubleComplex *,\ int* , double* ,doubleComplex* , int* ,doubleComplex* , int* ,\ doubleComplex* , int* , double* , int* ); @@ -113,7 +114,16 @@ void zsvda(doubleComplex *in1,int row,int col,int in2,int nout, doubleComplex *o out3[i+j*N] = zconjs(VT[j+i*N]); out3[j+i*N] = zconjs(VT[i+j*N]); } - } + } + /* output from zgesvd is copied to out2 variables in required format*/ + for(j=0;j<M;j++){ + for(k=0;k<N;k++){ + if(j == k) + out2[j*(Min(M,N))+k] = DoubleComplex(S[j],0); + else + out2[j*(Min(M,N))+k] = DoubleComplex(0,0); + } + } //ztransposea(VT,LDVT,Min(M,N),out3); /*for(i=0;i<N;i++){ for(j=0;j<N;j++){ @@ -124,7 +134,7 @@ void zsvda(doubleComplex *in1,int row,int col,int in2,int nout, doubleComplex *o //free(U); //free(VT); } - else{ + else{ /*svd(x,'e')*/ LDA = M; LDU = M; if(M > N){ @@ -156,18 +166,18 @@ void zsvda(doubleComplex *in1,int row,int col,int in2,int nout, doubleComplex *o for(j=0;j<N;j++){ out3[j+i*N] = zconjs(VT[i+j*Min(M,N)]); } - } + } + /* output from zgesvd is copied to out2 variables in required format*/ + for(j=0;j<Min(M,N);j++){ + for(k=0;k<Min(M,N);k++){ + if(j == k) + out2[j*(Min(M,N))+k] = DoubleComplex(S[j],0); + else + out2[j*(Min(M,N))+k] = DoubleComplex(0,0); + } + } //free(U); //free(VT); } - /* output from zgesvd is copied to out2 variables in required format*/ - for(j=0;j<Min(M,N);j++){ - for(k=0;k<Min(M,N);k++){ - if(j == k) - out2[j*(Min(M,N))+k] = DoubleComplex(S[j],0); - else - out2[j*(Min(M,N))+k] = DoubleComplex(0,0); - } - } } } diff --git a/src/c/matrixOperations/includes/norm.h b/src/c/matrixOperations/includes/norm.h index dc9d351..4fe3872 100644 --- a/src/c/matrixOperations/includes/norm.h +++ b/src/c/matrixOperations/includes/norm.h @@ -5,7 +5,7 @@ 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: Siddhesh Wani + Author: Sandeep Gupta Organization: FOSSEE, IIT Bombay Email: toolbox@scilab.in */ diff --git a/src/c/matrixOperations/includes/spec.h b/src/c/matrixOperations/includes/spec.h deleted file mode 100644 index b7b7d35..0000000 --- a/src/c/matrixOperations/includes/spec.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008 - INRIA - Arnaud TORSET - * - * 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 - * - */ - - -#ifndef __SPEC_H__ -#define __SPEC_H__ - -#include "dynlib_matrixoperations.h" -#include "doubleComplex.h" -#include "floatComplex.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* spec gives only the eigenvalues - If you want the eigenvalues and the eigenvectors, use spec2 */ - -/* spec */ -#define sspecs(in) in -#define dspecs(in) in -#define cspecs(in) in -#define zspecs(in) in - -EXTERN_MATOPS void sspeca(float* in, int rows, float* out); -EXTERN_MATOPS void dspeca(double* in, int rows, double* out); -EXTERN_MATOPS void cspeca(floatComplex* in, int rows, floatComplex* out); -EXTERN_MATOPS void zspeca(doubleComplex* in, int rows,doubleComplex* out); - - - -/* spec2 */ -#define sspec2s(in,out) sspecs(1);*out=in; -#define dspec2s(in,out) dspecs(1);*out=in; -#define cspec2s(in,out) cspecs(FloatComplex(1,0));*out=FloatComplex(creals(in),cimags(in)); -#define zspec2s(in,out) zspecs(DoubleComplex(1,0));*out=DoubleComplex(zreals(in),zimags(in)); - -EXTERN_MATOPS void sspec2a(float* in, int rows, float* eigenvalues,float* eigenvectors); -EXTERN_MATOPS void dspec2a(double* in, int rows, double* eigenvalues,double* eigenvectors); -EXTERN_MATOPS void cspec2a(floatComplex* in, int rows, floatComplex* eigenvalues,floatComplex* eigenvectors); -EXTERN_MATOPS void zspec2a(doubleComplex* in, int rows,doubleComplex* eigenvalues,doubleComplex* eigenvectors); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* __SPEC_H__ */ diff --git a/src/c/matrixOperations/includes/toeplitz.h b/src/c/matrixOperations/includes/toeplitz.h new file mode 100644 index 0000000..7384b43 --- /dev/null +++ b/src/c/matrixOperations/includes/toeplitz.h @@ -0,0 +1,37 @@ + /* Copyright (C) 2017 - 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: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __TOEPLITZ_H__ +#define __TOEPLITZ_H__ +#include "types.h" +#include "doubleComplex.h" +#include "floatComplex.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dtoeplitza(double* inp1,int size1,double* inp2,int size2,double* oup); +void u8toeplitza(uint8* inp1,int size1,uint8* inp2,int size2,uint8* oup); +void u16toeplitza(uint16* inp1,int size1,uint16* inp2,int size2,uint16* oup); +void ztoeplitza(doubleComplex* inp1,int size1,doubleComplex* inp2,int size2,doubleComplex* oup); +void gtoeplitza(char* inp1,int size1,char* inp2,int size2,char* oup); +void stoeplitza(float* inp1,int size1,float* inp2,int size2,float* oup); +void ctoeplitza(floatComplex* inp1,int size1,floatComplex* inp2,int size2,floatComplex* oup); +void i8toeplitza(int8* inp1,int size1,int8* inp2,int size2,int8* oup); +void i16toeplitza(int16* inp1,int size1,int16* inp2,int size2,int16* oup); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__TOEPLITZ_H__*/ diff --git a/src/c/matrixOperations/interfaces/int_spec.h b/src/c/matrixOperations/interfaces/int_spec.h deleted file mode 100644 index 77ab55e..0000000 --- a/src/c/matrixOperations/interfaces/int_spec.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET - * - * 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 - * - */ - -/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */ - -#ifndef __INT_SPEC_H__ -#define __INT_SPEC_H__ - -/* Only eigenvalues */ - -#define s0specc0(in) FloatComplex (sspecs(in) , 0) - -#define d0specz0(in) DoubleComplex ( dspecs(in) , 0) - -#define c0specc0(in) cspecs(in) - -#define z0specz0(in) zspecs(in) - -#define s2specc2(in,size,out) {float* ZEROS;\ - ZEROS=malloc((uint)(size[0]*size[0]*sizeof(float)));\ - szerosa(ZEROS,size[0],size[0]);\ - cspeca(FloatComplexMatrix(in,ZEROS,size[0]*size[0]), size[0], out);\ - } - -#define d2specz2(in,size,out) {double* ZEROS;\ - ZEROS=malloc((uint)(size[0]*size[0]*sizeof(double)));\ - dzerosa(ZEROS,size[0],size[0]);\ - zspeca(DoubleComplexMatrix(in,ZEROS,size[0]*size[0]), size[0] , out);\ - } - -#define c2specc2(in,size,out) cspeca(in, size[0], out) - -#define z2specz2(in,size,out) zspeca(in, size[0], out) - -/* Eigenvalues and eigenvectors */ - -#define s0specc0c0(in,out) cspec2s(FloatComplex( in,0) ,out) - -#define d0specz0z0(in,out) zspec2s(DoubleComplex(in,0) ,out) - -#define c0specc0c0(in,out) cspec2s(in,out) - -#define z0specz0z0(in,out) zspec2s(in,out) - -#define s2specc2c2(in,size,out1,out2) {float* ZEROS;\ - ZEROS=malloc((uint)(size[0]*size[0]*sizeof(float)));\ - szerosa(ZEROS,size[0],size[0]);\ - cspec2a(FloatComplexMatrix(in,ZEROS,size[0]*size[0]), size[0] , out1 , out2 );\ - } - -#define d2specz2z2(in,size,out1,out2) {double* ZEROS;\ - ZEROS=malloc((uint)(size[0]*size[0]*sizeof(double)));\ - dzerosa(ZEROS,size[0],size[0]);\ - zspec2a(DoubleComplexMatrix(in,ZEROS,size[0]*size[0]), size[0] , out1 , out2 );\ - } - - -#define c2specc2c2(in,size,out1,out2) cspec2a(in, size[0], out2, out1) - -#define z2specz2z2(in,size,out1,out2) zspec2a(in, size[0], out2, out1) - -#endif /* !__INT_SPEC_H__ */ diff --git a/src/c/matrixOperations/interfaces/int_toeplitz.h b/src/c/matrixOperations/interfaces/int_toeplitz.h new file mode 100644 index 0000000..b602e9a --- /dev/null +++ b/src/c/matrixOperations/interfaces/int_toeplitz.h @@ -0,0 +1,50 @@ + /* Copyright (C) 2017 - 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: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __INT_TOEPLITZ_H__ +#define __INT_TOEPLITZ_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define d2d2toeplitzd2(in1,size1,in2,size2,out) dtoeplitza(in1,size1[1],in2,size2[1],out) +#define d2toeplitzd2(in1,size1,out) dtoeplitza(in1,size1[1],in1,size1[1],out) + +#define u82u82toeplitzu82(in1,size1,in2,size2,out) u8toeplitza(in1,size1[1],in2,size2[1],out) +#define u82toeplitzu82(in1,size1,out) u8toeplitza(in1,size1[1],in1,size1[1],out) + +#define u162u162toeplitzu162(in1,size1,in2,size2,out) u16toeplitza(in1,size1[1],in2,size2[1],out) +#define u162toeplitzu162(in1,size1,out) u16toeplitza(in1,size1[1],in1,size1[1],out) + +#define g2g2toeplitzg2(in1,size1,in2,size2,out) gtoeplitza(in1,size1[1],in2,size2[1],out) +#define g2toeplitzg2(in1,size1,out) gtoeplitza(in1,size1[1],in1,size1[1],out) + +#define z2z2toeplitzz2(in1,size1,in2,size2,out) ztoeplitza(in1,size1[1],in2,size2[1],out) +#define z2toeplitzz2(in1,size1,out) ztoeplitza(in1,size1[1],in1,size1[1],out) + +#define s2s2toeplitzs2(in1,size1,in2,size2,out) stoeplitza(in1,size1[1],in2,size2[1],out) +#define s2toeplitzs2(in1,size1,out) stoeplitza(in1,size1[1],in1,size1[1],out) + +#define c2c2toeplitzc2(in1,size1,in2,size2,out) ctoeplitza(in1,size1[1],in2,size2[1],out) +#define c2toeplitzc2(in1,size1,out) ctoeplitza(in1,size1[1],in1,size1[1],out) + +#define i82i82toeplitzi82(in1,size1,in2,size2,out) i8toeplitza(in1,size1[1],in2,size2[1],out) +#define i82toeplitzi82(in1,size1,out) i8toeplitza(in1,size1[1],in1,size1[1],out) + +#define i162i162toeplitzi162(in1,size1,in2,size2,out) i16toeplitza(in1,size1[1],in2,size2[1],out) +#define i162toeplitzi162(in1,size1,out) i16toeplitza(in1,size1[1],in1,size1[1],out) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_TOEPLITZ_H__*/ diff --git a/src/c/matrixOperations/norm/dnorma.c b/src/c/matrixOperations/norm/dnorma.c index c912f85..2bb9b8b 100644 --- a/src/c/matrixOperations/norm/dnorma.c +++ b/src/c/matrixOperations/norm/dnorma.c @@ -6,6 +6,8 @@ are also available at http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt Author: Siddhesh Wani + + Edited by: Sandeep Gupta Organization: FOSSEE, IIT Bombay Email: toolbox@scilab.in */ @@ -14,13 +16,17 @@ /*Acceptable norms are: 1, 2, 'inf', 'fro', */ #include "norm.h" +#include "svd.h" #include <math.h> +#include <stdio.h> +#include<stdlib.h> double dnorma (double *in, int row, int col, int norm) { double res = 0, sum = 0; int col_count, row_count; - + double *S; + S = (double *)malloc(min(row,col)*sizeof(double)); switch (norm) { case 1: /*largest column sum*/ @@ -37,6 +43,8 @@ double dnorma (double *in, int row, int col, int norm) break; case 2: /*Largest singular value of the matrix*/ + dsvda(0,in,row,col,0,1,S,NULL,NULL); + res = S[0]; break; case 3: /*inf: largest row sum*/ @@ -69,4 +77,4 @@ double dnorma (double *in, int row, int col, int norm) return res; -}
\ No newline at end of file +} diff --git a/src/c/matrixOperations/spec/Makefile.am b/src/c/matrixOperations/spec/Makefile.am deleted file mode 100644 index 90dbd0a..0000000 --- a/src/c/matrixOperations/spec/Makefile.am +++ /dev/null @@ -1,70 +0,0 @@ -## -## Scilab ( http://www.scilab.org/ ) - This file is part of Scilab -## Copyright (C) 2006-2008 - INRIA - Bruno JOFRET -## -## 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 -## -## - -libSpec_la_CFLAGS = -I $(top_builddir)/src/c/type \ - -I $(top_builddir)/src/c/matrixOperations/includes \ - -I $(top_builddir)/src/c/operations/includes \ - -I $(top_builddir)/src/c/elementaryFunctions/includes\ - -I $(top_builddir)/src/c/auxiliaryFunctions/includes - - -instdir = $(top_builddir)/lib - -pkglib_LTLIBRARIES = libSpec.la - -HEAD = ../includes/spec.h - -libSpec_la_SOURCES = $(HEAD) \ - sspeca.c \ - dspeca.c \ - cspeca.c \ - zspeca.c - - -############ -## CHECK -############ - - -check_PROGRAMS = testDoubleSpec testFloatSpec - -check_LDADD = $(top_builddir)/src/c/type/libDoubleComplex.la \ - $(top_builddir)/src/c/type/libFloatComplex.la \ - $(top_builddir)/src/c/elementaryFunctions/sqrt/libSqrt.la \ - $(top_builddir)/src/fortran/lapack/libscilapack.la \ - $(top_builddir)/src/fortran/blas/libsciblas.la \ - $(top_builddir)/src/c/auxiliaryFunctions/abs/libAbs.la \ - $(top_builddir)/src/c/auxiliaryFunctions/conj/libConj.la \ - $(top_builddir)/src/c/auxiliaryFunctions/sign/libSign.la \ - $(top_builddir)/src/c/auxiliaryFunctions/pythag/libPythag.la \ - $(top_builddir)/src/c/operations/addition/libAddition.la \ - $(top_builddir)/src/c/operations/multiplication/libMultiplication.la \ - $(top_builddir)/src/c/matrixOperations/inversion/libMatrixInversion.la\ - $(top_builddir)/src/c/matrixOperations/zeros/libMatrixZeros.la\ - libSpec.la - -check_INCLUDES = -I $(top_builddir)/src/c/type \ - -I $(top_builddir)/src/c/matrixOperations/includes \ - -I $(top_builddir)/src/c/operations/includes \ - -I $(top_builddir)/src/c/elementaryFunctions/includes\ - -I $(top_builddir)/src/c/auxiliaryFunctions/includes - -testDoubleSpec_SOURCES = testDoubleSpec.c -testDoubleSpec_LDADD = $(check_LDADD) -testDoubleSpec_CFLAGS = $(check_INCLUDES) - -testFloatSpec_SOURCES = testFloatSpec.c -testFloatSpec_LDADD = $(check_LDADD) -testFloatSpec_CFLAGS = $(check_INCLUDES) - -TESTS = testDoubleSpec testFloatSpec - diff --git a/src/c/matrixOperations/spec/Makefile.in b/src/c/matrixOperations/spec/Makefile.in deleted file mode 100644 index 9c34c9e..0000000 --- a/src/c/matrixOperations/spec/Makefile.in +++ /dev/null @@ -1,755 +0,0 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -check_PROGRAMS = testDoubleSpec$(EXEEXT) testFloatSpec$(EXEEXT) -TESTS = testDoubleSpec$(EXEEXT) testFloatSpec$(EXEEXT) -subdir = src/c/matrixOperations/spec -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/includes/machine.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__installdirs = "$(DESTDIR)$(pkglibdir)" -LTLIBRARIES = $(pkglib_LTLIBRARIES) -libSpec_la_LIBADD = -am__objects_1 = -am_libSpec_la_OBJECTS = $(am__objects_1) libSpec_la-sspeca.lo \ - libSpec_la-dspeca.lo libSpec_la-cspeca.lo libSpec_la-zspeca.lo -libSpec_la_OBJECTS = $(am_libSpec_la_OBJECTS) -libSpec_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libSpec_la_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am_testDoubleSpec_OBJECTS = testDoubleSpec-testDoubleSpec.$(OBJEXT) -testDoubleSpec_OBJECTS = $(am_testDoubleSpec_OBJECTS) -testDoubleSpec_DEPENDENCIES = $(check_LDADD) -testDoubleSpec_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testDoubleSpec_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am_testFloatSpec_OBJECTS = testFloatSpec-testFloatSpec.$(OBJEXT) -testFloatSpec_OBJECTS = $(am_testFloatSpec_OBJECTS) -testFloatSpec_DEPENDENCIES = $(check_LDADD) -testFloatSpec_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testFloatSpec_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/includes -depcomp = $(SHELL) $(top_srcdir)/config/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -SOURCES = $(libSpec_la_SOURCES) $(testDoubleSpec_SOURCES) \ - $(testFloatSpec_SOURCES) -DIST_SOURCES = $(libSpec_la_SOURCES) $(testDoubleSpec_SOURCES) \ - $(testFloatSpec_SOURCES) -ETAGS = etags -CTAGS = ctags -am__tty_colors = \ -red=; grn=; lgn=; blu=; std= -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FGREP = @FGREP@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBMATH = @LIBMATH@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -ac_ct_F77 = @ac_ct_F77@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -libSpec_la_CFLAGS = -I $(top_builddir)/src/c/type \ - -I $(top_builddir)/src/c/matrixOperations/includes \ - -I $(top_builddir)/src/c/operations/includes \ - -I $(top_builddir)/src/c/elementaryFunctions/includes\ - -I $(top_builddir)/src/c/auxiliaryFunctions/includes - -instdir = $(top_builddir)/lib -pkglib_LTLIBRARIES = libSpec.la -HEAD = ../includes/spec.h -libSpec_la_SOURCES = $(HEAD) \ - sspeca.c \ - dspeca.c \ - cspeca.c \ - zspeca.c - -check_LDADD = $(top_builddir)/src/c/type/libDoubleComplex.la \ - $(top_builddir)/src/c/type/libFloatComplex.la \ - $(top_builddir)/src/c/elementaryFunctions/sqrt/libSqrt.la \ - $(top_builddir)/src/fortran/lapack/libscilapack.la \ - $(top_builddir)/src/fortran/blas/libsciblas.la \ - $(top_builddir)/src/c/auxiliaryFunctions/abs/libAbs.la \ - $(top_builddir)/src/c/auxiliaryFunctions/conj/libConj.la \ - $(top_builddir)/src/c/auxiliaryFunctions/sign/libSign.la \ - $(top_builddir)/src/c/auxiliaryFunctions/pythag/libPythag.la \ - $(top_builddir)/src/c/operations/addition/libAddition.la \ - $(top_builddir)/src/c/operations/multiplication/libMultiplication.la \ - $(top_builddir)/src/c/matrixOperations/inversion/libMatrixInversion.la\ - $(top_builddir)/src/c/matrixOperations/zeros/libMatrixZeros.la\ - libSpec.la - -check_INCLUDES = -I $(top_builddir)/src/c/type \ - -I $(top_builddir)/src/c/matrixOperations/includes \ - -I $(top_builddir)/src/c/operations/includes \ - -I $(top_builddir)/src/c/elementaryFunctions/includes\ - -I $(top_builddir)/src/c/auxiliaryFunctions/includes - -testDoubleSpec_SOURCES = testDoubleSpec.c -testDoubleSpec_LDADD = $(check_LDADD) -testDoubleSpec_CFLAGS = $(check_INCLUDES) -testFloatSpec_SOURCES = testFloatSpec.c -testFloatSpec_LDADD = $(check_LDADD) -testFloatSpec_CFLAGS = $(check_INCLUDES) -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/c/matrixOperations/spec/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/c/matrixOperations/spec/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ - } - -uninstall-pkglibLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ - done - -clean-pkglibLTLIBRARIES: - -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) - @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libSpec.la: $(libSpec_la_OBJECTS) $(libSpec_la_DEPENDENCIES) - $(libSpec_la_LINK) -rpath $(pkglibdir) $(libSpec_la_OBJECTS) $(libSpec_la_LIBADD) $(LIBS) - -clean-checkPROGRAMS: - @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list -testDoubleSpec$(EXEEXT): $(testDoubleSpec_OBJECTS) $(testDoubleSpec_DEPENDENCIES) - @rm -f testDoubleSpec$(EXEEXT) - $(testDoubleSpec_LINK) $(testDoubleSpec_OBJECTS) $(testDoubleSpec_LDADD) $(LIBS) -testFloatSpec$(EXEEXT): $(testFloatSpec_OBJECTS) $(testFloatSpec_DEPENDENCIES) - @rm -f testFloatSpec$(EXEEXT) - $(testFloatSpec_LINK) $(testFloatSpec_OBJECTS) $(testFloatSpec_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libSpec_la-cspeca.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libSpec_la-dspeca.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libSpec_la-sspeca.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libSpec_la-zspeca.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testDoubleSpec-testDoubleSpec.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testFloatSpec-testFloatSpec.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< - -libSpec_la-sspeca.lo: sspeca.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec_la_CFLAGS) $(CFLAGS) -MT libSpec_la-sspeca.lo -MD -MP -MF $(DEPDIR)/libSpec_la-sspeca.Tpo -c -o libSpec_la-sspeca.lo `test -f 'sspeca.c' || echo '$(srcdir)/'`sspeca.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libSpec_la-sspeca.Tpo $(DEPDIR)/libSpec_la-sspeca.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sspeca.c' object='libSpec_la-sspeca.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec_la_CFLAGS) $(CFLAGS) -c -o libSpec_la-sspeca.lo `test -f 'sspeca.c' || echo '$(srcdir)/'`sspeca.c - -libSpec_la-dspeca.lo: dspeca.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec_la_CFLAGS) $(CFLAGS) -MT libSpec_la-dspeca.lo -MD -MP -MF $(DEPDIR)/libSpec_la-dspeca.Tpo -c -o libSpec_la-dspeca.lo `test -f 'dspeca.c' || echo '$(srcdir)/'`dspeca.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libSpec_la-dspeca.Tpo $(DEPDIR)/libSpec_la-dspeca.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dspeca.c' object='libSpec_la-dspeca.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec_la_CFLAGS) $(CFLAGS) -c -o libSpec_la-dspeca.lo `test -f 'dspeca.c' || echo '$(srcdir)/'`dspeca.c - -libSpec_la-cspeca.lo: cspeca.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec_la_CFLAGS) $(CFLAGS) -MT libSpec_la-cspeca.lo -MD -MP -MF $(DEPDIR)/libSpec_la-cspeca.Tpo -c -o libSpec_la-cspeca.lo `test -f 'cspeca.c' || echo '$(srcdir)/'`cspeca.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libSpec_la-cspeca.Tpo $(DEPDIR)/libSpec_la-cspeca.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cspeca.c' object='libSpec_la-cspeca.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec_la_CFLAGS) $(CFLAGS) -c -o libSpec_la-cspeca.lo `test -f 'cspeca.c' || echo '$(srcdir)/'`cspeca.c - -libSpec_la-zspeca.lo: zspeca.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec_la_CFLAGS) $(CFLAGS) -MT libSpec_la-zspeca.lo -MD -MP -MF $(DEPDIR)/libSpec_la-zspeca.Tpo -c -o libSpec_la-zspeca.lo `test -f 'zspeca.c' || echo '$(srcdir)/'`zspeca.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libSpec_la-zspeca.Tpo $(DEPDIR)/libSpec_la-zspeca.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zspeca.c' object='libSpec_la-zspeca.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec_la_CFLAGS) $(CFLAGS) -c -o libSpec_la-zspeca.lo `test -f 'zspeca.c' || echo '$(srcdir)/'`zspeca.c - -testDoubleSpec-testDoubleSpec.o: testDoubleSpec.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleSpec_CFLAGS) $(CFLAGS) -MT testDoubleSpec-testDoubleSpec.o -MD -MP -MF $(DEPDIR)/testDoubleSpec-testDoubleSpec.Tpo -c -o testDoubleSpec-testDoubleSpec.o `test -f 'testDoubleSpec.c' || echo '$(srcdir)/'`testDoubleSpec.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/testDoubleSpec-testDoubleSpec.Tpo $(DEPDIR)/testDoubleSpec-testDoubleSpec.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testDoubleSpec.c' object='testDoubleSpec-testDoubleSpec.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleSpec_CFLAGS) $(CFLAGS) -c -o testDoubleSpec-testDoubleSpec.o `test -f 'testDoubleSpec.c' || echo '$(srcdir)/'`testDoubleSpec.c - -testDoubleSpec-testDoubleSpec.obj: testDoubleSpec.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleSpec_CFLAGS) $(CFLAGS) -MT testDoubleSpec-testDoubleSpec.obj -MD -MP -MF $(DEPDIR)/testDoubleSpec-testDoubleSpec.Tpo -c -o testDoubleSpec-testDoubleSpec.obj `if test -f 'testDoubleSpec.c'; then $(CYGPATH_W) 'testDoubleSpec.c'; else $(CYGPATH_W) '$(srcdir)/testDoubleSpec.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/testDoubleSpec-testDoubleSpec.Tpo $(DEPDIR)/testDoubleSpec-testDoubleSpec.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testDoubleSpec.c' object='testDoubleSpec-testDoubleSpec.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleSpec_CFLAGS) $(CFLAGS) -c -o testDoubleSpec-testDoubleSpec.obj `if test -f 'testDoubleSpec.c'; then $(CYGPATH_W) 'testDoubleSpec.c'; else $(CYGPATH_W) '$(srcdir)/testDoubleSpec.c'; fi` - -testFloatSpec-testFloatSpec.o: testFloatSpec.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatSpec_CFLAGS) $(CFLAGS) -MT testFloatSpec-testFloatSpec.o -MD -MP -MF $(DEPDIR)/testFloatSpec-testFloatSpec.Tpo -c -o testFloatSpec-testFloatSpec.o `test -f 'testFloatSpec.c' || echo '$(srcdir)/'`testFloatSpec.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/testFloatSpec-testFloatSpec.Tpo $(DEPDIR)/testFloatSpec-testFloatSpec.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testFloatSpec.c' object='testFloatSpec-testFloatSpec.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatSpec_CFLAGS) $(CFLAGS) -c -o testFloatSpec-testFloatSpec.o `test -f 'testFloatSpec.c' || echo '$(srcdir)/'`testFloatSpec.c - -testFloatSpec-testFloatSpec.obj: testFloatSpec.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatSpec_CFLAGS) $(CFLAGS) -MT testFloatSpec-testFloatSpec.obj -MD -MP -MF $(DEPDIR)/testFloatSpec-testFloatSpec.Tpo -c -o testFloatSpec-testFloatSpec.obj `if test -f 'testFloatSpec.c'; then $(CYGPATH_W) 'testFloatSpec.c'; else $(CYGPATH_W) '$(srcdir)/testFloatSpec.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/testFloatSpec-testFloatSpec.Tpo $(DEPDIR)/testFloatSpec-testFloatSpec.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testFloatSpec.c' object='testFloatSpec-testFloatSpec.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatSpec_CFLAGS) $(CFLAGS) -c -o testFloatSpec-testFloatSpec.obj `if test -f 'testFloatSpec.c'; then $(CYGPATH_W) 'testFloatSpec.c'; else $(CYGPATH_W) '$(srcdir)/testFloatSpec.c'; fi` - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -check-TESTS: $(TESTS) - @failed=0; all=0; xfail=0; xpass=0; skip=0; \ - srcdir=$(srcdir); export srcdir; \ - list=' $(TESTS) '; \ - $(am__tty_colors); \ - if test -n "$$list"; then \ - for tst in $$list; do \ - if test -f ./$$tst; then dir=./; \ - elif test -f $$tst; then dir=; \ - else dir="$(srcdir)/"; fi; \ - if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *[\ \ ]$$tst[\ \ ]*) \ - xpass=`expr $$xpass + 1`; \ - failed=`expr $$failed + 1`; \ - col=$$red; res=XPASS; \ - ;; \ - *) \ - col=$$grn; res=PASS; \ - ;; \ - esac; \ - elif test $$? -ne 77; then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *[\ \ ]$$tst[\ \ ]*) \ - xfail=`expr $$xfail + 1`; \ - col=$$lgn; res=XFAIL; \ - ;; \ - *) \ - failed=`expr $$failed + 1`; \ - col=$$red; res=FAIL; \ - ;; \ - esac; \ - else \ - skip=`expr $$skip + 1`; \ - col=$$blu; res=SKIP; \ - fi; \ - echo "$${col}$$res$${std}: $$tst"; \ - done; \ - if test "$$all" -eq 1; then \ - tests="test"; \ - All=""; \ - else \ - tests="tests"; \ - All="All "; \ - fi; \ - if test "$$failed" -eq 0; then \ - if test "$$xfail" -eq 0; then \ - banner="$$All$$all $$tests passed"; \ - else \ - if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ - banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ - fi; \ - else \ - if test "$$xpass" -eq 0; then \ - banner="$$failed of $$all $$tests failed"; \ - else \ - if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ - banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ - fi; \ - fi; \ - dashes="$$banner"; \ - skipped=""; \ - if test "$$skip" -ne 0; then \ - if test "$$skip" -eq 1; then \ - skipped="($$skip test was not run)"; \ - else \ - skipped="($$skip tests were not run)"; \ - fi; \ - test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ - dashes="$$skipped"; \ - fi; \ - report=""; \ - if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ - report="Please report to $(PACKAGE_BUGREPORT)"; \ - test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ - dashes="$$report"; \ - fi; \ - dashes=`echo "$$dashes" | sed s/./=/g`; \ - if test "$$failed" -eq 0; then \ - echo "$$grn$$dashes"; \ - else \ - echo "$$red$$dashes"; \ - fi; \ - echo "$$banner"; \ - test -z "$$skipped" || echo "$$skipped"; \ - test -z "$$report" || echo "$$report"; \ - echo "$$dashes$$std"; \ - test "$$failed" -eq 0; \ - else :; fi - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) - $(MAKE) $(AM_MAKEFLAGS) check-TESTS -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(pkglibdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ - clean-pkglibLTLIBRARIES mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-pkglibLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-pkglibLTLIBRARIES - -.MAKE: check-am install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ - clean-checkPROGRAMS clean-generic clean-libtool \ - clean-pkglibLTLIBRARIES ctags distclean distclean-compile \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-pkglibLTLIBRARIES install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-pkglibLTLIBRARIES - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/c/matrixOperations/spec/cspeca.c b/src/c/matrixOperations/spec/cspeca.c deleted file mode 100644 index a2b6548..0000000 --- a/src/c/matrixOperations/spec/cspeca.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008 - INRIA - Arnaud TORSET - * - * 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 - * - */ - -#include <stdlib.h> -#include "spec.h" - - - -void cspeca(floatComplex* in, int rows, floatComplex* out){ - /* As we use Lapack to find the eigenvalues, we must cast the floatComplex input into doubleComplex - and the doubleComplex output of dspeca into floatComplex*/ - - int i; - doubleComplex* dblin; - doubleComplex* dblout; - - dblin=(doubleComplex*)malloc((unsigned int)(rows*rows)*sizeof(doubleComplex)); - dblout=(doubleComplex*)malloc((unsigned int)rows*sizeof(doubleComplex)); - - for (i=0;i<rows*rows;i++) dblin[i]=DoubleComplex((double)creals(in[i]),(double)cimags(in[i])); - - zspeca(dblin,rows,dblout); - - for (i=0;i<rows;i++) out[i]=FloatComplex((float)zreals(dblout[i]),(float)zimags(dblout[i])); -} diff --git a/src/c/matrixOperations/spec/dspeca.c b/src/c/matrixOperations/spec/dspeca.c deleted file mode 100644 index 1131ecf..0000000 --- a/src/c/matrixOperations/spec/dspeca.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008 - INRIA - Arnaud TORSET - * - * 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 - * - */ - -#include <stdlib.h> -#include "spec.h" -#include "lapack.h" -#include "zeros.h" -#include "max.h" - -void dspeca(double* in, int rows,double* out){ - int i=0, j=0; - int symmetric=0; - int INFO=0; - int iWorkSize = 0; - double* pdblWork; - double* outReal; - double* outImag; - double* pdblLeftvectors; - double* pdblRightvectors; - double* inCopy; - - inCopy = (double*)malloc((unsigned int)(rows*rows) * sizeof(double)); - outReal = (double*)malloc((unsigned int)rows * sizeof(double)); - outImag = (double*)malloc((unsigned int)rows * sizeof(double)); - pdblLeftvectors=NULL; - pdblRightvectors=NULL; - - - iWorkSize = 3*rows; - pdblWork = (double*)malloc((unsigned int)iWorkSize * sizeof(double)); - - for(i=0;i<rows*rows;i++) inCopy[i]=in[i]; - /* look if the matrix is symmetric */ - for (i=0;i<rows;i++) - for (j=0;j<rows;j++) - if (in[i*rows+j]!=in[i+j*rows]) break; - - /* the matrix is symmetric if the 2 loops goes to end i.e - i==rows and j==rows */ - if ((i==rows)&&(j==rows)) symmetric=1; - - - /* apply lapack function according to symmetry */ - if(symmetric){ - C2F(dsyev)( "N", "U", &rows, in, &rows, outReal, pdblWork, &iWorkSize, &INFO ); - } - else { - C2F(dgeev)( "N", "N", &rows, inCopy, &rows, outReal, outImag, - pdblLeftvectors, &rows, pdblRightvectors, &rows, pdblWork, &iWorkSize, &INFO ); - } - - for (i=0;i<rows;i++) out[i]=outReal[i]; - - - free(inCopy); - free(outReal); - free(outImag); - free(pdblWork); - free(pdblLeftvectors); - free(pdblRightvectors); -} - diff --git a/src/c/matrixOperations/spec/sspeca.c b/src/c/matrixOperations/spec/sspeca.c deleted file mode 100644 index 50751a2..0000000 --- a/src/c/matrixOperations/spec/sspeca.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008 - INRIA - Arnaud TORSET - * - * 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 - * - */ - -#include <stdlib.h> -#include "spec.h" - - - -void sspeca(float* in, int rows, float* out){ - /* As we use Lapack to find the eigenvalues, we must cast the float input into double - and the doubleComplex output of dspeca into floatComplex*/ - - int i; - double* dblin; - double* dblout; - - dblin=(double*)malloc((unsigned int)(rows*rows)*sizeof(double)); - dblout=(double*)malloc((unsigned int)rows*sizeof(double)); - - for (i=0;i<rows*rows;i++) dblin[i]=(double)in[i]; - - dspeca(dblin,rows,dblout); - - for (i=0;i<rows;i++) out[i]=(float)dblout[i]; -} diff --git a/src/c/matrixOperations/spec/testDoubleSpec.c b/src/c/matrixOperations/spec/testDoubleSpec.c deleted file mode 100644 index 25c8806..0000000 --- a/src/c/matrixOperations/spec/testDoubleSpec.c +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008 - INRIA - Arnaud TORSET - * - * 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 - * - */ - -#include <stdlib.h> -#include "spec.h" -#include "stdio.h" -#include "assert.h" -#include "math.h" - -static void dspecaTest(void){ - double in[4]={1,1,1,3}; - double resultR[2]={0.5857864376269050765700,3.4142135623730949234300}; - - - double *out; - - int i; - - out=(double*)malloc((unsigned int)2*sizeof(double)); - - dspeca(in,2,out); - for(i=0;i<2;i++){ - if (out[i]>1e-16) assert( fabs(out[i]-resultR[i]) / fabs(out[i]) <3e-16); - else assert(1); - } - -} - - - - -static void zspecaTest(void){ - double inR[4]={1,1,1,3}; - double inI[4]={0,0,0,0}; - double resultR[2]={0.5857864376269050765700,3.4142135623730949234300}; - double resultI[2]={0,0}; - - double in2R[4]={1,1,-2,3}; - double in2I[4]={0,0,0,0}; - double result2R[2]={1.9999999999999997779554,1.9999999999999997779554}; - double result2I[2]={0.9999999999999997779554,-0.9999999999999997779554}; - - double in3R[16]={0.0603054538369178771973,0.631347181741148233414 ,0.0241030259057879447937,0.1527438252232968807221, - 0.9481177683919668197632,0.2744265575893223285675,0.4794727200642228126526,0.485576837789267301559, - 0.676400367170572280884,0.8321249918080866336823,0.0125875836238265037537,0.5453779897652566432953, - 0.8426716942340135574341,0.9029165101237595081329,0.4409482078626751899719,0.8332359003834426403046 }; - double in3I[16]={0.7233976423740386962891,0.4377150186337530612946,0.3080607382580637931824,0.8749813153408467769623, - 0.5355882328003644943237 ,0.3085998897440731525421,0.3354632416740059852600,0.2342486302368342876434, - 0.2589411698281764984131,0.8521509231068193912506,0.4821739485487341880798,0.6095217890106141567230, - 0.9872822705656290054321,0.9811426815576851367950,0.3303113700821995735169,0.3589145573787391185761}; - double result3R[4]={1.9486046375762748894545,0.2315060459861970343365,- 0.7694743345806510648188,- 0.2300808535483104266817}; - double result3I[4]={2.1242015857341254303492,- 0.4115101262891645017561,- 0.1980716835789462781925,0.3584662621795701720195}; - - doubleComplex *in,*in2,*in3,out[2],out2[4]; - - int i; - - in=DoubleComplexMatrix(inR,inI,4); - in2=DoubleComplexMatrix(in2R,in2I,4); - in3=DoubleComplexMatrix(in3R,in3I,16); - - zspeca(in,2,out); - for(i=0;i<2;i++){ - if (zreals(out[i])>1e-16) assert( fabs(zreals(out[i])-resultR[i]) / fabs(zreals(out[i])) <3e-16); - else assert(1); - if (zimags(out[i])>1e-16) assert( fabs(zimags(out[i])-resultI[i]) / fabs(zimags(out[i])) <1e-16); - else assert(1); - } - - - zspeca(in2,2,out); - for(i=0;i<2;i++){ - if (zreals(out[i])>1e-16) assert( fabs(zreals(out[i])-result2R[i]) / fabs(zreals(out[i])) <3e-16); - else assert(1); - if (zimags(out[i])>1e-16) assert( fabs(zimags(out[i])-result2I[i]) / fabs(zimags(out[i])) <3e-15); - else assert(1); - } - - - zspeca(in3,4,out2); - for(i=0;i<4;i++){ - if (zreals(out2[i])>1e-16) assert( fabs(zreals(out2[i])-result3R[i]) / fabs(zreals(out2[i])) <3e-15); - else assert(1); - if (zimags(out2[i])>1e-16) assert( fabs(zimags(out2[i])-result3I[i]) / fabs(zimags(out2[i])) <3e-15); - else assert(1); - } - - -} - - -static int testSpec(void){ - printf(">>> Double Spec Tests <<<\n"); - printf(">>> Double <<<\n"); - dspecaTest(); - printf(">>> DoubleComplex <<<\n"); - zspecaTest(); - return 0; -} - - -int main(void){ - assert (testSpec()==0); - - - return 0; -} diff --git a/src/c/matrixOperations/spec/testFloatSpec.c b/src/c/matrixOperations/spec/testFloatSpec.c deleted file mode 100644 index 9bd46ad..0000000 --- a/src/c/matrixOperations/spec/testFloatSpec.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008 - INRIA - Arnaud TORSET - * - * 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 - * - */ - -#include <stdlib.h> -#include "spec.h" -#include "stdio.h" -#include "assert.h" -#include "math.h" - -static void sspecaTest(void){ - float in[4]={1.0f,1.0f,1.0f,3.0f}; - float resultR[2]={0.5857864376269050765700f,3.4142135623730949234300f}; - - float in1[4]={0.0f,4.0f,1.0f,0.0f}; - float result[2]={2.0f,-2.0f}; - - float in2[4]={1.0f,1.0f,-2.0f,3.0f}; - - float *out; - - int i; - - out=(float *)malloc((unsigned int)2*sizeof(float)); - - sspeca(in,2,out); - for (i=0;i<2;i++) printf("%f\n",out[i]); - for(i=0;i<2;i++){ - if (out[i]>1e-16) assert( fabs(out[i]-resultR[i]) / fabs(out[i]) <1e-16); - else assert(1); - } - - - sspeca(in1,2,out); - for (i=0;i<2;i++) printf("%f\n",out[i]); - for(i=0;i<2;i++){ - if (out[i]>1e-16) assert( fabs(out[i]-result[i]) / fabs(out[i]) <1e-16); - else assert(1); - } - - sspeca(in2,2,out); - for (i=0;i<2;i++) printf("%f\n",out[i]); - -} - - -static void cspecaTest(void){ - float inR[4]={1.0f,1.0f,1.0f,3.0f}; - float inI[4]={0.0f,0.0f,0.0f,0.0f}; - float resultR[2]={0.5857864376269050765700f,3.4142135623730949234300f}; - float resultI[2]={0,0}; - - float in2R[4]={1.0f,1.0f,-2.0f,3.0f}; - float in2I[4]={0.0f,0.0f,0.0f,0.0f}; - float result2R[2]={1.9999999999999997779554f,1.9999999999999997779554f}; - float result2I[2]={0.9999999999999997779554f,-0.9999999999999997779554f}; - - floatComplex *in,*in2,out[4]; - - int i; - - in=FloatComplexMatrix(inR,inI,4); - in2=FloatComplexMatrix(in2R,in2I,4); - - cspeca(in,2,out); - for(i=0;i<2;i++){ - if (creals(out[i])>1e-16) assert( fabs(creals(out[i])-resultR[i]) / fabs(creals(out[i])) <1e-15); - else assert(1); - if (cimags(out[i])>1e-16) assert( fabs(cimags(out[i])-resultI[i]) / fabs(cimags(out[i])) <1e-16); - else assert(1); - } - - - cspeca(in2,2,out); - for(i=0;i<2;i++){ - if (creals(out[i])>1e-16) assert( fabs(creals(out[i])-result2R[i]) / fabs(creals(out[i])) <1e-15); - else assert(1); - if (cimags(out[i])>1e-16) assert( fabs(cimags(out[i])-result2I[i]) / fabs(cimags(out[i])) <1e-15); - else assert(1); - } - -} - - - - -static int testSpec(void){ - printf(">>> Float Spec Tests <<<\n"); - printf(">>> Float <<<\n"); - sspecaTest(); - printf(">>> FloatComplex <<<\n"); - cspecaTest(); - return 0; -} - - -int main(void){ - assert (testSpec()==0); - - - return 0; -} diff --git a/src/c/matrixOperations/spec/test_DoubleSpec/testDoubleSpec.vcxproj b/src/c/matrixOperations/spec/test_DoubleSpec/testDoubleSpec.vcxproj deleted file mode 100644 index f696bff..0000000 --- a/src/c/matrixOperations/spec/test_DoubleSpec/testDoubleSpec.vcxproj +++ /dev/null @@ -1,178 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Debug|x64">
- <Configuration>Debug</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|x64">
- <Configuration>Release</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{651B0E61-1047-4575-BE31-D9CB28062CBA}</ProjectGuid>
- <RootNamespace>testDoubleSpec</RootNamespace>
- <Keyword>Win32Proj</Keyword>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup>
- <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)bin\</OutDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\</OutDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MinimalRebuild>true</MinimalRebuild>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <Optimization>MaxSpeed</Optimization>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <ClCompile>
- <Optimization>MaxSpeed</Optimization>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- </Link>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClCompile Include="..\testDoubleSpec.c">
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\..\type\type.vcxproj">
- <Project>{9b1bd750-1fef-4d6b-9422-782d16181cee}</Project>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- </ProjectReference>
- <ProjectReference Include="..\..\matrixOperations.vcxproj">
- <Project>{fd335544-52bf-4736-a34e-77f591d158d5}</Project>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project>
\ No newline at end of file diff --git a/src/c/matrixOperations/spec/test_DoubleSpec/testDoubleSpec.vcxproj.filters b/src/c/matrixOperations/spec/test_DoubleSpec/testDoubleSpec.vcxproj.filters deleted file mode 100644 index dcdaea5..0000000 --- a/src/c/matrixOperations/spec/test_DoubleSpec/testDoubleSpec.vcxproj.filters +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
- <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
- <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- </Filter>
- <Filter Include="Resource Files">
- <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="..\testDoubleSpec.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- </ItemGroup>
-</Project>
\ No newline at end of file diff --git a/src/c/matrixOperations/spec/test_FloatSpec/testFloatSpec.vcxproj b/src/c/matrixOperations/spec/test_FloatSpec/testFloatSpec.vcxproj deleted file mode 100644 index 0631bb4..0000000 --- a/src/c/matrixOperations/spec/test_FloatSpec/testFloatSpec.vcxproj +++ /dev/null @@ -1,178 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Debug|x64">
- <Configuration>Debug</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|x64">
- <Configuration>Release</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{B7BEF8A2-3E42-4FA3-94A7-22618594057D}</ProjectGuid>
- <RootNamespace>testFloatSpec</RootNamespace>
- <Keyword>Win32Proj</Keyword>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup>
- <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)bin\</OutDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\</OutDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MinimalRebuild>true</MinimalRebuild>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <Optimization>MaxSpeed</Optimization>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <ClCompile>
- <Optimization>MaxSpeed</Optimization>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- </Link>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClCompile Include="..\testFloatSpec.c">
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\..\type\type.vcxproj">
- <Project>{9b1bd750-1fef-4d6b-9422-782d16181cee}</Project>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- </ProjectReference>
- <ProjectReference Include="..\..\matrixOperations.vcxproj">
- <Project>{fd335544-52bf-4736-a34e-77f591d158d5}</Project>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project>
\ No newline at end of file diff --git a/src/c/matrixOperations/spec/test_FloatSpec/testFloatSpec.vcxproj.filters b/src/c/matrixOperations/spec/test_FloatSpec/testFloatSpec.vcxproj.filters deleted file mode 100644 index 2ba2e59..0000000 --- a/src/c/matrixOperations/spec/test_FloatSpec/testFloatSpec.vcxproj.filters +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
- <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
- <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- </Filter>
- <Filter Include="Resource Files">
- <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="..\testFloatSpec.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- </ItemGroup>
-</Project>
\ No newline at end of file diff --git a/src/c/matrixOperations/spec/zspeca.c b/src/c/matrixOperations/spec/zspeca.c deleted file mode 100644 index a2b1c25..0000000 --- a/src/c/matrixOperations/spec/zspeca.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008 - INRIA - Arnaud TORSET - * - * 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 - * - */ - -#include <stdlib.h> -#include "spec.h" -#include "lapack.h" -#include "zeros.h" -#include "conj.h" - -void zspeca(doubleComplex* in, int rows,doubleComplex* out){ - int i = 0, j = 0; - int hermitian = 0; - int INFO = 0; - int iWorkSize = 0; - doubleComplex* pdblWork; - doubleComplex* pdblLeftvectors; - doubleComplex* pdblRightvectors; - doubleComplex* pdblRWork; - double* outReal; - double* outImag; - doubleComplex* inCopy; - - inCopy = (doubleComplex*)malloc((unsigned int)(rows*rows) * sizeof(doubleComplex)); - outReal = (double*)malloc((unsigned int)rows * sizeof(double)); - outImag = (double*)malloc((unsigned int)rows * sizeof(double)); - pdblLeftvectors=NULL; - pdblRightvectors=NULL; - - iWorkSize = 2*rows; - pdblWork = (doubleComplex*)malloc((unsigned int)iWorkSize * sizeof(doubleComplex)); - pdblRWork = (doubleComplex*)malloc((unsigned int)(3*rows) * sizeof(doubleComplex)); - - for(i=0;i<rows*rows;i++) inCopy[i]=DoubleComplex(zreals(in[i]),zimags(in[i])); - - /* look if the matrix is symmetric */ - for (i=0;i<rows;i++){ - for (j=0;j<rows;j++) - if ( (zreals(in[i*rows+j])!=zreals(zconjs(in[i+j*rows]))) || - (zimags(in[i*rows+j])!=zimags(zconjs(in[i+j*rows]))) ) - break; - if (j!=rows) break; - } - - - /* the matrix is symmetric if the 2 loops goes to end i.e - i==rows and j==rows */ - if ((i==rows)&&(j==rows)) hermitian=1; - - - /* apply lapack function according to symmetry */ - if(hermitian){ - C2F(zheev)( "N", "U", &rows, inCopy, &rows, outReal, pdblWork, &iWorkSize, outImag, &INFO ); - dzerosa(outImag,1,rows); - for (i=0;i<rows;i++) out[i]=DoubleComplex(outReal[i],outImag[i]); - } - else { - C2F(zgeev)( "N", "N", &rows, inCopy, &rows, out, - pdblLeftvectors, &rows, pdblRightvectors, &rows, pdblWork, &iWorkSize, - pdblRWork, &INFO ); - } - - - - free(inCopy); - free(outReal); - free(outImag); - free(pdblWork); - free(pdblRWork); - free(pdblLeftvectors); - free(pdblRightvectors); -} diff --git a/src/c/matrixOperations/spec2/Makefile.am b/src/c/matrixOperations/spec2/Makefile.am deleted file mode 100644 index 5a357fa..0000000 --- a/src/c/matrixOperations/spec2/Makefile.am +++ /dev/null @@ -1,70 +0,0 @@ -## -## Scilab ( http://www.scilab.org/ ) - This file is part of Scilab -## Copyright (C) 2006-2008 - INRIA - Bruno JOFRET -## -## 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 -## -## - -libSpec2_la_CFLAGS = -I $(top_builddir)/src/c/type \ - -I $(top_builddir)/src/c/matrixOperations/includes \ - -I $(top_builddir)/src/c/operations/includes \ - -I $(top_builddir)/src/c/elementaryFunctions/includes\ - -I $(top_builddir)/src/c/auxiliaryFunctions/includes - - -instdir = $(top_builddir)/lib - -pkglib_LTLIBRARIES = libSpec2.la - -HEAD = ../includes/spec.h - -libSpec2_la_SOURCES = $(HEAD) \ - sspec2a.c \ - dspec2a.c \ - cspec2a.c \ - zspec2a.c - - -############ -## CHECK -############ - - -check_PROGRAMS = testDoubleSpec2 testFloatSpec2 - -check_LDADD = $(top_builddir)/src/c/type/libDoubleComplex.la \ - $(top_builddir)/src/c/type/libFloatComplex.la \ - $(top_builddir)/src/c/elementaryFunctions/sqrt/libSqrt.la \ - $(top_builddir)/src/fortran/lapack/libscilapack.la \ - $(top_builddir)/src/fortran/blas/libsciblas.la \ - $(top_builddir)/src/c/auxiliaryFunctions/abs/libAbs.la \ - $(top_builddir)/src/c/auxiliaryFunctions/conj/libConj.la \ - $(top_builddir)/src/c/auxiliaryFunctions/sign/libSign.la \ - $(top_builddir)/src/c/auxiliaryFunctions/pythag/libPythag.la \ - $(top_builddir)/src/c/operations/addition/libAddition.la \ - $(top_builddir)/src/c/operations/multiplication/libMultiplication.la \ - $(top_builddir)/src/c/matrixOperations/inversion/libMatrixInversion.la\ - $(top_builddir)/src/c/matrixOperations/zeros/libMatrixZeros.la\ - libSpec2.la - -check_INCLUDES = -I $(top_builddir)/src/c/type \ - -I $(top_builddir)/src/c/matrixOperations/includes \ - -I $(top_builddir)/src/c/operations/includes \ - -I $(top_builddir)/src/c/elementaryFunctions/includes\ - -I $(top_builddir)/src/c/auxiliaryFunctions/includes - -testDoubleSpec2_SOURCES = testDoubleSpec2.c -testDoubleSpec2_LDADD = $(check_LDADD) -testDoubleSpec2_CFLAGS = $(check_INCLUDES) - -testFloatSpec2_SOURCES = testFloatSpec2.c -testFloatSpec2_LDADD = $(check_LDADD) -testFloatSpec2_CFLAGS = $(check_INCLUDES) - -TESTS = testDoubleSpec2 testFloatSpec2 - diff --git a/src/c/matrixOperations/spec2/Makefile.in b/src/c/matrixOperations/spec2/Makefile.in deleted file mode 100644 index 6e46c05..0000000 --- a/src/c/matrixOperations/spec2/Makefile.in +++ /dev/null @@ -1,757 +0,0 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -check_PROGRAMS = testDoubleSpec2$(EXEEXT) testFloatSpec2$(EXEEXT) -TESTS = testDoubleSpec2$(EXEEXT) testFloatSpec2$(EXEEXT) -subdir = src/c/matrixOperations/spec2 -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/includes/machine.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__installdirs = "$(DESTDIR)$(pkglibdir)" -LTLIBRARIES = $(pkglib_LTLIBRARIES) -libSpec2_la_LIBADD = -am__objects_1 = -am_libSpec2_la_OBJECTS = $(am__objects_1) libSpec2_la-sspec2a.lo \ - libSpec2_la-dspec2a.lo libSpec2_la-cspec2a.lo \ - libSpec2_la-zspec2a.lo -libSpec2_la_OBJECTS = $(am_libSpec2_la_OBJECTS) -libSpec2_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libSpec2_la_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am_testDoubleSpec2_OBJECTS = \ - testDoubleSpec2-testDoubleSpec2.$(OBJEXT) -testDoubleSpec2_OBJECTS = $(am_testDoubleSpec2_OBJECTS) -testDoubleSpec2_DEPENDENCIES = $(check_LDADD) -testDoubleSpec2_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testDoubleSpec2_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am_testFloatSpec2_OBJECTS = testFloatSpec2-testFloatSpec2.$(OBJEXT) -testFloatSpec2_OBJECTS = $(am_testFloatSpec2_OBJECTS) -testFloatSpec2_DEPENDENCIES = $(check_LDADD) -testFloatSpec2_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testFloatSpec2_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/includes -depcomp = $(SHELL) $(top_srcdir)/config/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -SOURCES = $(libSpec2_la_SOURCES) $(testDoubleSpec2_SOURCES) \ - $(testFloatSpec2_SOURCES) -DIST_SOURCES = $(libSpec2_la_SOURCES) $(testDoubleSpec2_SOURCES) \ - $(testFloatSpec2_SOURCES) -ETAGS = etags -CTAGS = ctags -am__tty_colors = \ -red=; grn=; lgn=; blu=; std= -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FGREP = @FGREP@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBMATH = @LIBMATH@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -ac_ct_F77 = @ac_ct_F77@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -libSpec2_la_CFLAGS = -I $(top_builddir)/src/c/type \ - -I $(top_builddir)/src/c/matrixOperations/includes \ - -I $(top_builddir)/src/c/operations/includes \ - -I $(top_builddir)/src/c/elementaryFunctions/includes\ - -I $(top_builddir)/src/c/auxiliaryFunctions/includes - -instdir = $(top_builddir)/lib -pkglib_LTLIBRARIES = libSpec2.la -HEAD = ../includes/spec.h -libSpec2_la_SOURCES = $(HEAD) \ - sspec2a.c \ - dspec2a.c \ - cspec2a.c \ - zspec2a.c - -check_LDADD = $(top_builddir)/src/c/type/libDoubleComplex.la \ - $(top_builddir)/src/c/type/libFloatComplex.la \ - $(top_builddir)/src/c/elementaryFunctions/sqrt/libSqrt.la \ - $(top_builddir)/src/fortran/lapack/libscilapack.la \ - $(top_builddir)/src/fortran/blas/libsciblas.la \ - $(top_builddir)/src/c/auxiliaryFunctions/abs/libAbs.la \ - $(top_builddir)/src/c/auxiliaryFunctions/conj/libConj.la \ - $(top_builddir)/src/c/auxiliaryFunctions/sign/libSign.la \ - $(top_builddir)/src/c/auxiliaryFunctions/pythag/libPythag.la \ - $(top_builddir)/src/c/operations/addition/libAddition.la \ - $(top_builddir)/src/c/operations/multiplication/libMultiplication.la \ - $(top_builddir)/src/c/matrixOperations/inversion/libMatrixInversion.la\ - $(top_builddir)/src/c/matrixOperations/zeros/libMatrixZeros.la\ - libSpec2.la - -check_INCLUDES = -I $(top_builddir)/src/c/type \ - -I $(top_builddir)/src/c/matrixOperations/includes \ - -I $(top_builddir)/src/c/operations/includes \ - -I $(top_builddir)/src/c/elementaryFunctions/includes\ - -I $(top_builddir)/src/c/auxiliaryFunctions/includes - -testDoubleSpec2_SOURCES = testDoubleSpec2.c -testDoubleSpec2_LDADD = $(check_LDADD) -testDoubleSpec2_CFLAGS = $(check_INCLUDES) -testFloatSpec2_SOURCES = testFloatSpec2.c -testFloatSpec2_LDADD = $(check_LDADD) -testFloatSpec2_CFLAGS = $(check_INCLUDES) -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/c/matrixOperations/spec2/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/c/matrixOperations/spec2/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ - } - -uninstall-pkglibLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ - done - -clean-pkglibLTLIBRARIES: - -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) - @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libSpec2.la: $(libSpec2_la_OBJECTS) $(libSpec2_la_DEPENDENCIES) - $(libSpec2_la_LINK) -rpath $(pkglibdir) $(libSpec2_la_OBJECTS) $(libSpec2_la_LIBADD) $(LIBS) - -clean-checkPROGRAMS: - @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list -testDoubleSpec2$(EXEEXT): $(testDoubleSpec2_OBJECTS) $(testDoubleSpec2_DEPENDENCIES) - @rm -f testDoubleSpec2$(EXEEXT) - $(testDoubleSpec2_LINK) $(testDoubleSpec2_OBJECTS) $(testDoubleSpec2_LDADD) $(LIBS) -testFloatSpec2$(EXEEXT): $(testFloatSpec2_OBJECTS) $(testFloatSpec2_DEPENDENCIES) - @rm -f testFloatSpec2$(EXEEXT) - $(testFloatSpec2_LINK) $(testFloatSpec2_OBJECTS) $(testFloatSpec2_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libSpec2_la-cspec2a.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libSpec2_la-dspec2a.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libSpec2_la-sspec2a.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libSpec2_la-zspec2a.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testDoubleSpec2-testDoubleSpec2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testFloatSpec2-testFloatSpec2.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< - -libSpec2_la-sspec2a.lo: sspec2a.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec2_la_CFLAGS) $(CFLAGS) -MT libSpec2_la-sspec2a.lo -MD -MP -MF $(DEPDIR)/libSpec2_la-sspec2a.Tpo -c -o libSpec2_la-sspec2a.lo `test -f 'sspec2a.c' || echo '$(srcdir)/'`sspec2a.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libSpec2_la-sspec2a.Tpo $(DEPDIR)/libSpec2_la-sspec2a.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sspec2a.c' object='libSpec2_la-sspec2a.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec2_la_CFLAGS) $(CFLAGS) -c -o libSpec2_la-sspec2a.lo `test -f 'sspec2a.c' || echo '$(srcdir)/'`sspec2a.c - -libSpec2_la-dspec2a.lo: dspec2a.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec2_la_CFLAGS) $(CFLAGS) -MT libSpec2_la-dspec2a.lo -MD -MP -MF $(DEPDIR)/libSpec2_la-dspec2a.Tpo -c -o libSpec2_la-dspec2a.lo `test -f 'dspec2a.c' || echo '$(srcdir)/'`dspec2a.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libSpec2_la-dspec2a.Tpo $(DEPDIR)/libSpec2_la-dspec2a.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dspec2a.c' object='libSpec2_la-dspec2a.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec2_la_CFLAGS) $(CFLAGS) -c -o libSpec2_la-dspec2a.lo `test -f 'dspec2a.c' || echo '$(srcdir)/'`dspec2a.c - -libSpec2_la-cspec2a.lo: cspec2a.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec2_la_CFLAGS) $(CFLAGS) -MT libSpec2_la-cspec2a.lo -MD -MP -MF $(DEPDIR)/libSpec2_la-cspec2a.Tpo -c -o libSpec2_la-cspec2a.lo `test -f 'cspec2a.c' || echo '$(srcdir)/'`cspec2a.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libSpec2_la-cspec2a.Tpo $(DEPDIR)/libSpec2_la-cspec2a.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cspec2a.c' object='libSpec2_la-cspec2a.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec2_la_CFLAGS) $(CFLAGS) -c -o libSpec2_la-cspec2a.lo `test -f 'cspec2a.c' || echo '$(srcdir)/'`cspec2a.c - -libSpec2_la-zspec2a.lo: zspec2a.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec2_la_CFLAGS) $(CFLAGS) -MT libSpec2_la-zspec2a.lo -MD -MP -MF $(DEPDIR)/libSpec2_la-zspec2a.Tpo -c -o libSpec2_la-zspec2a.lo `test -f 'zspec2a.c' || echo '$(srcdir)/'`zspec2a.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libSpec2_la-zspec2a.Tpo $(DEPDIR)/libSpec2_la-zspec2a.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zspec2a.c' object='libSpec2_la-zspec2a.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSpec2_la_CFLAGS) $(CFLAGS) -c -o libSpec2_la-zspec2a.lo `test -f 'zspec2a.c' || echo '$(srcdir)/'`zspec2a.c - -testDoubleSpec2-testDoubleSpec2.o: testDoubleSpec2.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleSpec2_CFLAGS) $(CFLAGS) -MT testDoubleSpec2-testDoubleSpec2.o -MD -MP -MF $(DEPDIR)/testDoubleSpec2-testDoubleSpec2.Tpo -c -o testDoubleSpec2-testDoubleSpec2.o `test -f 'testDoubleSpec2.c' || echo '$(srcdir)/'`testDoubleSpec2.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/testDoubleSpec2-testDoubleSpec2.Tpo $(DEPDIR)/testDoubleSpec2-testDoubleSpec2.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testDoubleSpec2.c' object='testDoubleSpec2-testDoubleSpec2.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleSpec2_CFLAGS) $(CFLAGS) -c -o testDoubleSpec2-testDoubleSpec2.o `test -f 'testDoubleSpec2.c' || echo '$(srcdir)/'`testDoubleSpec2.c - -testDoubleSpec2-testDoubleSpec2.obj: testDoubleSpec2.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleSpec2_CFLAGS) $(CFLAGS) -MT testDoubleSpec2-testDoubleSpec2.obj -MD -MP -MF $(DEPDIR)/testDoubleSpec2-testDoubleSpec2.Tpo -c -o testDoubleSpec2-testDoubleSpec2.obj `if test -f 'testDoubleSpec2.c'; then $(CYGPATH_W) 'testDoubleSpec2.c'; else $(CYGPATH_W) '$(srcdir)/testDoubleSpec2.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/testDoubleSpec2-testDoubleSpec2.Tpo $(DEPDIR)/testDoubleSpec2-testDoubleSpec2.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testDoubleSpec2.c' object='testDoubleSpec2-testDoubleSpec2.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleSpec2_CFLAGS) $(CFLAGS) -c -o testDoubleSpec2-testDoubleSpec2.obj `if test -f 'testDoubleSpec2.c'; then $(CYGPATH_W) 'testDoubleSpec2.c'; else $(CYGPATH_W) '$(srcdir)/testDoubleSpec2.c'; fi` - -testFloatSpec2-testFloatSpec2.o: testFloatSpec2.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatSpec2_CFLAGS) $(CFLAGS) -MT testFloatSpec2-testFloatSpec2.o -MD -MP -MF $(DEPDIR)/testFloatSpec2-testFloatSpec2.Tpo -c -o testFloatSpec2-testFloatSpec2.o `test -f 'testFloatSpec2.c' || echo '$(srcdir)/'`testFloatSpec2.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/testFloatSpec2-testFloatSpec2.Tpo $(DEPDIR)/testFloatSpec2-testFloatSpec2.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testFloatSpec2.c' object='testFloatSpec2-testFloatSpec2.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatSpec2_CFLAGS) $(CFLAGS) -c -o testFloatSpec2-testFloatSpec2.o `test -f 'testFloatSpec2.c' || echo '$(srcdir)/'`testFloatSpec2.c - -testFloatSpec2-testFloatSpec2.obj: testFloatSpec2.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatSpec2_CFLAGS) $(CFLAGS) -MT testFloatSpec2-testFloatSpec2.obj -MD -MP -MF $(DEPDIR)/testFloatSpec2-testFloatSpec2.Tpo -c -o testFloatSpec2-testFloatSpec2.obj `if test -f 'testFloatSpec2.c'; then $(CYGPATH_W) 'testFloatSpec2.c'; else $(CYGPATH_W) '$(srcdir)/testFloatSpec2.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/testFloatSpec2-testFloatSpec2.Tpo $(DEPDIR)/testFloatSpec2-testFloatSpec2.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testFloatSpec2.c' object='testFloatSpec2-testFloatSpec2.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatSpec2_CFLAGS) $(CFLAGS) -c -o testFloatSpec2-testFloatSpec2.obj `if test -f 'testFloatSpec2.c'; then $(CYGPATH_W) 'testFloatSpec2.c'; else $(CYGPATH_W) '$(srcdir)/testFloatSpec2.c'; fi` - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -check-TESTS: $(TESTS) - @failed=0; all=0; xfail=0; xpass=0; skip=0; \ - srcdir=$(srcdir); export srcdir; \ - list=' $(TESTS) '; \ - $(am__tty_colors); \ - if test -n "$$list"; then \ - for tst in $$list; do \ - if test -f ./$$tst; then dir=./; \ - elif test -f $$tst; then dir=; \ - else dir="$(srcdir)/"; fi; \ - if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *[\ \ ]$$tst[\ \ ]*) \ - xpass=`expr $$xpass + 1`; \ - failed=`expr $$failed + 1`; \ - col=$$red; res=XPASS; \ - ;; \ - *) \ - col=$$grn; res=PASS; \ - ;; \ - esac; \ - elif test $$? -ne 77; then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *[\ \ ]$$tst[\ \ ]*) \ - xfail=`expr $$xfail + 1`; \ - col=$$lgn; res=XFAIL; \ - ;; \ - *) \ - failed=`expr $$failed + 1`; \ - col=$$red; res=FAIL; \ - ;; \ - esac; \ - else \ - skip=`expr $$skip + 1`; \ - col=$$blu; res=SKIP; \ - fi; \ - echo "$${col}$$res$${std}: $$tst"; \ - done; \ - if test "$$all" -eq 1; then \ - tests="test"; \ - All=""; \ - else \ - tests="tests"; \ - All="All "; \ - fi; \ - if test "$$failed" -eq 0; then \ - if test "$$xfail" -eq 0; then \ - banner="$$All$$all $$tests passed"; \ - else \ - if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ - banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ - fi; \ - else \ - if test "$$xpass" -eq 0; then \ - banner="$$failed of $$all $$tests failed"; \ - else \ - if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ - banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ - fi; \ - fi; \ - dashes="$$banner"; \ - skipped=""; \ - if test "$$skip" -ne 0; then \ - if test "$$skip" -eq 1; then \ - skipped="($$skip test was not run)"; \ - else \ - skipped="($$skip tests were not run)"; \ - fi; \ - test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ - dashes="$$skipped"; \ - fi; \ - report=""; \ - if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ - report="Please report to $(PACKAGE_BUGREPORT)"; \ - test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ - dashes="$$report"; \ - fi; \ - dashes=`echo "$$dashes" | sed s/./=/g`; \ - if test "$$failed" -eq 0; then \ - echo "$$grn$$dashes"; \ - else \ - echo "$$red$$dashes"; \ - fi; \ - echo "$$banner"; \ - test -z "$$skipped" || echo "$$skipped"; \ - test -z "$$report" || echo "$$report"; \ - echo "$$dashes$$std"; \ - test "$$failed" -eq 0; \ - else :; fi - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) - $(MAKE) $(AM_MAKEFLAGS) check-TESTS -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(pkglibdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ - clean-pkglibLTLIBRARIES mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-pkglibLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-pkglibLTLIBRARIES - -.MAKE: check-am install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ - clean-checkPROGRAMS clean-generic clean-libtool \ - clean-pkglibLTLIBRARIES ctags distclean distclean-compile \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-pkglibLTLIBRARIES install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-pkglibLTLIBRARIES - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/c/matrixOperations/spec2/cspec2a.c b/src/c/matrixOperations/spec2/cspec2a.c deleted file mode 100644 index d3a4312..0000000 --- a/src/c/matrixOperations/spec2/cspec2a.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008 - INRIA - Arnaud TORSET - * - * 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 - * - */ - -#include <stdlib.h> -#include "spec.h" - - - -void cspec2a(floatComplex* in, int rows, floatComplex* eigenvalues,floatComplex* eigenvectors){ - /* As we use Lapack to find the eigenvalues, we must cast the floatComplex input into doubleComplex - and the doubleComplex outputs of dspeca into floatComplex*/ - - int i; - doubleComplex* dblin; - doubleComplex* dbleigenvalues,*dbleigenvectors; - - dblin=(doubleComplex*)malloc((unsigned int)(rows*rows)*sizeof(doubleComplex)); - dbleigenvalues=(doubleComplex*)malloc((unsigned int)(rows*rows)*sizeof(doubleComplex)); - dbleigenvectors=(doubleComplex*)malloc((unsigned int)(rows*rows)*sizeof(doubleComplex)); - - for (i=0;i<rows*rows;i++) dblin[i]=DoubleComplex((double)creals(in[i]),(double)cimags(in[i])); - - zspec2a(dblin,rows,dbleigenvalues,dbleigenvectors); - - for (i=0;i<rows*rows;i++) eigenvalues[i]=FloatComplex((float)zreals(dbleigenvalues[i]),(float)zimags(dbleigenvalues[i])); - for (i=0;i<rows*rows;i++) eigenvectors[i]=FloatComplex((float)zreals(dbleigenvectors[i]),(float)zimags(dbleigenvectors[i])); -} diff --git a/src/c/matrixOperations/spec2/dspec2a.c b/src/c/matrixOperations/spec2/dspec2a.c deleted file mode 100644 index 98b2c5a..0000000 --- a/src/c/matrixOperations/spec2/dspec2a.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008 - INRIA - Arnaud TORSET - * - * 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 - * - */ - -#include <stdlib.h> -#include "spec.h" -#include "lapack.h" -#include "zeros.h" -#include "max.h" - -void dspec2a(double* in, int rows,double* eigenvalues,double* eigenvectors){ - int i=0, j=0, ij=0, ij1=0; - int symmetric=0; - int INFO=0; - int iWorkSize = 0; - double* pdblWork; - double* outReal; - double* outImag; - double* pdblLeftvectors; - double* pdblRightvectors; - double* inCopy; - - /* FIXME : malloc here */ - inCopy = (double*)malloc((unsigned int)(rows*rows) * sizeof(double)); - outReal = (double*)malloc((unsigned int)rows * sizeof(double)); - outImag = NULL; - pdblLeftvectors=NULL; - pdblRightvectors=NULL; - - - iWorkSize = 4*rows; - pdblWork = (double*)malloc((unsigned int)iWorkSize * sizeof(double)); - - for(i=0;i<rows*rows;i++) inCopy[i]=in[i]; - - - - /* look if the matrix is symmetric */ - for (i=0;i<rows;i++){ - for (j=0;j<rows;j++) - if (in[i*rows+j]!=in[i+j*rows]) break; - if (j!=rows) break; - - } - - /* the matrix is symmetric if the 2 loops goes to end i.e - i==rows and j==rows */ - if ((i==rows)&&(j==rows)) symmetric=1; - - /* apply lapack function according to symmetry */ - if(symmetric){ - C2F(dsyev)( "V", "U", &rows, inCopy, &rows, outReal, pdblWork, &iWorkSize, &INFO ); - - /* Computation of eigenvectors */ - for (i=0;i<rows*rows;i++) eigenvectors[i] = inCopy[i]; - } - else { - pdblRightvectors=(double*)malloc((unsigned int)(rows*rows) * sizeof(double)); - outImag = (double*)malloc((unsigned int)rows * sizeof(double)); - C2F(dgeev)( "N", "V", &rows, inCopy, &rows, outReal, outImag, - pdblLeftvectors, &rows, pdblRightvectors, &rows, pdblWork, &iWorkSize, &INFO ); - - /* Computation of eigenvectors */ - j=0; - while (j<rows) - { - if (outImag[j]==0) - { - for(i = 0 ; i < rows ; i++) - { - ij = i + j * rows; - eigenvectors[ij] = pdblRightvectors[ij]; - } - j = j + 1; - } - else - { - for(i = 0 ; i < rows ; i++) - { - ij = i + j * rows; - ij1 = i + (j + 1) * rows; - eigenvectors[ij] = pdblRightvectors[ij]; - eigenvectors[ij1] = pdblRightvectors[ij]; - } - j = j + 2; - } - } - } - - /* Computation of eigenvalues */ - dzerosa(eigenvalues,1,rows*rows); - for (i=0;i<rows;i++) eigenvalues[i+i*rows]=outReal[i]; - - - - - free(inCopy); - free(outReal); - free(outImag); - free(pdblLeftvectors); - free(pdblRightvectors); - free(pdblWork); - -} - diff --git a/src/c/matrixOperations/spec2/sspec2a.c b/src/c/matrixOperations/spec2/sspec2a.c deleted file mode 100644 index d3ab00d..0000000 --- a/src/c/matrixOperations/spec2/sspec2a.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008 - INRIA - Arnaud TORSET - * - * 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 - * - */ - -#include <stdlib.h> -#include "spec.h" - - - -void sspec2a(float* in, int rows, float* eigenvalues,float* eigenvectors){ - /* As we use Lapack to find the eigenvalues, we must cast the float input into double - and the doubleComplex outputs of dspec2a into floatComplex*/ - - int i; - double* dblin; - double *dbleigenvalues,*dbleigenvectors; - - dblin=(double*)malloc((unsigned int)(rows*rows)*sizeof(double)); - dbleigenvalues = (double*)malloc((unsigned int)(rows*rows)*sizeof(double)); - dbleigenvectors = (double*)malloc((unsigned int)(rows*rows)*sizeof(double)); - - for (i=0;i<rows*rows;i++) dblin[i]=(double)in[i]; - - dspec2a(dblin,rows,dbleigenvalues,dbleigenvectors); - - for (i=0;i<rows*rows;i++) eigenvalues[i]=(float)dbleigenvalues[i]; - for (i=0;i<rows*rows;i++) eigenvectors[i]=(float)dbleigenvectors[i]; -} diff --git a/src/c/matrixOperations/spec2/testDoubleSpec2.c b/src/c/matrixOperations/spec2/testDoubleSpec2.c deleted file mode 100644 index a090f02..0000000 --- a/src/c/matrixOperations/spec2/testDoubleSpec2.c +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Copyright (C) 2008 - INRIA - Arnaud TORSET - * - * 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 - * - */ - - -#include "spec.h" -#include "stdio.h" -#include "assert.h" -#include "math.h" - -static void dspec2aTest(void){ - double in[4]={1,1,1,3}; - double resultValuesR[4]={0.5857864376269050765700,0,0,3.4142135623730949234300}; - double resultVectorsR[4]={- 0.9238795325112867384831,0.3826834323650897817792, - 0.3826834323650897817792,0.9238795325112867384831}; - - - double in2[4]={1,1,-2,3}; - double resultValues2R[4]={1.9999999999999997779554,0,0,1.9999999999999997779554}; - double resultVectors2R[4]={0.8164965809277261454824,- 0.4082482904638631282523, - 0.8164965809277261454824,- 0.4082482904638631282523}; - - double in3[9]={0,-1,0,1,0,0,0,0,0}; - double resultValues3R[9]={0}; - double resultVectors3R[9]={0.7071067811865474617150,0,0,0.7071067811865474617150,0,0,0,0,1}; - - - double out1[4],out2[4],out3[9],out4[9]; - - int i; - dspec2a(in3,3,out3,out4); - for(i=0;i<9;i++){ - if (out3[i]>1e-16) assert( fabs(out3[i]-resultValues3R[i]) / fabs(out3[i]) <3e-16); - else assert(1); - } - for(i=0;i<9;i++){ - if (out4[i]>1e-16) assert( fabs(out4[i]-resultVectors3R[i]) / fabs(out4[i]) <3e-16); - else assert(1); - } - - - dspec2a(in,2,out1,out2); - for(i=0;i<4;i++) printf("%f\n",out1[i]); - for(i=0;i<4;i++){ - if (out1[i]>1e-16) assert( fabs(out1[i]-resultValuesR[i]) / fabs(out1[i]) <3e-16); - else assert(1); - } - for(i=0;i<4;i++){ - if (out2[i]>1e-16) assert( fabs(out2[i]-resultVectorsR[i]) / fabs(out2[i]) <3e-16); - else assert(1); - } - - - dspec2a(in2,2,out1,out2); - - for(i=0;i<4;i++){ - if (out1[i]>1e-16) assert( fabs(out1[i]-resultValues2R[i]) / fabs(out1[i]) <1e-16); - else assert(1); - } - for(i=0;i<4;i++){ - if (out2[i]>1e-16) assert( fabs(out2[i]-resultVectors2R[i]) / fabs(out2[i]) <3e-16); - else assert(1); - } - -} - - - - -static void zspec2aTest(void){ - double inR[4]={1,1,1,3}; - double inI[4]={0,0,0,0}; - double resultValuesR[4]={0.5857864376269050765700,0,0,3.4142135623730949234300}; - double resultValuesI[4]={0,0,0,0}; - double resultVectorsR[4]={- 0.9238795325112867384831,0.3826834323650897817792, - 0.3826834323650897817792,0.9238795325112867384831}; - double resultVectorsI[4]={0,0,0,0}; - - double in2R[4]={1,1,-2,3}; - double in2I[4]={0,0,0,0}; - double resultValues2R[4]={1.9999999999999997779554,0,0,1.9999999999999997779554}; - double resultValues2I[4]={0.9999999999999997779554,0,0,-0.9999999999999997779554}; - double resultVectors2R[4]={0.8164965809277261454824,- 0.4082482904638631282523, - 0.8164965809277261454824,- 0.4082482904638631282523}; - double resultVectors2I[4]={0,- 0.4082482904638629062077,0,0.4082482904638629062077}; - - - double in3R[16]={ 0.4685934986919164657593, 0.4262020816095173358917, 0.4217656338587403297424, 0.1034853602759540081024 , - 0.4279759414494037628174, 0.7860729382373392581940, 0.8568082069978117942810, 0.1993437460623681545258 , - 0.7131301630288362503052, 0.5208952468819916248322, 0.9311723159626126289368, 0.4143836158327758312225, - 0.5980196148157119750977, 0.5549105503596365451813, 0.8552952585741877555847, 0.3097750707529485225678}; - double in3I[16]={0.9446128141134977340698, 0.2442680452950298786163, 0.8760446915403008460999, 0.4874215493910014629364, - 0.3844018988311290740967, 0.0922345430590212345123, 0.0705418726429343223572, 0.7338807261548936367035, - 0.7792180571705102920532, 0.7827638057060539722443, 0.2161567779257893562317, 0.3420197847299277782440, - 0.430093832314014434814 , 0.6261752569116652011871, 0.9554250938817858695984, 0.45415506651625037193 }; - double resultValues3R[16]={2.0556597713281337114211 , 0. , 0. , 0. , - 0. , - 0.3025728286579054682193 , 0. , 0. , - 0. , 0. , 0.1432776981289703988054 , 0. , - 0. , 0. , 0. , 0.59924918284561956571821}; - double resultValues3I[16]={2.0772175543447914947137 , 0. , 0. , 0. , - 0. , - 0.5223086999196728807959 , 0. , 0. , - 0. , 0. , 0.3871735516160564882782 , 0. , - 0. , 0. , 0. , - 0.2349232044266161556489 }; - double resultVectors3R[16]={ 0.5762578366606958546470 , 0.4529873647084416976583 , 0.5438116534400605495137 , 0.3599855200589946457868 , - - 0.3285074902800487195442, - 0.0923654569732548225147, 0.6473744750124794666846, - 0.1812302216765642182139 , - 0.7395301236826927748780, - 0.4588526195219964631811, 0.0997916953568371567496, - 0.3603263850824164338249 , - 0.0717862182160008133192, 0.6967198304315765922112, - 0.1153149977500917411355 , - 0.3232658081022470875077 }; - double resultVectors3I[16]={ 0. , - 0.1082260232744242933745, - 0.1403164362264210929254 , 0.0775054168635924967123 , - 0.0347047096401541868560, - 0.4780157518240965019984, 0. , 0.4493438228998393735303, - 0. , - 0.0484367977162360741072 , 0.0664282497469102783949 , - 0.3098340648435350952461 , - 0.1768623397230159322024, 0. , - 0.4621680558325051979551 , 0.3830799998945915163517}; - - - double in4R[49]={0.0292230211198329925537, 0.1069206790998578071594, 9.7463708464056253433228, 7.7042609406635165214539 , 6.3966313377022743225098, 9.5358861843124032020569, 4.1484833415597677230835, - 4.6615396952256560325623, 2.2384551353752613067627, 3.4569733263924717903137, 2.3406236339360475540161, 6.6193414805456995964050,2.6911795139312744140625,9.8302489006891846656799 , - 7.3933512251824140548706, 2.9021358629688620567322 , 3.9959496073424816131592 , 9.792278115637600421906 , 0.0755135808140039443970, 7.0210226578637957572937 , 8.9075061306357383728027 , - 6.5269742021337151527405 , 4.136228552088141441345 , 8.5816909139975905418396 , 2.3960896767675876617432 , 4.8200417729094624519348, 9.848585547879338264465 , 4.4697216479107737541199, - 2.3298137634992599487305, 2.2345139319077134132385, 8.0025654565542936325073, 7.7507343282923102378845, 4.8250066302716732025146, 7.8448831336572766304016 , 1.5346793178468942642212 , - 7.7228771103546023368835 , 8.9520217850804328918457, 9.4673257926478981971741, 6.9818257447332143783569, 9.5591608202084898948669, 0.4840173013508319854736, 5.3235206427052617073059, - 2.9468670953065156936646, 6.9771366892382502555847 , 9.3762038648128509521484 , 1.0755608463659882545471 , 7.7634243946522474288940, 6.3734178384765982627869 , 0.6630615703761577606201 }; - double in4I[49]={8.1694598542526364326477, 3.5473910067230463027954, 5.860544512979686260223, 3.4610254690051078796387, 4.4247510144487023353577, 8.8226650562137365341187, 7.6436930662021040916443 , - 7.764139864593744277954, 2.8076809318736195564270, 6.9086006004363298416138, 7.1747286943718791007996, 3.7201813608407974243164 , 9.3254965776577591896057, 2.2566775511950254440308, - 7.5211019208654761314392 , 3.0747506581246852874756 , 5.9793261485174298286438, 1.9238903466612100601196, 2.3870888305827975273132 , 7.4708331003785133361816, 9.7131536761298775672913, - 4.3703553732484579086304, 6.2248750543221831321716, 3.2913279719650745391846, 3.2963873865082859992981, 2.7686371374875307083130 , 4.8729835031554102897644, 7.7320465445518493652344 , - 9.0775218093767762184143, 5.0122931879013776779175, 5.1595458528026938438416, 5.79267887398600578308 , 1.5463936375454068183899 , 7.6111377868801355361938, 6.9079177780076861381531 , - 2.8732293471693992614746, 9.64253133628517389297 , 5.6607243325561285018921, 5.7821379369124770164490, 2.6634209789335727691650 , 4.7470985027030110359192, 6.0735465306788682937622, - 0.4097307054325938224793, 5.0125684589147567749023 , 5.2959309751167893409729, 6.2594583164900541305542, 2.2193526616320013999939 , 3.467419948428869247437, 3.9511676924303174018860 }; - double resultValues4R[49]={39.018457752476393807228 ,0,0,0,0,0,0, - 0,2.2455352415739073812517,0,0,0,0,0, - 0,0,- 8.4848591657394489828903,0,0,0,0, - 0,0,0,- 9.617033196016185669919,0,0,0, - 0,0,0,0,- 3.7815852014367528077798,0,0, - 0,0,0,0,0,- 4.44858427601393291440,0, - 0,0,0,0,0,0,- 0.3001282122401837670900}; - double resultValues4I[49]={36.525725390582877594170,0,0,0,0,0,0, - 0,- 5.9058762755733944516123,0,0,0,0,0, - 0,0,- 3.5959527108686115681735,0,0,0,0, - 0,0,0,1.8928051444081777088257,0,0,0, - 0,0,0,0,- 3.1889864758923365251064,0,0, - 0,0,0,0,0,3.2418188738592150777151,0, - 0,0,0,0,0,0,1.5279802073147508156836}; - - double resultVectors4R[49]={ 0.3499995148567048852684, 0.3131141942665225941234, 0.4518966551544936205431, 0.3429358568207974133912, 0.3073919828504245721490, 0.4236868694783915145763, 0.3928739146959387973368 , - 0.2654822689469810148566 , - 0.3607918093136298631762, 0.0473515544359270068586 , 0.5097969509656486986060 , -0.3771134435310480315096 , 0.2011534205484152293408, - 0.4415200724898113993078, - 0.5454886553461798515130, - 0.2173248800239625522224, - 0.2171708216301463378883 , - 0.2460117034233289534662 , -0.3694743444265859433351 , 0.3601018742104445391483, 0.1530612374027510713681, - 0.6385835932752577104310, - 0.0013906755423099548263, - 0.3368505708673739662551 , 0.1394203608831885433 , -0.2292783363046769218308 , -0.2740379414191142504187, 0.1926279946047058377889 , - - 0.6106238336849327819067, 0.0128604884735820379493, 0.2248434453925002574071, - 0.0955950290268089419854 , 0.6322383898844411431739 , - 0.1362122761803175874373, - 0.0030545591332723984190, - 0.5431360047322275619308, 0.1304324282476526930541, - 0.3713242513274904177401, - 0.2693820083406764376299 , - 0.1431429883314006001882 , 0.0533021313694299267438, 0.0071247423818797811501 , - - 0.156705245229635081738, 0.0034676864415526253982 , - 0.3351413975178426096768 , 0.2927797449896782921996 , 0.5714932440406852443005 , 0.0738366305178744797288, - 0.4509415569247051669422 }; - double resultVectors4I[49]={ 0.0720991445669864616796 , 0.0844739028302603361942 , 0. , 0.0173431366502564965337, -0.0428710162141596462515, 0.0695226101295536302871, 0.0999385617869267273150, - 0.2510960793336660668018 , - 0.1123901435582568414384, 0.0091069807153507792430, 0. , - 0.2545493692188907641771, 0.1149714203529902251111, 0.0762796210842419941667, - 0. , 0.0611827470444509316505, 0.2295643426501567385678, - 0.2950878328821502361024, 0.198556748820033573955, 0.0646801132828138114483, - 0.2660572521172601678785, - 0. , 0.2688905463703794573860, 0.2230635356255223633593 , - 0.2013432448241845862391, - 0.0386922946770884290668, 0.0358963301038670995480, - 0.3593711366897305303780 , - - 0.1386717901043315326337, 0.0600994116374372472356, - 0.1167558596038882207102 , 0.317965599565130263571, 0. , -0.0642522754144960878131, - 0.0853665514099945371695, - 0. , 0.2715431731544318272320, - 0.1184277560110737481658 , 0.3655618467608299226868, - 0.4598766797780974302512 , 0.0188698345957667955319, - 0.1446429340244405892246, - 0.346095581161616094867 , 0.0750882555805542639682, - 0.2494867985551498246188, - 0.2328934592128872882455, 0. , -0.0047307828167728396829, - 0.0078254955461786041004}; - - - - - doubleComplex *in,*in2,*in3,*in4,out1[4],out2[4],out3[16],out4[16],out5[49],out6[49]; - - int i; - - in=DoubleComplexMatrix(inR,inI,4); - in2=DoubleComplexMatrix(in2R,in2I,4); - in3=DoubleComplexMatrix(in3R,in3I,16); - in4=DoubleComplexMatrix(in4R,in4I,49); - zspec2a(in,2,out1,out2); - - - for(i=0;i<4;i++){ - if (zreals(out1[i])>1e-16) assert( fabs(zreals(out1[i])-resultValuesR[i]) / fabs(zreals(out1[i])) <3e-16); - else assert(1); - if (zimags(out1[i])>1e-16) assert( fabs(zimags(out1[i])-resultValuesI[i]) / fabs(zimags(out1[i])) <1e-16); - else assert(1); - } - - for(i=0;i<4;i++){ - if (zreals(out2[i])>1e-16) assert( fabs(zreals(out2[i])-resultVectorsR[i]) / fabs(zreals(out2[i])) <3e-16); - else assert(1); - if (zimags(out2[i])>1e-16) assert( fabs(zimags(out2[i])-resultVectorsI[i]) / fabs(zimags(out2[i])) <1e-16); - else assert(1); - } - - - zspec2a(in2,2,out1,out2); - for(i=0;i<4;i++){ - if (zreals(out1[i])>1e-16) assert( fabs(zreals(out1[i])-resultValues2R[i]) / fabs(zreals(out1[i])) <3e-16); - else assert(1); - if (zimags(out1[i])>1e-16) assert( fabs(zimags(out1[i])-resultValues2I[i]) / fabs(zimags(out1[i])) <3e-15); - else assert(1); - } - - for(i=0;i<4;i++){ - if (zreals(out2[i])>1e-16) assert( fabs(zreals(out2[i])-resultVectors2R[i]) / fabs(zreals(out2[i])) <3e-16); - else assert(1); - if (zimags(out2[i])>1e-16) assert( fabs(zimags(out2[i])-resultVectors2I[i]) / fabs(zimags(out2[i])) <3e-15); - else assert(1); - } - - - - zspec2a(in3,4,out3,out4); - for(i=0;i<16;i++){ - if (zreals(out3[i])>1e-16) assert( fabs(zreals(out3[i])-resultValues3R[i]) / fabs(zreals(out3[i])) <3e-15); - else assert(1); - if (zimags(out3[i])>1e-16) assert( fabs(zimags(out3[i])-resultValues3I[i]) / fabs(zimags(out3[i])) <3e-15); - else assert(1); - } - for(i=0;i<16;i++){ - if (zreals(out4[i])>1e-16) assert( fabs(zreals(out4[i])-resultVectors3R[i]) / fabs(zreals(out4[i])) <3e-15); - else assert(1); - if (zimags(out4[i])>1e-16) assert( fabs(zimags(out4[i])-resultVectors3I[i]) / fabs(zimags(out4[i])) <3e-14); - else assert(1); - } - - /* FIXME : assert : 3e-16 maybe du to little values like 0.001... */ - zspec2a(in4,7,out5,out6); - - for(i=0;i<49;i++){ - if (zreals(out5[i])>1e-16) assert( fabs(zreals(out5[i])-resultValues4R[i]) / fabs(zreals(out5[i])) <3e-15); - else assert(1); - if (zimags(out5[i])>1e-16) assert( fabs(zimags(out5[i])-resultValues4I[i]) / fabs(zimags(out5[i])) <3e-14); - else assert(1); - } - for(i=0;i<49;i++){ - if (zreals(out6[i])>1e-16) assert( fabs(zreals(out6[i])-resultVectors4R[i]) / fabs(zreals(out6[i])) <3e-14); - else assert(1); - if (zimags(out6[i])>1e-16) assert( fabs(zimags(out6[i])-resultVectors4I[i]) / fabs(zimags(out6[i])) <3e-13); - else assert(1); - } - - - -} - - -static int testSpec2(void){ - printf(">>> Double Spec2 Tests <<<\n"); - printf(">>> Double <<<\n"); - dspec2aTest(); - printf(">>> DoubleComplex <<<\n"); - zspec2aTest(); - return 0; -} - - -int main(void){ - assert (testSpec2()==0); - - - return 0; -} diff --git a/src/c/matrixOperations/spec2/testFloatSpec2.c b/src/c/matrixOperations/spec2/testFloatSpec2.c deleted file mode 100644 index fb2bc25..0000000 --- a/src/c/matrixOperations/spec2/testFloatSpec2.c +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008 - INRIA - Arnaud TORSET - * - * 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 - * - */ - - -#include "spec.h" -#include "stdio.h" -#include "assert.h" -#include "math.h" - -static void sspec2aTest(void){ - float in[4]={1.0f,1.0f,1.0f,3.0f}; - float resultValuesR[4]={0.5857864376269050765700f,0,0,3.4142135623730949234300f}; - float resultVectorsR[4]={- 0.9238795325112867384831f,0.3826834323650897817792f, - 0.3826834323650897817792f,0.9238795325112867384831f}; - - float in2[4]={1.0f,1.0f,-2.0f,3.0f}; - float resultValues2R[4]={1.9999999999999997779554f,0,0,1.9999999999999997779554f}; - float resultVectors2R[4]={0.8164965809277261454824f,- 0.4082482904638631282523f, - 0.8164965809277261454824f,- 0.4082482904638631282523f}; - float eigenvalues[4],eigenvectors[4]; - - int i; - - sspec2a(in,2,eigenvalues,eigenvectors); - - for(i=0;i<4;i++){ - if (eigenvalues[i]>1e-6) assert( fabs(eigenvalues[i]-resultValuesR[i]) / fabs(eigenvalues[i]) <1e-16); - else assert(1); - } - for(i=0;i<4;i++){ - if (eigenvectors[i]>1e-6) assert( fabs(eigenvectors[i]-resultVectorsR[i]) / fabs(eigenvectors[i]) <1e-16); - else assert(1); - } - - - sspec2a(in2,2,eigenvalues,eigenvectors); - - - - for(i=0;i<4;i++){ - if (eigenvalues[i]>1e-6) assert( fabs(eigenvalues[i]-resultValues2R[i]) / fabs(eigenvalues[i]) <1e-16); - else assert(1); - } - for(i=0;i<4;i++){ - if (eigenvectors[i]>1e-6) assert( fabs(eigenvectors[i]-resultVectors2R[i]) / fabs(eigenvectors[i]) <1e-16); - else assert(1); - } -} - - - - -static void cspec2aTest(void){ - float inR[4]={1.0f,1.0f,1.0f,3.0f}; - float inI[4]={0.0f,0.0f,0.0f,0.0f}; - float resultValuesR[4]={0.5857864376269050765700f,0,0,3.4142135623730949234300f}; - float resultValuesI[4]={0,0,0,0}; - float resultVectorsR[4]={- 0.9238795325112867384831f,0.3826834323650897817792f, - 0.3826834323650897817792f,0.9238795325112867384831f}; - float resultVectorsI[4]={0,0,0,0}; - - float in2R[4]={1.0f,1.0f,-2.0f,3.0f}; - float in2I[4]={0.0f,0.0f,0.0f,0.0f}; - float resultValues2R[4]={1.9999999999999997779554f,0,0,1.9999999999999997779554f}; - float resultValues2I[4]={0.9999999999999997779554f,0,0,-0.9999999999999997779554f}; - float resultVectors2R[4]={0.8164965809277261454824f,- 0.4082482904638631282523f, - 0.8164965809277261454824f,- 0.4082482904638631282523f}; - float resultVectors2I[4]={0,- 0.4082482904638629062077f,0,0.4082482904638629062077f}; - - floatComplex *in,*in2,out1[4],out2[4]; - - int i; - - in=FloatComplexMatrix(inR,inI,4); - in2=FloatComplexMatrix(in2R,in2I,4); - - cspec2a(in,2,out1,out2); - for(i=0;i<4;i++){ - if (creals(out1[i])>1e-16) assert( fabs(creals(out1[i])-resultValuesR[i]) / fabs(creals(out1[i])) <1e-15); - else assert(1); - if (cimags(out1[i])>1e-16) assert( fabs(cimags(out1[i])-resultValuesI[i]) / fabs(cimags(out1[i])) <1e-16); - else assert(1); - } - for(i=0;i<4;i++){ - if (creals(out2[i])>1e-16) assert( fabs(creals(out2[i])-resultVectorsR[i]) / fabs(creals(out2[i])) <1e-15); - else assert(1); - if (cimags(out2[i])>1e-16) assert( fabs(cimags(out2[i])-resultVectorsI[i]) / fabs(cimags(out2[i])) <1e-16); - else assert(1); - } - - - cspec2a(in2,2,out1,out2); - for(i=0;i<4;i++){ - if (creals(out1[i])>1e-16) assert( fabs(creals(out1[i])-resultValues2R[i]) / fabs(creals(out1[i])) <1e-15); - else assert(1); - if (cimags(out1[i])>1e-16) assert( fabs(cimags(out1[i])-resultValues2I[i]) / fabs(cimags(out1[i])) <1e-15); - else assert(1); - } - for(i=0;i<4;i++){ - if (creals(out2[i])>1e-16) assert( fabs(creals(out2[i])-resultVectors2R[i]) / fabs(creals(out2[i])) <1e-15); - else assert(1); - if (cimags(out2[i])>1e-16) assert( fabs(cimags(out2[i])-resultVectors2I[i]) / fabs(cimags(out2[i])) <1e-16); - else assert(1); - } -} - - - - -static int testSpec2(void){ - printf(">>> Float Spec2 Tests <<<\n"); - printf(">>> Float <<<\n"); - sspec2aTest(); - printf(">>> FloatComplex <<<\n"); - cspec2aTest(); - return 0; -} - - -int main(void){ - assert (testSpec2()==0); - - - return 0; -} diff --git a/src/c/matrixOperations/spec2/test_DoubleSpec2/testDoubleSpec2.vcxproj b/src/c/matrixOperations/spec2/test_DoubleSpec2/testDoubleSpec2.vcxproj deleted file mode 100644 index 7c36943..0000000 --- a/src/c/matrixOperations/spec2/test_DoubleSpec2/testDoubleSpec2.vcxproj +++ /dev/null @@ -1,178 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Debug|x64">
- <Configuration>Debug</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|x64">
- <Configuration>Release</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{FD0A4495-C372-41EF-B8EF-0A0939DA6C1E}</ProjectGuid>
- <RootNamespace>testDoubleSpec2</RootNamespace>
- <Keyword>Win32Proj</Keyword>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup>
- <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)bin\</OutDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\</OutDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MinimalRebuild>true</MinimalRebuild>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <Optimization>MaxSpeed</Optimization>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <ClCompile>
- <Optimization>MaxSpeed</Optimization>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- </Link>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClCompile Include="..\testDoubleSpec2.c">
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\..\type\type.vcxproj">
- <Project>{9b1bd750-1fef-4d6b-9422-782d16181cee}</Project>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- </ProjectReference>
- <ProjectReference Include="..\..\matrixOperations.vcxproj">
- <Project>{fd335544-52bf-4736-a34e-77f591d158d5}</Project>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project>
\ No newline at end of file diff --git a/src/c/matrixOperations/spec2/test_DoubleSpec2/testDoubleSpec2.vcxproj.filters b/src/c/matrixOperations/spec2/test_DoubleSpec2/testDoubleSpec2.vcxproj.filters deleted file mode 100644 index 04f409d..0000000 --- a/src/c/matrixOperations/spec2/test_DoubleSpec2/testDoubleSpec2.vcxproj.filters +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
- <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
- <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- </Filter>
- <Filter Include="Resource Files">
- <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="..\testDoubleSpec2.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- </ItemGroup>
-</Project>
\ No newline at end of file diff --git a/src/c/matrixOperations/spec2/test_FloatSpec2/testFloatSpec2.vcxproj b/src/c/matrixOperations/spec2/test_FloatSpec2/testFloatSpec2.vcxproj deleted file mode 100644 index f4154eb..0000000 --- a/src/c/matrixOperations/spec2/test_FloatSpec2/testFloatSpec2.vcxproj +++ /dev/null @@ -1,178 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Debug|x64">
- <Configuration>Debug</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|x64">
- <Configuration>Release</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{E20D0BC2-B28A-412C-9715-5B93B319A4A3}</ProjectGuid>
- <RootNamespace>testFloatSpec2</RootNamespace>
- <Keyword>Win32Proj</Keyword>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup>
- <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)bin\</OutDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\</OutDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MinimalRebuild>true</MinimalRebuild>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <Optimization>MaxSpeed</Optimization>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <ClCompile>
- <Optimization>MaxSpeed</Optimization>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>../../../includes;../../../type;../../includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <OutputFile>$(SolutionDir)bin\$(ProjectName).exe</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- </Link>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClCompile Include="..\testFloatSpec2.c">
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
- <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\..\type\type.vcxproj">
- <Project>{9b1bd750-1fef-4d6b-9422-782d16181cee}</Project>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- </ProjectReference>
- <ProjectReference Include="..\..\matrixOperations.vcxproj">
- <Project>{fd335544-52bf-4736-a34e-77f591d158d5}</Project>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project>
\ No newline at end of file diff --git a/src/c/matrixOperations/spec2/test_FloatSpec2/testFloatSpec2.vcxproj.filters b/src/c/matrixOperations/spec2/test_FloatSpec2/testFloatSpec2.vcxproj.filters deleted file mode 100644 index 0c38d2f..0000000 --- a/src/c/matrixOperations/spec2/test_FloatSpec2/testFloatSpec2.vcxproj.filters +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
- <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
- <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- </Filter>
- <Filter Include="Resource Files">
- <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="..\testFloatSpec2.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- </ItemGroup>
-</Project>
\ No newline at end of file diff --git a/src/c/matrixOperations/spec2/zspec2a.c b/src/c/matrixOperations/spec2/zspec2a.c deleted file mode 100644 index e33ed89..0000000 --- a/src/c/matrixOperations/spec2/zspec2a.c +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008 - INRIA - Arnaud TORSET - * - * 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 - * - */ - -#include <stdlib.h> -#include "spec.h" -#include "lapack.h" -#include "zeros.h" -#include "stdio.h" -#include "conj.h" - -void zspec2a(doubleComplex* in, int rows,doubleComplex* eigenvalues, doubleComplex* eigenvectors){ - int i = 0, j = 0; - int hermitian = 0; - int INFO = 0; - int iWorkSize = 0; - doubleComplex* pdblWork; - doubleComplex* pdblLeftvectors; - doubleComplex* pdblRightvectors; - doubleComplex* pdblRWork; - double* pdblRWork2; - double* outReal; - double* outImag; - doubleComplex* inCopy; - - inCopy = (doubleComplex*)malloc((unsigned int)(rows*rows) * sizeof(doubleComplex)); - outReal = (double*)malloc((unsigned int)rows * sizeof(double)); - outImag = (double*)malloc((unsigned int)rows * sizeof(double)); - pdblLeftvectors=NULL; - pdblRightvectors=NULL; - - iWorkSize = 2*rows; - pdblWork = (doubleComplex*)malloc((unsigned int)iWorkSize * sizeof(doubleComplex)); - pdblRWork = NULL; - pdblRWork2 = NULL; - - for(i=0;i<rows*rows;i++) { - inCopy[i]=DoubleComplex(zreals(in[i]),zimags(in[i])); - eigenvectors[i]=DoubleComplex(zreals(in[i]),zimags(in[i])); - } - zzerosa(eigenvalues,1,rows*rows); - - - /* look if the matrix is symmetric */ - for (i=0;i<rows;i++){ - for (j=0;j<rows;j++) - if ( (zreals(in[i*rows+j])!=zreals(zconjs(in[i+j*rows]))) || - (zimags(in[i*rows+j])!=zimags(zconjs(in[i+j*rows]))) ) - break; - if (j!=rows) break; - } - - - /* the matrix is symmetric if the 2 loops goes to end i.e - i==rows and j==rows */ - if ((i==rows)&&(j==rows)) hermitian=1; - - - /* apply lapack function according to symmetry */ - if(hermitian){ - pdblRWork2 = (double*)malloc((unsigned int)(3*rows) * sizeof(double)); - C2F(zheev)( "V", "U", &rows, eigenvectors, &rows, outReal, pdblWork, &iWorkSize, pdblRWork2, &INFO ); - dzerosa(outImag,1,rows); - for (i=0;i<rows;i++) eigenvalues[i+i*rows]=DoubleComplex(outReal[i],outImag[i]); - } - else { - pdblRWork = (doubleComplex*)malloc((unsigned int)(3*rows) * sizeof(doubleComplex)); - C2F(zgeev)( "N", "V", &rows, inCopy, &rows, eigenvalues, - pdblLeftvectors, &rows, eigenvectors, &rows, pdblWork, &iWorkSize, - pdblRWork, &INFO ); - for (i=1;i<rows;i++) { - eigenvalues[i+i*rows]=DoubleComplex(zreals(eigenvalues[i]),zimags(eigenvalues[i])); - eigenvalues[i]=DoubleComplex(0,0); - } - } - - - - - free(inCopy); - free(outReal); - free(outImag); - free(pdblWork); - free(pdblRWork); - free(pdblRWork2); - free(pdblLeftvectors); - free(pdblRightvectors); -} diff --git a/src/c/matrixOperations/toeplitz/ctoeplitza.c b/src/c/matrixOperations/toeplitz/ctoeplitza.c new file mode 100644 index 0000000..048a367 --- /dev/null +++ b/src/c/matrixOperations/toeplitz/ctoeplitza.c @@ -0,0 +1,36 @@ +#include <stdio.h> +#include "toeplitz.h" +#include "floatComplex.h" +#include "stdlib.h" +#include "string.h" +#include "cat.h" + +/*Function to build a Toeplitz Matrix for inputs of SingleComplex datatype*/ + +void ctoeplitza(floatComplex* inp1,int size1,floatComplex* inp2,int size2,floatComplex* oup) +{ + if (inp1[0]!=inp2[0]) + { + printf("Error!The first elements of the Vectors are not equal."); // First element of both input vectors must be equal for Toeplitz. + return; + } + int i, j; + + for(i=0;i<size1*size2;i++) oup[i] = 0; // Initializing the output matrix with zeros. + + for (i = 0; i<size1; i++) + { + for (j = 0; j<size2; j++) + { + oup[j*size1] = inp2[j]; // Elements of the second input vector are copied to the first row of the Toeplitx Matrix. + } + oup[i] = inp1[i]; // Elements of the first input vector are copied to the first column of the Toeplitx Matrix. + } + for (i = size2+1; i<size1*size2; i++) // Loop to build the rest of the Toeplitz matrix. + { + if (oup[i] == 0) + oup[i] = oup[i-size2-1]; + } +} + + diff --git a/src/c/matrixOperations/toeplitz/dtoeplitza.c b/src/c/matrixOperations/toeplitz/dtoeplitza.c new file mode 100644 index 0000000..ef075a9 --- /dev/null +++ b/src/c/matrixOperations/toeplitz/dtoeplitza.c @@ -0,0 +1,33 @@ +#include <stdio.h> +#include "toeplitz.h" + + +/*Function to build a Toeplitz Matrix for inputs of Double datatype*/ + + +void dtoeplitza(double* inp1,int size1,double* inp2,int size2,double* oup) +{ + if (inp1[0]!=inp2[0]) + { + printf("Error!The first elements of the Vectors are not equal."); // First element of both input vectors must be equal for Toeplitz. + return; + } + int i, j; + + for(i=0;i<size1*size2;i++) oup[i] = 0; // Initializing the output matrix with zeros. + + for (i = 0; i<size1; i++) + { + for (j = 0; j<size2; j++) + { + oup[j*size1] = inp2[j]; // Elements of the second input vector are copied to the first row of the Toeplitx Matrix. + } + oup[i] = inp1[i]; // Elements of the first input vector are copied to the first column of the Toeplitx Matrix. + } + for (i = size2+1; i<size1*size2; i++) // Loop to build the rest of the Toeplitz matrix. + { + if (oup[i] == 0) + oup[i] = oup[i-size2-1]; + } +} + diff --git a/src/c/matrixOperations/toeplitz/gtoeplitza.c b/src/c/matrixOperations/toeplitz/gtoeplitza.c new file mode 100644 index 0000000..c852f92 --- /dev/null +++ b/src/c/matrixOperations/toeplitz/gtoeplitza.c @@ -0,0 +1,35 @@ +#include <stdio.h> +#include "toeplitz.h" + + +/*Function to build a Toeplitz Matrix for inputs of Character datatype*/ + + +void gtoeplitza(char* inp1,int size1,char* inp2,int size2,char* oup) +{ + if (inp1[0]!=inp2[0]) + { + printf("Error!The first elements of the Vectors are not equal."); // First element of both input vectors must be equal for Toeplitz. + return; + } + int i, j; + + for(i=0;i<size1*size2;i++) oup[i] = 0; // Initializing the output matrix with zeros. + + for (i = 0; i<size1; i++) + { + for (j = 0; j<size2; j++) + { + oup[j*size1] = inp2[j]; // Elements of the second input vector are copied to the first row of the Toeplitx Matrix. + } + oup[i] = inp1[i]; // Elements of the first input vector are copied to the first column of the Toeplitx Matrix. + } + for (i = size2+1; i<size1*size2; i++) // Loop to build the rest of the Toeplitz matrix. + { + if (oup[i] == 0) + oup[i] = oup[i-size2-1]; + } + +} + + diff --git a/src/c/matrixOperations/toeplitz/i16toeplitza.c b/src/c/matrixOperations/toeplitz/i16toeplitza.c new file mode 100644 index 0000000..945f626 --- /dev/null +++ b/src/c/matrixOperations/toeplitz/i16toeplitza.c @@ -0,0 +1,32 @@ +#include <stdio.h> +#include "toeplitz.h" +#include "int16.h" + +/*Function to build a Toeplitz Matrix for inputs of Signed Int16 datatype*/ + + +void i16toeplitza(int16* inp1,int size1,int16* inp2,int size2,int16* oup) +{ + if (inp1[0]!=inp2[0]) + { + printf("Error!The first elements of the Vectors are not equal."); // First element of both input vectors must be equal for Toeplitz. + return; + } + int i, j; + + for(i=0;i<size1*size2;i++) oup[i] = 0; // Initializing the output matrix with zeros. + + for (i = 0; i<size1; i++) + { + for (j = 0; j<size2; j++) + { + oup[j*size1] = inp2[j]; // Elements of the second input vector are copied to the first row of the Toeplitx Matrix. + } + oup[i] = inp1[i]; // Elements of the first input vector are copied to the first column of the Toeplitx Matrix. + } + for (i = size2+1; i<size1*size2; i++) // Loop to build the rest of the Toeplitz matrix. + { + if (oup[i] == 0) + oup[i] = oup[i-size2-1]; + } +} diff --git a/src/c/matrixOperations/toeplitz/i8toeplitza.c b/src/c/matrixOperations/toeplitz/i8toeplitza.c new file mode 100644 index 0000000..5075cc1 --- /dev/null +++ b/src/c/matrixOperations/toeplitz/i8toeplitza.c @@ -0,0 +1,33 @@ +#include <stdio.h> +#include "toeplitz.h" +#include "int8.h" + + +/*Function to build a Toeplitz Matrix for inputs of Signed Int8 datatype*/ + + +void i8toeplitza(int8* inp1,int size1,int8* inp2,int size2,int8* oup) +{ + if (inp1[0]!=inp2[0]) + { + printf("Error!The first elements of the Vectors are not equal."); // First element of both input vectors must be equal for Toeplitz. + return; + } + int i, j; + + for(i=0;i<size1*size2;i++) oup[i] = 0; // Initializing the output matrix with zeros. + + for (i = 0; i<size1; i++) + { + for (j = 0; j<size2; j++) + { + oup[j*size1] = inp2[j]; // Elements of the second input vector are copied to the first row of the Toeplitx Matrix. + } + oup[i] = inp1[i]; // Elements of the first input vector are copied to the first column of the Toeplitx Matrix. + } + for (i = size2+1; i<size1*size2; i++) // Loop to build the rest of the Toeplitz matrix. + { + if (oup[i] == 0) + oup[i] = oup[i-size2-1]; + } +} diff --git a/src/c/matrixOperations/toeplitz/stoeplitza.c b/src/c/matrixOperations/toeplitz/stoeplitza.c new file mode 100644 index 0000000..11d91ce --- /dev/null +++ b/src/c/matrixOperations/toeplitz/stoeplitza.c @@ -0,0 +1,32 @@ +#include <stdio.h> +#include "toeplitz.h" + + +/*Function to build a Toeplitz Matrix for inputs of Float datatype*/ + + +void stoeplitza(float* inp1,int size1,float* inp2,int size2,float* oup) +{ + if (inp1[0]!=inp2[0]) + { + printf("Error!The first elements of the Vectors are not equal."); // First element of both input vectors must be equal for Toeplitz. + return; + } + int i, j; + + for(i=0;i<size1*size2;i++) oup[i] = 0; // Initializing the output matrix with zeros. + + for (i = 0; i<size1; i++) + { + for (j = 0; j<size2; j++) + { + oup[j*size1] = inp2[j]; // Elements of the second input vector are copied to the first row of the Toeplitx Matrix. + } + oup[i] = inp1[i]; // Elements of the first input vector are copied to the first column of the Toeplitx Matrix. + } + for (i = size2+1; i<size1*size2; i++) // Loop to build the rest of the Toeplitz matrix. + { + if (oup[i] == 0) + oup[i] = oup[i-size2-1]; + } +} diff --git a/src/c/matrixOperations/toeplitz/u16toeplitza.c b/src/c/matrixOperations/toeplitz/u16toeplitza.c new file mode 100644 index 0000000..8dab545 --- /dev/null +++ b/src/c/matrixOperations/toeplitz/u16toeplitza.c @@ -0,0 +1,33 @@ +#include <stdio.h> +#include "toeplitz.h" +#include "uint16.h" + + +/*Function to build a Toeplitz Matrix for inputs of Unsigned Int16 datatype*/ + + +void u16toeplitza(uint16* inp1,int size1,uint16* inp2,int size2,uint16* oup) +{ + if (inp1[0]!=inp2[0]) + { + printf("Error!The first elements of the Vectors are not equal."); // First element of both input vectors must be equal for Toeplitz. + return; + } + int i, j; + + for(i=0;i<size1*size2;i++) oup[i] = 0; // Initializing the output matrix with zeros. + + for (i = 0; i<size1; i++) + { + for (j = 0; j<size2; j++) + { + oup[j*size1] = inp2[j]; // Elements of the second input vector are copied to the first row of the Toeplitx Matrix. + } + oup[i] = inp1[i]; // Elements of the first input vector are copied to the first column of the Toeplitx Matrix. + } + for (i = size2+1; i<size1*size2; i++) // Loop to build the rest of the Toeplitz matrix. + { + if (oup[i] == 0) + oup[i] = oup[i-size2-1]; + } +} diff --git a/src/c/matrixOperations/toeplitz/u8toeplitza.c b/src/c/matrixOperations/toeplitz/u8toeplitza.c new file mode 100644 index 0000000..8301fc1 --- /dev/null +++ b/src/c/matrixOperations/toeplitz/u8toeplitza.c @@ -0,0 +1,33 @@ +#include <stdio.h> +#include "toeplitz.h" +#include "uint8.h" + + +/*Function to build a Toeplitz Matrix for inputs of Unsigned Int8 datatype*/ + + +void u8toeplitza(uint8* inp1,int size1,uint8* inp2,int size2,uint8* oup) +{ + if (inp1[0]!=inp2[0]) + { + printf("Error!The first elements of the Vectors are not equal."); // First element of both input vectors must be equal for Toeplitz. + return; + } + int i, j; + + for(i=0;i<size1*size2;i++) oup[i] = 0; // Initializing the output matrix with zeros. + + for (i = 0; i<size1; i++) + { + for (j = 0; j<size2; j++) + { + oup[j*size1] = inp2[j]; // Elements of the second input vector are copied to the first row of the Toeplitx Matrix. + } + oup[i] = inp1[i]; // Elements of the first input vector are copied to the first column of the Toeplitx Matrix. + } + for (i = size2+1; i<size1*size2; i++) // Loop to build the rest of the Toeplitz matrix. + { + if (oup[i] == 0) + oup[i] = oup[i-size2-1]; + } +} diff --git a/src/c/matrixOperations/toeplitz/ztoeplitza.c b/src/c/matrixOperations/toeplitz/ztoeplitza.c new file mode 100644 index 0000000..d47c5e1 --- /dev/null +++ b/src/c/matrixOperations/toeplitz/ztoeplitza.c @@ -0,0 +1,36 @@ +#include <stdio.h> +#include "toeplitz.h" +#include "doubleComplex.h" +#include "stdlib.h" +#include "string.h" +#include "cat.h" + + +/*Function to build a Toeplitz Matrix for inputs of DoubleComplex datatype*/ + + +void ztoeplitza(doubleComplex* inp1,int size1,doubleComplex* inp2,int size2,doubleComplex* oup) +{ + if (inp1[0]!=inp2[0]) + { + printf("Error!The first elements of the Vectors are not equal."); // First element of both input vectors must be equal for Toeplitz. + return; + } + int i, j; + + for(i=0;i<size1*size2;i++) oup[i] = DoubleComplex(0,0); // Initializing the output matrix with zeros. + + for (i = 0; i<size1; i++) + { + for (j = 0; j<size2; j++) + { + oup[j*size1] = inp2[j]; // Elements of the second input vector are copied to the first row of the Toeplitx Matrix. + } + oup[i] = inp1[i]; // Elements of the first input vector are copied to the first column of the Toeplitx Matrix. + } + for (i = size2+1; i<size1*size2; i++) // Loop to build the rest of the Toeplitz matrix. + { + if (oup[i] == DoubleComplex(0,0)) + oup[i] = oup[i-size2-1]; + } +} diff --git a/src/c/signalProcessing/%k/dmodka.c b/src/c/signalProcessing/%k/dmodka.c index c0630ec..8368cb6 100644 --- a/src/c/signalProcessing/%k/dmodka.c +++ b/src/c/signalProcessing/%k/dmodka.c @@ -1,3 +1,14 @@ +/* Copyright (C) 2017 - 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: Ankit Raj + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ #include<stdio.h> #include<math.h> #include "modk.h" @@ -10,7 +21,6 @@ double max_calc(double* ptr,int sz) ptr[0]=-1*ptr[0]; } mx=(ptr[0]); - //printf("%lf\n",mx); for(i=1;i<sz;i++) { if(ptr[i]<0) @@ -47,10 +57,7 @@ void dmodka(double* inp,int size,double* oup) c[l]=sqrt(inp[l]); } - int x=0; - //double maxi; - //maxi=max_calc(c,size); - //printf("%lf",maxi); + int x=0; while(max_calc(c,size)>eps) { @@ -88,10 +95,4 @@ void dmodka(double* inp,int size,double* oup) } } -/* -int main() -{ - double m[3]={0.1,0.2,0.3}; - dka(m,3); -} -*/ + diff --git a/src/c/signalProcessing/%sn/dmodsns.c b/src/c/signalProcessing/%sn/dmodsns.c index 06d0a6f..aae16c1 100644 --- a/src/c/signalProcessing/%sn/dmodsns.c +++ b/src/c/signalProcessing/%sn/dmodsns.c @@ -82,12 +82,4 @@ double dmodsns(double uu, double emmc) } return sn; } -/* -int main() -{ - double u,k; - u=4; - k=0.7; - sn(u,k); -} -*/ + diff --git a/src/c/signalProcessing/ell1mag/dell1maga.c b/src/c/signalProcessing/ell1mag/dell1maga.c index 4cc80ef..58ef303 100644 --- a/src/c/signalProcessing/ell1mag/dell1maga.c +++ b/src/c/signalProcessing/ell1mag/dell1maga.c @@ -19,11 +19,9 @@ void dell1maga(double eps,double m1,double* z,int size,double* oup ) { double s[size]; int i; - doubleComplex tp; for(i=0;i<size;i++) { - tp=DoubleComplex(z[i],0); - s[i]=zmodsns(tp,m1); + s[i]=dmodsns(z[i],m1); } double un[size]; int j; diff --git a/src/c/signalProcessing/ell1mag/zell1maga.c b/src/c/signalProcessing/ell1mag/zell1maga.c index 529cecb..35b4928 100644 --- a/src/c/signalProcessing/ell1mag/zell1maga.c +++ b/src/c/signalProcessing/ell1mag/zell1maga.c @@ -36,14 +36,13 @@ void zell1maga(double eps,double m1,doubleComplex* z,int size,double* oup ) int k; double ml; ml=eps*eps; - doubleComplex t1,t2,t3; - t2=DoubleComplex(ml,0); + doubleComplex tp1,tp2,tp3; for(k=0;k<size;k++) { - t1=zmuls(s[k],s[k]); - t2=zmuls(t2,t1); - t3=DoubleComplex(un[k],0); - v=zrdivs(t3,(zadds(t3,t2))); + tp1=zmuls(s[k],s[k]); + tp2=DoubleComplex(ml,0); + tp3=DoubleComplex(un[k],0); + v=zrdivs(tp3,zadds(tp3,(zmuls(tp2,tp1)))); oup[k]=zreals(v); } } diff --git a/src/c/signalProcessing/ffilt/gffilts.c b/src/c/signalProcessing/ffilt/gffilts.c index 538daf3..09876d0 100644 --- a/src/c/signalProcessing/ffilt/gffilts.c +++ b/src/c/signalProcessing/ffilt/gffilts.c @@ -80,11 +80,4 @@ void gffilts(char* ft,int size,double N,double fc,double fh,double* oup) oup[id]=1+oup[id]; } } -/* -int main() -{ - string s; - int n; - double fl,fh; -} -*/ + diff --git a/src/c/signalProcessing/fsfirlin/dfsfirlina.c b/src/c/signalProcessing/fsfirlin/dfsfirlina.c index d2079f4..e44f464 100644 --- a/src/c/signalProcessing/fsfirlin/dfsfirlina.c +++ b/src/c/signalProcessing/fsfirlin/dfsfirlina.c @@ -11,11 +11,9 @@ */ #include<stdio.h> - #include<math.h> #include "sincd.h" #include "fsfirlin.h" -//#define PI 3.14159265358979 void dfsfirlina(double* hd,int size,double flag,double* hst) { diff --git a/src/c/signalProcessing/sincd/dsincds.c b/src/c/signalProcessing/sincd/dsincds.c index 1475d8d..c9f2f81 100644 --- a/src/c/signalProcessing/sincd/dsincds.c +++ b/src/c/signalProcessing/sincd/dsincds.c @@ -13,7 +13,6 @@ #include<stdio.h> #include<math.h> #include "sincd.h" -//#define PI 3.14159265358979 void dsincds(double n,double flg,double* oup) { double npt=4*n; diff --git a/src/c/signalProcessing/sincd/u8sincds.c b/src/c/signalProcessing/sincd/u8sincds.c index d03f48a..ff0a2ac 100644 --- a/src/c/signalProcessing/sincd/u8sincds.c +++ b/src/c/signalProcessing/sincd/u8sincds.c @@ -13,12 +13,11 @@ #include<stdio.h> #include<math.h> #include "sincd.h" -#define PI 3.14159265358979 void u8sincds(int n,int flg,double* oup) { double npt=4*n; int sz=4*n; - double pas=PI/npt; + double pas=M_PI/npt; double om[sz+1]; int i; //om[0]=0; @@ -69,7 +68,7 @@ void u8sincds(int n,int flg,double* oup) int a; for(a=0;a<=4*n;a++) { - om[a]=om[a]-(PI/(2*n)); + om[a]=om[a]-(M_PI/(2*n)); } int j,k; for(j=0;j<=4*n;j++) diff --git a/src/c/signalProcessing/zmodsns.c b/src/c/signalProcessing/zmodsns.c new file mode 100644 index 0000000..5f35059 --- /dev/null +++ b/src/c/signalProcessing/zmodsns.c @@ -0,0 +1,161 @@ +/* Copyright (C) 2017 - 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: Ankit Raj + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + Reference:- Abramowitz, Milton and Stegun, Irene A + Handbook of Mathematical Functions, Dover, 1965 + Chapter 16 (Sections 16.4, 16.13 and 16.15) + Link for FORTRAN code:-http://www.aip.de/groups/soe/local/numres/bookfpdf/f6-11.pdf +*/ + +#include<stdio.h> +#include<math.h> +#include "modsn.h" +#include "doubleComplex.h" +#define CA 0.0003 + +doubleComplex zmodsns(doubleComplex uu,double emmc) +{ + doubleComplex ans; + double uur,uui; + uur=zreals(uu); + uui=zimags(uu); + double sr,cr,dr; + //Performing Elliptic Function operation for the real values + double a1,b1,c1,d1,emc1,u1; + double em1[14],en1[14]; + int i1,ii1,l1,bo1; + emc1=1-emmc; + u1=uur; + if(emc1) + { + bo1=(emc1<0.0); + if(bo1) + { + d1=1.0-emc1; + emc1/=-1.0/d1; + u1*=(d1=sqrt(d1)); + } + a1=1.0; + dr=1.0; + for(i1=1;i1<=13;i1++) + { + l1=i1; + em1[i1]=a1; + en1[i1]=(emc1=sqrt(emc1)); + c1=0.5*(a1+emc1); + if(fabs(a1-emc1)<=CA*a1)break; + emc1*=a1; + a1=c1; + } + u1*=c1; + sr=sin(u1); + cr=cos(u1); + if(sr) + { + a1=cr/sr; + c1*=a1; + for(ii1=l1;ii1>=1;ii1--) + { + b1=em1[ii1]; + a1*=c1; + c1*=dr; + dr=(en1[ii1]+a1)/(b1+a1); + a1=c1/b1; + } + a1=1.0/sqrt(c1*c1+1.0); + sr=(sr>=0.0?a1:-a1); + cr=c1*(sr); + } + if(bo1) + { + a1=dr; + dr=cr; + cr=a1; + sr/=d1; + } + } + else + { + cr=1.0/cosh(u1); + dr=cr; + sr=tanh(u1); + } + //////////////////////////////////////////////////////////////// + double si,ci,di; + //Performing Elleptic Function operation for the imaginary values + double a,b,c,d,emc,u; + double em[14],en[14]; + int i,ii,l,bo; + //double s1,c1,d1; + emc=emmc; + u=uui; + if(emc) + { + bo=(emc<0.0); + if(bo) + { + d=1.0-emc; + emc/=-1.0/d; + u*=(d=sqrt(d)); + } + a=1.0; + di=1.0; + for(i=1;i<=13;i++) + { + l=i; + em[i]=a; + en[i]=(emc=sqrt(emc)); + c=0.5*(a+emc); + if(fabs(a-emc)<=CA*a)break; + emc*=a; + a=c; + } + u*=c; + si=sin(u); + ci=cos(u); + if(si) + { + a=ci/si; + c*=a; + for(ii=l;ii>=1;ii--) + { + b=em[ii]; + a*=c; + c*=di; + di=(en[ii]+a)/(b+a); + a=c/b; + } + a=1.0/sqrt(c*c+1.0); + si=(si>=0.0?a:-a); + ci=c*(si); + } + if(bo) + { + a=di; + di=ci; + ci=a; + si/=d; + } + } + else + { + ci=1.0/cosh(u); + di=ci; + si=tanh(u); + } + ///////////////////////////////////////////////////////// + double delta; + delta=ci*ci + emmc*sr*sr*si*si; + double snir,snii; + snir=(sr*di)/delta; + snii=(cr*dr*si*ci)/delta; + ans=DoubleComplex(snir,snii); + return ans; +} diff --git a/src/c/signalProcessing/zpbutt/dzpbutts.c b/src/c/signalProcessing/zpbutt/dzpbutts.c index 33f22af..7b9fe9b 100644 --- a/src/c/signalProcessing/zpbutt/dzpbutts.c +++ b/src/c/signalProcessing/zpbutt/dzpbutts.c @@ -12,6 +12,7 @@ #include<stdio.h> #include<math.h> #include "zpbutt.h" +#include "doubleComplex.h" #define PI 3.14159265 double dzpbutts(double n,double fl,doubleComplex* out) { diff --git a/src/c/string/ascii/gasciia.c b/src/c/string/ascii/gasciia.c index ec11d6e..5fe95e0 100644 --- a/src/c/string/ascii/gasciia.c +++ b/src/c/string/ascii/gasciia.c @@ -14,12 +14,12 @@ into its ascii equivalent. */ #include "ascii.h" -void gasciia(char *str,int size,int* oup) +void gasciia(char *str,int size,uint8* oup) { int i; for(i=0;i<size;i++) { - *(oup+i)=(int)str[i]; + *(oup+i)=str[i]; } } diff --git a/src/c/string/disp/zdispa.c b/src/c/string/disp/zdispa.c index bc71de4..94b24e9 100644 --- a/src/c/string/disp/zdispa.c +++ b/src/c/string/disp/zdispa.c @@ -16,7 +16,7 @@ double zdispa (doubleComplex* in, int rows, int columns){ int i = 0,j = 0; for (i = 0; i < rows; ++i) { - for (j=0;j<columns;j++) printf(" %1.20lf + %1.20lfi " ,zreals(in[i+j*rows]) ,zimags(in[i+j*rows])); + for (j=0;j<columns;j++) printf(" %e + %ei " ,zreals(in[i+j*rows]) ,zimags(in[i+j*rows])); printf("\n"); } return 0; diff --git a/src/c/string/disp/zdisps.c b/src/c/string/disp/zdisps.c index c4ec137..4a040cd 100644 --- a/src/c/string/disp/zdisps.c +++ b/src/c/string/disp/zdisps.c @@ -14,6 +14,6 @@ double zdisps (doubleComplex in) { - printf(" %1.20f + %1.20fi \n" ,zreals(in) ,zimags(in)); + printf(" %e + %ei \n" ,zreals(in) ,zimags(in)); return 0; } diff --git a/src/c/string/includes/ascii.h b/src/c/string/includes/ascii.h index fcf969d..39aeb83 100644 --- a/src/c/string/includes/ascii.h +++ b/src/c/string/includes/ascii.h @@ -17,7 +17,7 @@ extern "C" { #endif -void gasciia(char* str,int size,int* oup); +void gasciia(char* str,int size,uint8* oup); void dasciia(double* inp,int size,char* oup); #ifdef __cplusplus diff --git a/src/c/string/strcspn/gstrcspna.c b/src/c/string/strcspn/gstrcspna.c index 716c202..2c83c72 100644 --- a/src/c/string/strcspn/gstrcspna.c +++ b/src/c/string/strcspn/gstrcspna.c @@ -1,923 +1,32 @@ - - - - - - -<!DOCTYPE html> -<html lang="en"> - <head> - <meta charset="utf-8"> - <link rel="dns-prefetch" href="https://assets-cdn.github.com"> - <link rel="dns-prefetch" href="https://avatars0.githubusercontent.com"> - <link rel="dns-prefetch" href="https://avatars1.githubusercontent.com"> - <link rel="dns-prefetch" href="https://avatars2.githubusercontent.com"> - <link rel="dns-prefetch" href="https://avatars3.githubusercontent.com"> - <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> - <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> - - - - <link crossorigin="anonymous" href="https://assets-cdn.github.com/assets/frameworks-e04a23d39bf81b7db3c635177756ef51bc171feb440be9e174933c6eb56382da.css" integrity="sha256-4Eoj05v4G32zxjUXd1bvUbwXH+tEC+nhdJM8brVjgto=" media="all" rel="stylesheet" /> - <link crossorigin="anonymous" href="https://assets-cdn.github.com/assets/github-caabe7e9677dbaa4c88db92fcc52ed61b0def1a9d2e3d3ab196c0a5c81d20d04.css" integrity="sha256-yqvn6Wd9uqTIjbkvzFLtYbDe8anS49OrGWwKXIHSDQQ=" media="all" rel="stylesheet" /> - - - - - - <meta name="viewport" content="width=device-width"> - - <title>Scilab2C/gstrcspna.c at master · jschandi/Scilab2C</title> - <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> - <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> - <meta property="fb:app_id" content="1401488693436528"> - - - <meta content="https://avatars0.githubusercontent.com/u/25305000?v=3&s=400" property="og:image" /><meta content="GitHub" property="og:site_name" /><meta content="object" property="og:type" /><meta content="jschandi/Scilab2C" property="og:title" /><meta content="https://github.com/jschandi/Scilab2C" property="og:url" /><meta content="Scilab2C - Scilab 2 C" property="og:description" /> - - <link rel="assets" href="https://assets-cdn.github.com/"> - <link rel="web-socket" href="wss://live.github.com/_sockets/VjI6MTg1NjcyMTY2OjZlOTZjOTBhYTE3ZDRjODk2MDQ4MTQzY2ZjNzhiZWFiY2FkYWM1MTUwYTc1OTUyNjE2MzAwYTY1OWFiYWM4YmU=--6540d451c32486652ee55913c85a4d598d27f871"> - <meta name="pjax-timeout" content="1000"> - <link rel="sudo-modal" href="/sessions/sudo_modal"> - <meta name="request-id" content="B479:CDA1:7DBAB7:CED9B2:595F37C9" data-pjax-transient> - - - <meta name="selected-link" value="repo_source" data-pjax-transient> - - <meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU"> -<meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA"> - <meta name="google-analytics" content="UA-3769691-2"> - -<meta content="collector.githubapp.com" name="octolytics-host" /><meta content="github" name="octolytics-app-id" /><meta content="https://collector.githubapp.com/github-external/browser_event" name="octolytics-event-url" /><meta content="B479:CDA1:7DBAB7:CED9B2:595F37C9" name="octolytics-dimension-request_id" /><meta content="iad" name="octolytics-dimension-region_edge" /><meta content="iad" name="octolytics-dimension-region_render" /><meta content="25305000" name="octolytics-actor-id" /><meta content="jschandi" name="octolytics-actor-login" /><meta content="4b5311fbbedd8d9e8a47fa583aa982d1fb7569e076a5988bcab3b646065d6113" name="octolytics-actor-hash" /> -<meta content="/<user-name>/<repo-name>/blob/show" data-pjax-transient="true" name="analytics-location" /> - - - - - <meta class="js-ga-set" name="dimension1" content="Logged In"> - - - - - <meta name="hostname" content="github.com"> - <meta name="user-login" content="jschandi"> - - <meta name="expected-hostname" content="github.com"> - <meta name="js-proxy-site-detection-payload" content="MDY3MTNmY2Y1MTA4NTkzMTA0ODY4Mjc1NGI1ZTQ0YTU3M2JiMGFhYTI1ZGU0YmIzNzkxODA5ZjRhMjJmYzkwOHx7InJlbW90ZV9hZGRyZXNzIjoiMTAzLjIxLjEyNy43OCIsInJlcXVlc3RfaWQiOiJCNDc5OkNEQTE6N0RCQUI3OkNFRDlCMjo1OTVGMzdDOSIsInRpbWVzdGFtcCI6MTQ5OTQxMjQyNywiaG9zdCI6ImdpdGh1Yi5jb20ifQ=="> - - - <meta name="html-safe-nonce" content="2c41b02f77cd774745947a288bea60a19e890cf1"> - - <meta http-equiv="x-pjax-version" content="23271acdcc0eb1a18cb277d502fca502"> - - - <link href="https://github.com/jschandi/Scilab2C/commits/master.atom" rel="alternate" title="Recent Commits to Scilab2C:master" type="application/atom+xml"> - - <meta name="description" content="Scilab2C - Scilab 2 C"> - <meta name="go-import" content="github.com/jschandi/Scilab2C git https://github.com/jschandi/Scilab2C.git"> - - <meta content="25305000" name="octolytics-dimension-user_id" /><meta content="jschandi" name="octolytics-dimension-user_login" /><meta content="96276741" name="octolytics-dimension-repository_id" /><meta content="jschandi/Scilab2C" name="octolytics-dimension-repository_nwo" /><meta content="true" name="octolytics-dimension-repository_public" /><meta content="true" name="octolytics-dimension-repository_is_fork" /><meta content="96111901" name="octolytics-dimension-repository_parent_id" /><meta content="FOSSEE/Scilab2C" name="octolytics-dimension-repository_parent_nwo" /><meta content="96111901" name="octolytics-dimension-repository_network_root_id" /><meta content="FOSSEE/Scilab2C" name="octolytics-dimension-repository_network_root_nwo" /><meta content="true" name="octolytics-dimension-repository_explore_github_marketplace_ci_cta_shown" /> - - - <link rel="canonical" href="https://github.com/jschandi/Scilab2C/blob/master/2.3-1/src/c/string/strcspn/gstrcspna.c" data-pjax-transient> - - - <meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats"> - - <meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors"> - - <link rel="mask-icon" href="https://assets-cdn.github.com/pinned-octocat.svg" color="#000000"> - <link rel="icon" type="image/x-icon" href="https://assets-cdn.github.com/favicon.ico"> - -<meta name="theme-color" content="#1e2327"> - - - <meta name="u2f-support" content="true"> - - </head> - - <body class="logged-in env-production page-blob"> - - - - - <div class="position-relative js-header-wrapper "> - <a href="#start-of-content" tabindex="1" class="bg-black text-white p-3 show-on-focus js-skip-to-content">Skip to content</a> - <div id="js-pjax-loader-bar" class="pjax-loader-bar"><div class="progress"></div></div> - - - - - - - - -<div class="header" role="banner"> - <div class="container clearfix"> - <a class="header-logo-invertocat" href="https://github.com/" data-hotkey="g d" aria-label="Homepage" data-ga-click="Header, go to dashboard, icon:logo"> - <svg aria-hidden="true" class="octicon octicon-mark-github" height="32" version="1.1" viewBox="0 0 16 16" width="32"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"/></svg> -</a> - - - <div class="header-search scoped-search site-scoped-search js-site-search" role="search"> - <!-- '"` --><!-- </textarea></xmp> --></option></form><form accept-charset="UTF-8" action="/jschandi/Scilab2C/search" class="js-site-search-form" data-scoped-search-url="/jschandi/Scilab2C/search" data-unscoped-search-url="/search" method="get"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /></div> - <label class="form-control header-search-wrapper js-chromeless-input-container"> - <a href="/jschandi/Scilab2C/blob/master/2.3-1/src/c/string/strcspn/gstrcspna.c" class="header-search-scope no-underline">This repository</a> - <input type="text" - class="form-control header-search-input js-site-search-focus js-site-search-field is-clearable" - data-hotkey="s" - name="q" - value="" - placeholder="Search" - aria-label="Search this repository" - data-unscoped-placeholder="Search GitHub" - data-scoped-placeholder="Search" - autocapitalize="off"> - <input type="hidden" class="js-site-search-type-field" name="type" > - </label> -</form></div> - - - <ul class="header-nav float-left" role="navigation"> - <li class="header-nav-item"> - <a href="/pulls" aria-label="Pull requests you created" class="js-selected-navigation-item header-nav-link" data-ga-click="Header, click, Nav menu - item:pulls context:user" data-hotkey="g p" data-selected-links="/pulls /pulls/assigned /pulls/mentioned /pulls"> - Pull requests -</a> </li> - <li class="header-nav-item"> - <a href="/issues" aria-label="Issues you created" class="js-selected-navigation-item header-nav-link" data-ga-click="Header, click, Nav menu - item:issues context:user" data-hotkey="g i" data-selected-links="/issues /issues/assigned /issues/mentioned /issues"> - Issues -</a> </li> - <li class="header-nav-item"> - <a href="/marketplace" class="js-selected-navigation-item header-nav-link" data-ga-click="Header, click, Nav menu - item:marketplace context:user" data-selected-links=" /marketplace"> - Marketplace -</a> </li> - <li class="header-nav-item"> - <a class="header-nav-link" href="https://gist.github.com/" data-ga-click="Header, go to gist, text:gist">Gist</a> - </li> - </ul> - - -<ul class="header-nav user-nav float-right" id="user-links"> - <li class="header-nav-item"> - - - </li> - - <li class="header-nav-item dropdown js-menu-container"> - <a class="header-nav-link tooltipped tooltipped-s js-menu-target" href="/new" - aria-label="Create new…" - aria-expanded="false" - aria-haspopup="true" - data-ga-click="Header, create new, icon:add"> - <svg aria-hidden="true" class="octicon octicon-plus float-left" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M12 9H7v5H5V9H0V7h5V2h2v5h5z"/></svg> - <span class="dropdown-caret"></span> - </a> - - <div class="dropdown-menu-content js-menu-content"> - <ul class="dropdown-menu dropdown-menu-sw"> - -<a class="dropdown-item" href="/new" data-ga-click="Header, create new repository"> - New repository -</a> - - <a class="dropdown-item" href="/new/import" data-ga-click="Header, import a repository"> - Import repository - </a> - -<a class="dropdown-item" href="https://gist.github.com/" data-ga-click="Header, create new gist"> - New gist -</a> - - <a class="dropdown-item" href="/organizations/new" data-ga-click="Header, create new organization"> - New organization - </a> - - - - - </ul> - </div> - </li> - - <li class="header-nav-item dropdown js-menu-container"> - <a class="header-nav-link name tooltipped tooltipped-sw js-menu-target" href="/jschandi" - aria-label="View profile and more" - aria-expanded="false" - aria-haspopup="true" - data-ga-click="Header, show menu, icon:avatar"> - <img alt="@jschandi" class="avatar" src="https://avatars1.githubusercontent.com/u/25305000?v=3&s=40" height="20" width="20"> - <span class="dropdown-caret"></span> - </a> - - <div class="dropdown-menu-content js-menu-content"> - <div class="dropdown-menu dropdown-menu-sw"> - <div class="dropdown-header header-nav-current-user css-truncate"> - Signed in as <strong class="css-truncate-target">jschandi</strong> - </div> - - <div class="dropdown-divider"></div> - - <a class="dropdown-item" href="/jschandi" data-ga-click="Header, go to profile, text:your profile"> - Your profile - </a> - <a class="dropdown-item" href="/jschandi?tab=stars" data-ga-click="Header, go to starred repos, text:your stars"> - Your stars - </a> - <a class="dropdown-item" href="/explore" data-ga-click="Header, go to explore, text:explore"> - Explore - </a> - <a class="dropdown-item" href="https://help.github.com" data-ga-click="Header, go to help, text:help"> - Help - </a> - - <div class="dropdown-divider"></div> - - <a class="dropdown-item" href="/settings/profile" data-ga-click="Header, go to settings, icon:settings"> - Settings - </a> - - <!-- '"` --><!-- </textarea></xmp> --></option></form><form accept-charset="UTF-8" action="/logout" class="logout-form" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /><input name="authenticity_token" type="hidden" value="7VbPY1D62cDEKhPnweI4QJ7die2oAbRgwMMrmVItZFMWq1WEhop3SqolRzkYuX4/9NhAWk6jMQZiMAXHGU/1iA==" /></div> - <button type="submit" class="dropdown-item dropdown-signout" data-ga-click="Header, sign out, icon:logout"> - Sign out - </button> -</form> </div> - </div> - </li> -</ul> - - - <!-- '"` --><!-- </textarea></xmp> --></option></form><form accept-charset="UTF-8" action="/logout" class="sr-only right-0" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /><input name="authenticity_token" type="hidden" value="c+2R7PWEx7ZNgGgmIS9tkLNiC9IohIqEmjBeFh5r+22IEAsLI/RpPCOPPPj4dCvv2WfCZc4mD+I4w3BIVQlqtg==" /></div> - <button type="submit" class="dropdown-item dropdown-signout" data-ga-click="Header, sign out, icon:logout"> - Sign out - </button> -</form> </div> -</div> - - - - - </div> - - <div id="start-of-content" class="show-on-focus"></div> - - <div id="js-flash-container"> -</div> - - - - <div role="main"> - <div itemscope itemtype="http://schema.org/SoftwareSourceCode"> - <div id="js-repo-pjax-container" data-pjax-container> - - - - - - <div class="pagehead repohead instapaper_ignore readability-menu experiment-repo-nav"> - <div class="container repohead-details-container"> - - <ul class="pagehead-actions"> - <li> - <!-- '"` --><!-- </textarea></xmp> --></option></form><form accept-charset="UTF-8" action="/notifications/subscribe" class="js-social-container" data-autosubmit="true" data-remote="true" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /><input name="authenticity_token" type="hidden" value="IHbNt80Qu3azd7Q5pq6wSl70GGOMhWclKAih+Uk3S1wX4AmhtHglQ8/009AV6xWc+jYZzR9BlMZkA4LUolhKvw==" /></div> <input class="form-control" id="repository_id" name="repository_id" type="hidden" value="96276741" /> - - <div class="select-menu js-menu-container js-select-menu"> - <a href="/jschandi/Scilab2C/subscription" - class="btn btn-sm btn-with-count select-menu-button js-menu-target" - role="button" - aria-haspopup="true" - aria-expanded="false" - aria-label="Toggle repository notifications menu" - data-ga-click="Repository, click Watch settings, action:blob#show"> - <span class="js-select-button"> - <svg aria-hidden="true" class="octicon octicon-eye" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M8.06 2C3 2 0 8 0 8s3 6 8.06 6C13 14 16 8 16 8s-3-6-7.94-6zM8 12c-2.2 0-4-1.78-4-4 0-2.2 1.8-4 4-4 2.22 0 4 1.8 4 4 0 2.22-1.78 4-4 4zm2-4c0 1.11-.89 2-2 2-1.11 0-2-.89-2-2 0-1.11.89-2 2-2 1.11 0 2 .89 2 2z"/></svg> - Watch - </span> - </a> - <a class="social-count js-social-count" - href="/jschandi/Scilab2C/watchers" - aria-label="0 users are watching this repository"> - 0 - </a> - - <div class="select-menu-modal-holder"> - <div class="select-menu-modal subscription-menu-modal js-menu-content"> - <div class="select-menu-header js-navigation-enable" tabindex="-1"> - <svg aria-label="Close" class="octicon octicon-x js-menu-close" height="16" role="img" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"/></svg> - <span class="select-menu-title">Notifications</span> - </div> - - <div class="select-menu-list js-navigation-container" role="menu"> - - <div class="select-menu-item js-navigation-item selected" role="menuitem" tabindex="0"> - <svg aria-hidden="true" class="octicon octicon-check select-menu-item-icon" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> - <div class="select-menu-item-text"> - <input checked="checked" id="do_included" name="do" type="radio" value="included" /> - <span class="select-menu-item-heading">Not watching</span> - <span class="description">Be notified when participating or @mentioned.</span> - <span class="js-select-button-text hidden-select-button-text"> - <svg aria-hidden="true" class="octicon octicon-eye" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M8.06 2C3 2 0 8 0 8s3 6 8.06 6C13 14 16 8 16 8s-3-6-7.94-6zM8 12c-2.2 0-4-1.78-4-4 0-2.2 1.8-4 4-4 2.22 0 4 1.8 4 4 0 2.22-1.78 4-4 4zm2-4c0 1.11-.89 2-2 2-1.11 0-2-.89-2-2 0-1.11.89-2 2-2 1.11 0 2 .89 2 2z"/></svg> - Watch - </span> - </div> - </div> - - <div class="select-menu-item js-navigation-item " role="menuitem" tabindex="0"> - <svg aria-hidden="true" class="octicon octicon-check select-menu-item-icon" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> - <div class="select-menu-item-text"> - <input id="do_subscribed" name="do" type="radio" value="subscribed" /> - <span class="select-menu-item-heading">Watching</span> - <span class="description">Be notified of all conversations.</span> - <span class="js-select-button-text hidden-select-button-text"> - <svg aria-hidden="true" class="octicon octicon-eye" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M8.06 2C3 2 0 8 0 8s3 6 8.06 6C13 14 16 8 16 8s-3-6-7.94-6zM8 12c-2.2 0-4-1.78-4-4 0-2.2 1.8-4 4-4 2.22 0 4 1.8 4 4 0 2.22-1.78 4-4 4zm2-4c0 1.11-.89 2-2 2-1.11 0-2-.89-2-2 0-1.11.89-2 2-2 1.11 0 2 .89 2 2z"/></svg> - Unwatch - </span> - </div> - </div> - - <div class="select-menu-item js-navigation-item " role="menuitem" tabindex="0"> - <svg aria-hidden="true" class="octicon octicon-check select-menu-item-icon" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> - <div class="select-menu-item-text"> - <input id="do_ignore" name="do" type="radio" value="ignore" /> - <span class="select-menu-item-heading">Ignoring</span> - <span class="description">Never be notified.</span> - <span class="js-select-button-text hidden-select-button-text"> - <svg aria-hidden="true" class="octicon octicon-mute" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M8 2.81v10.38c0 .67-.81 1-1.28.53L3 10H1c-.55 0-1-.45-1-1V7c0-.55.45-1 1-1h2l3.72-3.72C7.19 1.81 8 2.14 8 2.81zm7.53 3.22l-1.06-1.06-1.97 1.97-1.97-1.97-1.06 1.06L11.44 8 9.47 9.97l1.06 1.06 1.97-1.97 1.97 1.97 1.06-1.06L13.56 8l1.97-1.97z"/></svg> - Stop ignoring - </span> - </div> - </div> - - </div> - - </div> - </div> - </div> -</form> - </li> - - <li> - - <div class="js-toggler-container js-social-container starring-container "> - <!-- '"` --><!-- </textarea></xmp> --></option></form><form accept-charset="UTF-8" action="/jschandi/Scilab2C/unstar" class="starred" data-remote="true" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /><input name="authenticity_token" type="hidden" value="ooGpHg6UEr/pVV0JQFDuz/FGpv2rW6jVADlkPb9bSitMOR3N3Pzulc2BiMDoJL/VSxgiIUPF9THoWpg0/eTIYw==" /></div> - <button - type="submit" - class="btn btn-sm btn-with-count js-toggler-target" - aria-label="Unstar this repository" title="Unstar jschandi/Scilab2C" - data-ga-click="Repository, click unstar button, action:blob#show; text:Unstar"> - <svg aria-hidden="true" class="octicon octicon-star" height="16" version="1.1" viewBox="0 0 14 16" width="14"><path fill-rule="evenodd" d="M14 6l-4.9-.64L7 1 4.9 5.36 0 6l3.6 3.26L2.67 14 7 11.67 11.33 14l-.93-4.74z"/></svg> - Unstar - </button> - <a class="social-count js-social-count" href="/jschandi/Scilab2C/stargazers" - aria-label="0 users starred this repository"> - 0 - </a> -</form> - <!-- '"` --><!-- </textarea></xmp> --></option></form><form accept-charset="UTF-8" action="/jschandi/Scilab2C/star" class="unstarred" data-remote="true" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /><input name="authenticity_token" type="hidden" value="4VvrGJSH7dlpD+w6wB3P8CEjQXkawMqWZwdFRbLk2BLjHDH9jeUhD+7rKV1zixOpmcD8FGPDpztAWppNQgRaXQ==" /></div> - <button - type="submit" - class="btn btn-sm btn-with-count js-toggler-target" - aria-label="Star this repository" title="Star jschandi/Scilab2C" - data-ga-click="Repository, click star button, action:blob#show; text:Star"> - <svg aria-hidden="true" class="octicon octicon-star" height="16" version="1.1" viewBox="0 0 14 16" width="14"><path fill-rule="evenodd" d="M14 6l-4.9-.64L7 1 4.9 5.36 0 6l3.6 3.26L2.67 14 7 11.67 11.33 14l-.93-4.74z"/></svg> - Star - </button> - <a class="social-count js-social-count" href="/jschandi/Scilab2C/stargazers" - aria-label="0 users starred this repository"> - 0 - </a> -</form> </div> - - </li> - - <li> - <a href="#fork-destination-box" class="btn btn-sm btn-with-count" - title="Fork your own copy of jschandi/Scilab2C to your account" - aria-label="Fork your own copy of jschandi/Scilab2C to your account" - rel="facebox" - data-ga-click="Repository, show fork modal, action:blob#show; text:Fork"> - <svg aria-hidden="true" class="octicon octicon-repo-forked" height="16" version="1.1" viewBox="0 0 10 16" width="10"><path fill-rule="evenodd" d="M8 1a1.993 1.993 0 0 0-1 3.72V6L5 8 3 6V4.72A1.993 1.993 0 0 0 2 1a1.993 1.993 0 0 0-1 3.72V6.5l3 3v1.78A1.993 1.993 0 0 0 5 15a1.993 1.993 0 0 0 1-3.72V9.5l3-3V4.72A1.993 1.993 0 0 0 8 1zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3 10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3-10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"/></svg> - Fork - </a> - - <div id="fork-destination-box" style="display: none;"> - <h2 class="facebox-header" data-facebox-id="facebox-header">Where should we fork this repository?</h2> - <include-fragment src="" - class="js-fork-select-fragment fork-select-fragment" - data-url="/jschandi/Scilab2C/fork?fragment=1"> - <img alt="Loading" height="64" src="https://assets-cdn.github.com/images/spinners/octocat-spinner-128.gif" width="64" /> - </include-fragment> - </div> - - <a href="/jschandi/Scilab2C/network" class="social-count" - aria-label="6 users forked this repository"> - 6 - </a> - </li> -</ul> - - <h1 class="public "> - <svg aria-hidden="true" class="octicon octicon-repo-forked" height="16" version="1.1" viewBox="0 0 10 16" width="10"><path fill-rule="evenodd" d="M8 1a1.993 1.993 0 0 0-1 3.72V6L5 8 3 6V4.72A1.993 1.993 0 0 0 2 1a1.993 1.993 0 0 0-1 3.72V6.5l3 3v1.78A1.993 1.993 0 0 0 5 15a1.993 1.993 0 0 0 1-3.72V9.5l3-3V4.72A1.993 1.993 0 0 0 8 1zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3 10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3-10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"/></svg> - <span class="author" itemprop="author"><a href="/jschandi" class="url fn" rel="author">jschandi</a></span><!-- ---><span class="path-divider">/</span><!-- ---><strong itemprop="name"><a href="/jschandi/Scilab2C" data-pjax="#js-repo-pjax-container">Scilab2C</a></strong> - - <span class="fork-flag"> - <span class="text">forked from <a href="/FOSSEE/Scilab2C">FOSSEE/Scilab2C</a></span> - </span> -</h1> - - </div> - <div class="container"> - -<nav class="reponav js-repo-nav js-sidenav-container-pjax" - itemscope - itemtype="http://schema.org/BreadcrumbList" - role="navigation" - data-pjax="#js-repo-pjax-container"> - - <span itemscope itemtype="http://schema.org/ListItem" itemprop="itemListElement"> - <a href="/jschandi/Scilab2C" class="js-selected-navigation-item selected reponav-item" data-hotkey="g c" data-selected-links="repo_source repo_downloads repo_commits repo_releases repo_tags repo_branches /jschandi/Scilab2C" itemprop="url"> - <svg aria-hidden="true" class="octicon octicon-code" height="16" version="1.1" viewBox="0 0 14 16" width="14"><path fill-rule="evenodd" d="M9.5 3L8 4.5 11.5 8 8 11.5 9.5 13 14 8 9.5 3zm-5 0L0 8l4.5 5L6 11.5 2.5 8 6 4.5 4.5 3z"/></svg> - <span itemprop="name">Code</span> - <meta itemprop="position" content="1"> -</a> </span> - - - <span itemscope itemtype="http://schema.org/ListItem" itemprop="itemListElement"> - <a href="/jschandi/Scilab2C/pulls" class="js-selected-navigation-item reponav-item" data-hotkey="g p" data-selected-links="repo_pulls /jschandi/Scilab2C/pulls" itemprop="url"> - <svg aria-hidden="true" class="octicon octicon-git-pull-request" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M11 11.28V5c-.03-.78-.34-1.47-.94-2.06C9.46 2.35 8.78 2.03 8 2H7V0L4 3l3 3V4h1c.27.02.48.11.69.31.21.2.3.42.31.69v6.28A1.993 1.993 0 0 0 10 15a1.993 1.993 0 0 0 1-3.72zm-1 2.92c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zM4 3c0-1.11-.89-2-2-2a1.993 1.993 0 0 0-1 3.72v6.56A1.993 1.993 0 0 0 2 15a1.993 1.993 0 0 0 1-3.72V4.72c.59-.34 1-.98 1-1.72zm-.8 10c0 .66-.55 1.2-1.2 1.2-.65 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"/></svg> - <span itemprop="name">Pull requests</span> - <span class="Counter">0</span> - <meta itemprop="position" content="3"> -</a> </span> - - <a href="/jschandi/Scilab2C/projects" class="js-selected-navigation-item reponav-item" data-selected-links="repo_projects new_repo_project repo_project /jschandi/Scilab2C/projects"> - <svg aria-hidden="true" class="octicon octicon-project" height="16" version="1.1" viewBox="0 0 15 16" width="15"><path fill-rule="evenodd" d="M10 12h3V2h-3v10zm-4-2h3V2H6v8zm-4 4h3V2H2v12zm-1 1h13V1H1v14zM14 0H1a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h13a1 1 0 0 0 1-1V1a1 1 0 0 0-1-1z"/></svg> - Projects - <span class="Counter" >0</span> -</a> - <a href="/jschandi/Scilab2C/wiki" class="js-selected-navigation-item reponav-item" data-hotkey="g w" data-selected-links="repo_wiki /jschandi/Scilab2C/wiki"> - <svg aria-hidden="true" class="octicon octicon-book" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M3 5h4v1H3V5zm0 3h4V7H3v1zm0 2h4V9H3v1zm11-5h-4v1h4V5zm0 2h-4v1h4V7zm0 2h-4v1h4V9zm2-6v9c0 .55-.45 1-1 1H9.5l-1 1-1-1H2c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h5.5l1 1 1-1H15c.55 0 1 .45 1 1zm-8 .5L7.5 3H2v9h6V3.5zm7-.5H9.5l-.5.5V12h6V3z"/></svg> - Wiki -</a> - <a href="/jschandi/Scilab2C/settings" class="js-selected-navigation-item reponav-item" data-selected-links="repo_settings repo_branch_settings hooks integration_installations /jschandi/Scilab2C/settings"> - <svg aria-hidden="true" class="octicon octicon-gear" height="16" version="1.1" viewBox="0 0 14 16" width="14"><path fill-rule="evenodd" d="M14 8.77v-1.6l-1.94-.64-.45-1.09.88-1.84-1.13-1.13-1.81.91-1.09-.45-.69-1.92h-1.6l-.63 1.94-1.11.45-1.84-.88-1.13 1.13.91 1.81-.45 1.09L0 7.23v1.59l1.94.64.45 1.09-.88 1.84 1.13 1.13 1.81-.91 1.09.45.69 1.92h1.59l.63-1.94 1.11-.45 1.84.88 1.13-1.13-.92-1.81.47-1.09L14 8.75v.02zM7 11c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3z"/></svg> - Settings -</a> - <div class="reponav-dropdown js-menu-container"> - <button type="button" class="btn-link reponav-item reponav-dropdown js-menu-target " data-no-toggle aria-expanded="false" aria-haspopup="true"> - Insights - <svg aria-hidden="true" class="octicon octicon-triangle-down v-align-middle text-gray" height="11" version="1.1" viewBox="0 0 12 16" width="8"><path fill-rule="evenodd" d="M0 5l6 6 6-6z"/></svg> - </button> - <div class="dropdown-menu-content js-menu-content"> - <div class="dropdown-menu dropdown-menu-sw"> - <a class="dropdown-item" href="/jschandi/Scilab2C/pulse" data-skip-pjax> - <svg aria-hidden="true" class="octicon octicon-pulse" height="16" version="1.1" viewBox="0 0 14 16" width="14"><path fill-rule="evenodd" d="M11.5 8L8.8 5.4 6.6 8.5 5.5 1.6 2.38 8H0v2h3.6l.9-1.8.9 5.4L9 8.5l1.6 1.5H14V8z"/></svg> - Pulse - </a> - <a class="dropdown-item" href="/jschandi/Scilab2C/graphs" data-skip-pjax> - <svg aria-hidden="true" class="octicon octicon-graph" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M16 14v1H0V0h1v14h15zM5 13H3V8h2v5zm4 0H7V3h2v10zm4 0h-2V6h2v7z"/></svg> - Graphs - </a> - </div> - </div> - </div> -</nav> - - </div> - </div> - -<div class="container new-discussion-timeline experiment-repo-nav"> - <div class="repository-content"> - - - <a href="/jschandi/Scilab2C/blob/e9de337a34e123749927039f7011fb30fc96f7c9/2.3-1/src/c/string/strcspn/gstrcspna.c" class="d-none js-permalink-shortcut" data-hotkey="y">Permalink</a> - - <!-- blob contrib key: blob_contributors:v21:948cbed128d2695c0ba2317ea0aecbf7 --> - - <div class="file-navigation js-zeroclipboard-container"> - -<div class="select-menu branch-select-menu js-menu-container js-select-menu float-left"> - <button class=" btn btn-sm select-menu-button js-menu-target css-truncate" data-hotkey="w" - - type="button" aria-label="Switch branches or tags" aria-expanded="false" aria-haspopup="true"> - <i>Branch:</i> - <span class="js-select-button css-truncate-target">master</span> - </button> - - <div class="select-menu-modal-holder js-menu-content js-navigation-container" data-pjax> - - <div class="select-menu-modal"> - <div class="select-menu-header"> - <svg aria-label="Close" class="octicon octicon-x js-menu-close" height="16" role="img" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"/></svg> - <span class="select-menu-title">Switch branches/tags</span> - </div> - - <div class="select-menu-filters"> - <div class="select-menu-text-filter"> - <input type="text" aria-label="Find or create a branch…" id="context-commitish-filter-field" class="form-control js-filterable-field js-navigation-enable" placeholder="Find or create a branch…"> - </div> - <div class="select-menu-tabs"> - <ul> - <li class="select-menu-tab"> - <a href="#" data-tab-filter="branches" data-filter-placeholder="Find or create a branch…" class="js-select-menu-tab" role="tab">Branches</a> - </li> - <li class="select-menu-tab"> - <a href="#" data-tab-filter="tags" data-filter-placeholder="Find a tag…" class="js-select-menu-tab" role="tab">Tags</a> - </li> - </ul> - </div> - </div> - - <div class="select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket" data-tab-filter="branches" role="menu"> - - <div data-filterable-for="context-commitish-filter-field" data-filterable-type="substring"> - - - <a class="select-menu-item js-navigation-item js-navigation-open selected" - href="/jschandi/Scilab2C/blob/master/2.3-1/src/c/string/strcspn/gstrcspna.c" - data-name="master" - data-skip-pjax="true" - rel="nofollow"> - <svg aria-hidden="true" class="octicon octicon-check select-menu-item-icon" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg> - <span class="select-menu-item-text css-truncate-target js-select-menu-filter-text"> - master - </span> - </a> - </div> - - <!-- '"` --><!-- </textarea></xmp> --></option></form><form accept-charset="UTF-8" action="/jschandi/Scilab2C/branches" class="js-create-branch select-menu-item select-menu-new-item-form js-navigation-item js-new-item-form" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /><input name="authenticity_token" type="hidden" value="dOmnQ7DAYGbRjvSAPsTnLQ16ZM8q/XY5sMrnsMbo/2LxcQJHdwnOXc1+ce5JEjzaNGi+8JrD2pBcyLDpGKiQdQ==" /></div> - <svg aria-hidden="true" class="octicon octicon-git-branch select-menu-item-icon" height="16" version="1.1" viewBox="0 0 10 16" width="10"><path fill-rule="evenodd" d="M10 5c0-1.11-.89-2-2-2a1.993 1.993 0 0 0-1 3.72v.3c-.02.52-.23.98-.63 1.38-.4.4-.86.61-1.38.63-.83.02-1.48.16-2 .45V4.72a1.993 1.993 0 0 0-1-3.72C.88 1 0 1.89 0 3a2 2 0 0 0 1 1.72v6.56c-.59.35-1 .99-1 1.72 0 1.11.89 2 2 2 1.11 0 2-.89 2-2 0-.53-.2-1-.53-1.36.09-.06.48-.41.59-.47.25-.11.56-.17.94-.17 1.05-.05 1.95-.45 2.75-1.25S8.95 7.77 9 6.73h-.02C9.59 6.37 10 5.73 10 5zM2 1.8c.66 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2C1.35 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2zm0 12.41c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm6-8c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"/></svg> - <div class="select-menu-item-text"> - <span class="select-menu-item-heading">Create branch: <span class="js-new-item-name"></span></span> - <span class="description">from ‘master’</span> - </div> - <input type="hidden" name="name" id="name" class="js-new-item-value"> - <input type="hidden" name="branch" id="branch" value="master"> - <input type="hidden" name="path" id="path" value="2.3-1/src/c/string/strcspn/gstrcspna.c"> -</form> - </div> - - <div class="select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket" data-tab-filter="tags"> - <div data-filterable-for="context-commitish-filter-field" data-filterable-type="substring"> - - - </div> - - <div class="select-menu-no-results">Nothing to show</div> - </div> - - </div> - </div> -</div> - - <div class="BtnGroup float-right"> - <a href="/jschandi/Scilab2C/find/master" - class="js-pjax-capture-input btn btn-sm BtnGroup-item" - data-pjax - data-hotkey="t"> - Find file - </a> - <button aria-label="Copy file path to clipboard" class="js-zeroclipboard btn btn-sm BtnGroup-item tooltipped tooltipped-s" data-copied-hint="Copied!" type="button">Copy path</button> - </div> - <div class="breadcrumb js-zeroclipboard-target"> - <span class="repo-root js-repo-root"><span class="js-path-segment"><a href="/jschandi/Scilab2C"><span>Scilab2C</span></a></span></span><span class="separator">/</span><span class="js-path-segment"><a href="/jschandi/Scilab2C/tree/master/2.3-1"><span>2.3-1</span></a></span><span class="separator">/</span><span class="js-path-segment"><a href="/jschandi/Scilab2C/tree/master/2.3-1/src"><span>src</span></a></span><span class="separator">/</span><span class="js-path-segment"><a href="/jschandi/Scilab2C/tree/master/2.3-1/src/c"><span>c</span></a></span><span class="separator">/</span><span class="js-path-segment"><a href="/jschandi/Scilab2C/tree/master/2.3-1/src/c/string"><span>string</span></a></span><span class="separator">/</span><span class="js-path-segment"><a href="/jschandi/Scilab2C/tree/master/2.3-1/src/c/string/strcspn"><span>strcspn</span></a></span><span class="separator">/</span><strong class="final-path">gstrcspna.c</strong> - </div> - </div> - - - <include-fragment class="commit-tease" src="/jschandi/Scilab2C/contributors/master/2.3-1/src/c/string/strcspn/gstrcspna.c"> - <div> - Fetching contributors… - </div> - - <div class="commit-tease-contributors"> - <img alt="" class="loader-loading float-left" height="16" src="https://assets-cdn.github.com/images/spinners/octocat-spinner-32-EAF2F5.gif" width="16" /> - <span class="loader-error">Cannot retrieve contributors at this time</span> - </div> -</include-fragment> - <div class="file"> - <div class="file-header"> - <div class="file-actions"> - - <div class="BtnGroup"> - <a href="/jschandi/Scilab2C/raw/master/2.3-1/src/c/string/strcspn/gstrcspna.c" class="btn btn-sm BtnGroup-item" id="raw-url">Raw</a> - <a href="/jschandi/Scilab2C/blame/master/2.3-1/src/c/string/strcspn/gstrcspna.c" class="btn btn-sm js-update-url-with-hash BtnGroup-item" data-hotkey="b">Blame</a> - <a href="/jschandi/Scilab2C/commits/master/2.3-1/src/c/string/strcspn/gstrcspna.c" class="btn btn-sm BtnGroup-item" rel="nofollow">History</a> - </div> - - - <!-- '"` --><!-- </textarea></xmp> --></option></form><form accept-charset="UTF-8" action="/jschandi/Scilab2C/edit/master/2.3-1/src/c/string/strcspn/gstrcspna.c" class="inline-form js-update-url-with-hash" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /><input name="authenticity_token" type="hidden" value="ORMlOtppZzCuNTdR1JS+mUdSwVt0271hbTk1joEg8ckRBPaHAaMGE5945I+mF/ng0HJVfFrTjfcWDQwdSrsD2g==" /></div> - <button class="btn-octicon tooltipped tooltipped-nw" type="submit" - aria-label="Edit this file" data-hotkey="e" data-disable-with> - <svg aria-hidden="true" class="octicon octicon-pencil" height="16" version="1.1" viewBox="0 0 14 16" width="14"><path fill-rule="evenodd" d="M0 12v3h3l8-8-3-3-8 8zm3 2H1v-2h1v1h1v1zm10.3-9.3L12 6 9 3l1.3-1.3a.996.996 0 0 1 1.41 0l1.59 1.59c.39.39.39 1.02 0 1.41z"/></svg> - </button> -</form> <!-- '"` --><!-- </textarea></xmp> --></option></form><form accept-charset="UTF-8" action="/jschandi/Scilab2C/delete/master/2.3-1/src/c/string/strcspn/gstrcspna.c" class="inline-form" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /><input name="authenticity_token" type="hidden" value="UrPLEaKSyQwtGIhuKYMYtPrt9QX4UTjM58TaveU04NVe7g91LPjwke1ux739oYINIxc6ZF7foJnsar2+0CYQ5w==" /></div> - <button class="btn-octicon btn-octicon-danger tooltipped tooltipped-nw" type="submit" - aria-label="Delete this file" data-disable-with> - <svg aria-hidden="true" class="octicon octicon-trashcan" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M11 2H9c0-.55-.45-1-1-1H5c-.55 0-1 .45-1 1H2c-.55 0-1 .45-1 1v1c0 .55.45 1 1 1v9c0 .55.45 1 1 1h7c.55 0 1-.45 1-1V5c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm-1 12H3V5h1v8h1V5h1v8h1V5h1v8h1V5h1v9zm1-10H2V3h9v1z"/></svg> - </button> -</form> </div> - - <div class="file-info"> - 52 lines (50 sloc) - <span class="file-info-divider"></span> - 1.13 KB - </div> -</div> - - - - <div itemprop="text" class="blob-wrapper data type-c"> - <table class="highlight tab-size js-file-line-container" data-tab-size="8"> - <tr> - <td id="L1" class="blob-num js-line-number" data-line-number="1"></td> - <td id="LC1" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span> Copyright (C) 2017 - IIT Bombay - FOSSEE</span></td> - </tr> - <tr> - <td id="L2" class="blob-num js-line-number" data-line-number="2"></td> - <td id="LC2" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td> - </tr> - <tr> - <td id="L3" class="blob-num js-line-number" data-line-number="3"></td> - <td id="LC3" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> This file must be used under the terms of the CeCILL.</span></td> - </tr> - <tr> - <td id="L4" class="blob-num js-line-number" data-line-number="4"></td> - <td id="LC4" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> This source file is licensed as described in the file COPYING, which</span></td> - </tr> - <tr> - <td id="L5" class="blob-num js-line-number" data-line-number="5"></td> - <td id="LC5" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> you should have received as part of this distribution. The terms</span></td> - </tr> - <tr> - <td id="L6" class="blob-num js-line-number" data-line-number="6"></td> - <td id="LC6" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> are also available at</span></td> - </tr> - <tr> - <td id="L7" class="blob-num js-line-number" data-line-number="7"></td> - <td id="LC7" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt</span></td> - </tr> - <tr> - <td id="L8" class="blob-num js-line-number" data-line-number="8"></td> - <td id="LC8" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> Organization: FOSSEE, IIT Bombay</span></td> - </tr> - <tr> - <td id="L9" class="blob-num js-line-number" data-line-number="9"></td> - <td id="LC9" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> Author: Ankit Raj</span></td> - </tr> - <tr> - <td id="L10" class="blob-num js-line-number" data-line-number="10"></td> - <td id="LC10" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> Email: toolbox@scilab.in</span></td> - </tr> - <tr> - <td id="L11" class="blob-num js-line-number" data-line-number="11"></td> - <td id="LC11" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">*/</span></span></td> - </tr> - <tr> - <td id="L12" class="blob-num js-line-number" data-line-number="12"></td> - <td id="LC12" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span><span class="pl-s"><span class="pl-pds"><</span>stdio.h<span class="pl-pds">></span></span></td> - </tr> - <tr> - <td id="L13" class="blob-num js-line-number" data-line-number="13"></td> - <td id="LC13" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span><span class="pl-s"><span class="pl-pds"><</span>string.h<span class="pl-pds">></span></span></td> - </tr> - <tr> - <td id="L14" class="blob-num js-line-number" data-line-number="14"></td> - <td id="LC14" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">"</span>strcspn.h<span class="pl-pds">"</span></span></td> - </tr> - <tr> - <td id="L15" class="blob-num js-line-number" data-line-number="15"></td> - <td id="LC15" class="blob-code blob-code-inner js-file-line">uint8 <span class="pl-en">gstrcspna</span>(<span class="pl-k">char</span> *str1,<span class="pl-k">int</span> size1,<span class="pl-k">char</span> *str2,<span class="pl-k">int</span> size2)</td> - </tr> - <tr> - <td id="L16" class="blob-num js-line-number" data-line-number="16"></td> - <td id="LC16" class="blob-code blob-code-inner js-file-line">{</td> - </tr> - <tr> - <td id="L17" class="blob-num js-line-number" data-line-number="17"></td> - <td id="LC17" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> ind,i,j;;</td> - </tr> - <tr> - <td id="L18" class="blob-num js-line-number" data-line-number="18"></td> - <td id="LC18" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">for</span>(i=<span class="pl-c1">0</span>;i<=size1;i++)</td> - </tr> - <tr> - <td id="L19" class="blob-num js-line-number" data-line-number="19"></td> - <td id="LC19" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> j;</td> - </tr> - <tr> - <td id="L20" class="blob-num js-line-number" data-line-number="20"></td> - <td id="LC20" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">for</span>(i=<span class="pl-c1">0</span>;i<=size1;i++)</td> - </tr> - <tr> - <td id="L21" class="blob-num js-line-number" data-line-number="21"></td> - <td id="LC21" class="blob-code blob-code-inner js-file-line"> {</td> - </tr> - <tr> - <td id="L22" class="blob-num js-line-number" data-line-number="22"></td> - <td id="LC22" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">for</span>(j=<span class="pl-c1">0</span>;j<=size2;j++)</td> - </tr> - <tr> - <td id="L23" class="blob-num js-line-number" data-line-number="23"></td> - <td id="LC23" class="blob-code blob-code-inner js-file-line"> {</td> - </tr> - <tr> - <td id="L24" class="blob-num js-line-number" data-line-number="24"></td> - <td id="LC24" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span>(str2[j]==str1[i])</td> - </tr> - <tr> - <td id="L25" class="blob-num js-line-number" data-line-number="25"></td> - <td id="LC25" class="blob-code blob-code-inner js-file-line"> {</td> - </tr> - <tr> - <td id="L26" class="blob-num js-line-number" data-line-number="26"></td> - <td id="LC26" class="blob-code blob-code-inner js-file-line"> ind=j;</td> - </tr> - <tr> - <td id="L27" class="blob-num js-line-number" data-line-number="27"></td> - <td id="LC27" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">break</span>;</td> - </tr> - <tr> - <td id="L28" class="blob-num js-line-number" data-line-number="28"></td> - <td id="LC28" class="blob-code blob-code-inner js-file-line"> }</td> - </tr> - <tr> - <td id="L29" class="blob-num js-line-number" data-line-number="29"></td> - <td id="LC29" class="blob-code blob-code-inner js-file-line"> }</td> - </tr> - <tr> - <td id="L30" class="blob-num js-line-number" data-line-number="30"></td> - <td id="LC30" class="blob-code blob-code-inner js-file-line"> }</td> - </tr> - <tr> - <td id="L31" class="blob-num js-line-number" data-line-number="31"></td> - <td id="LC31" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> (ind+<span class="pl-c1">1</span>);</td> - </tr> - <tr> - <td id="L32" class="blob-num js-line-number" data-line-number="32"></td> - <td id="LC32" class="blob-code blob-code-inner js-file-line">}</td> - </tr> - <tr> - <td id="L33" class="blob-num js-line-number" data-line-number="33"></td> - <td id="LC33" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span>int main()</span></td> - </tr> - <tr> - <td id="L34" class="blob-num js-line-number" data-line-number="34"></td> - <td id="LC34" class="blob-code blob-code-inner js-file-line"><span class="pl-c">{</span></td> - </tr> - <tr> - <td id="L35" class="blob-num js-line-number" data-line-number="35"></td> - <td id="LC35" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> int n1,n2;</span></td> - </tr> - <tr> - <td id="L36" class="blob-num js-line-number" data-line-number="36"></td> - <td id="LC36" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> char inp1[100000],inp2[100000];</span></td> - </tr> - <tr> - <td id="L37" class="blob-num js-line-number" data-line-number="37"></td> - <td id="LC37" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> printf("Enter the length of the first string");</span></td> - </tr> - <tr> - <td id="L38" class="blob-num js-line-number" data-line-number="38"></td> - <td id="LC38" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> scanf("%d",&n1);</span></td> - </tr> - <tr> - <td id="L39" class="blob-num js-line-number" data-line-number="39"></td> - <td id="LC39" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> for(int i=0;i<=(n1+1);i++)</span></td> - </tr> - <tr> - <td id="L40" class="blob-num js-line-number" data-line-number="40"></td> - <td id="LC40" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> {</span></td> - </tr> - <tr> - <td id="L41" class="blob-num js-line-number" data-line-number="41"></td> - <td id="LC41" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> scanf("%c",&inp1[i]);</span></td> - </tr> - <tr> - <td id="L42" class="blob-num js-line-number" data-line-number="42"></td> - <td id="LC42" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> }</span></td> - </tr> - <tr> - <td id="L43" class="blob-num js-line-number" data-line-number="43"></td> - <td id="LC43" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> printf("Enter the length of the second string");</span></td> - </tr> - <tr> - <td id="L44" class="blob-num js-line-number" data-line-number="44"></td> - <td id="LC44" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> scanf("%d",&n2 );</span></td> - </tr> - <tr> - <td id="L45" class="blob-num js-line-number" data-line-number="45"></td> - <td id="LC45" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> for(int j=0;j<=(n2+1);j++)</span></td> - </tr> - <tr> - <td id="L46" class="blob-num js-line-number" data-line-number="46"></td> - <td id="LC46" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> {</span></td> - </tr> - <tr> - <td id="L47" class="blob-num js-line-number" data-line-number="47"></td> - <td id="LC47" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> scanf("%c",&inp2[j]);</span></td> - </tr> - <tr> - <td id="L48" class="blob-num js-line-number" data-line-number="48"></td> - <td id="LC48" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> }</span></td> - </tr> - <tr> - <td id="L49" class="blob-num js-line-number" data-line-number="49"></td> - <td id="LC49" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> strcspnfn(inp1,n1+1,inp2,n2+1);</span></td> - </tr> - <tr> - <td id="L50" class="blob-num js-line-number" data-line-number="50"></td> - <td id="LC50" class="blob-code blob-code-inner js-file-line"><span class="pl-c">}</span></td> - </tr> - <tr> - <td id="L51" class="blob-num js-line-number" data-line-number="51"></td> - <td id="LC51" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">*/</span></span></td> - </tr> -</table> - - </div> - - </div> - - <button type="button" data-facebox="#jump-to-line" data-facebox-class="linejump" data-hotkey="l" class="d-none">Jump to Line</button> - <div id="jump-to-line" style="display:none"> - <!-- '"` --><!-- </textarea></xmp> --></option></form><form accept-charset="UTF-8" action="" class="js-jump-to-line-form" method="get"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /></div> - <input class="form-control linejump-input js-jump-to-line-field" type="text" placeholder="Jump to line…" aria-label="Jump to line" autofocus> - <button type="submit" class="btn">Go</button> -</form> </div> - - </div> - <div class="modal-backdrop js-touch-events"></div> -</div> - - </div> - </div> - - </div> - - -<div class="container site-footer-container"> - <div class="site-footer " role="contentinfo"> - <ul class="site-footer-links float-right"> - <li><a href="https://github.com/contact" data-ga-click="Footer, go to contact, text:contact">Contact GitHub</a></li> - <li><a href="https://developer.github.com" data-ga-click="Footer, go to api, text:api">API</a></li> - <li><a href="https://training.github.com" data-ga-click="Footer, go to training, text:training">Training</a></li> - <li><a href="https://shop.github.com" data-ga-click="Footer, go to shop, text:shop">Shop</a></li> - <li><a href="https://github.com/blog" data-ga-click="Footer, go to blog, text:blog">Blog</a></li> - <li><a href="https://github.com/about" data-ga-click="Footer, go to about, text:about">About</a></li> - - </ul> - - <a href="https://github.com" aria-label="Homepage" class="site-footer-mark" title="GitHub"> - <svg aria-hidden="true" class="octicon octicon-mark-github" height="24" version="1.1" viewBox="0 0 16 16" width="24"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"/></svg> -</a> - <ul class="site-footer-links"> - <li>© 2017 <span title="0.15523s from unicorn-248371419-sb1tn">GitHub</span>, Inc.</li> - <li><a href="https://github.com/site/terms" data-ga-click="Footer, go to terms, text:terms">Terms</a></li> - <li><a href="https://github.com/site/privacy" data-ga-click="Footer, go to privacy, text:privacy">Privacy</a></li> - <li><a href="https://github.com/security" data-ga-click="Footer, go to security, text:security">Security</a></li> - <li><a href="https://status.github.com/" data-ga-click="Footer, go to status, text:status">Status</a></li> - <li><a href="https://help.github.com" data-ga-click="Footer, go to help, text:help">Help</a></li> - </ul> - </div> -</div> - - - - <div id="ajax-error-message" class="ajax-error-message flash flash-error"> - <svg aria-hidden="true" class="octicon octicon-alert" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M8.865 1.52c-.18-.31-.51-.5-.87-.5s-.69.19-.87.5L.275 13.5c-.18.31-.18.69 0 1 .19.31.52.5.87.5h13.7c.36 0 .69-.19.86-.5.17-.31.18-.69.01-1L8.865 1.52zM8.995 13h-2v-2h2v2zm0-3h-2V6h2v4z"/></svg> - <button type="button" class="flash-close js-flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> - <svg aria-hidden="true" class="octicon octicon-x" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"/></svg> - </button> - You can't perform that action at this time. - </div> - - - - <script crossorigin="anonymous" integrity="sha256-4hJql+6bW6S9r9DUL0kQ3LKLnx3wupYfjaWFDfvkA9s=" src="https://assets-cdn.github.com/assets/frameworks-e2126a97ee9b5ba4bdafd0d42f4910dcb28b9f1df0ba961f8da5850dfbe403db.js"></script> - - <script async="async" crossorigin="anonymous" integrity="sha256-EwSjchy8VcnU5iaBtbpZzbcWSRqe4nGo2+z+guPYT0w=" src="https://assets-cdn.github.com/assets/github-1304a3721cbc55c9d4e62681b5ba59cdb716491a9ee271a8dbecfe82e3d84f4c.js"></script> - - - - - <div class="js-stale-session-flash stale-session-flash flash flash-warn flash-banner d-none"> - <svg aria-hidden="true" class="octicon octicon-alert" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M8.865 1.52c-.18-.31-.51-.5-.87-.5s-.69.19-.87.5L.275 13.5c-.18.31-.18.69 0 1 .19.31.52.5.87.5h13.7c.36 0 .69-.19.86-.5.17-.31.18-.69.01-1L8.865 1.52zM8.995 13h-2v-2h2v2zm0-3h-2V6h2v4z"/></svg> - <span class="signed-in-tab-flash">You signed in with another tab or window. <a href="">Reload</a> to refresh your session.</span> - <span class="signed-out-tab-flash">You signed out in another tab or window. <a href="">Reload</a> to refresh your session.</span> - </div> - <div class="facebox" id="facebox" style="display:none;"> - <div class="facebox-popup"> - <div class="facebox-content" role="dialog" aria-labelledby="facebox-header" aria-describedby="facebox-description"> - </div> - <button type="button" class="facebox-close js-facebox-close" aria-label="Close modal"> - <svg aria-hidden="true" class="octicon octicon-x" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"/></svg> - </button> - </div> -</div> - - - </body> -</html> +/* Copyright (C) 2017 - 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 + Organization: FOSSEE, IIT Bombay + Author: Ankit Raj + Email: toolbox@scilab.in +*/ +#include<stdio.h> +#include<string.h> +#include "strcspn.h" +uint8 gstrcspna(char *str1,int size1,char *str2,int size2) +{ + int ind,i,j; + + for(i=0;i<=size2;i++) + { + for(j=0;j<=size1;j++) + { + if(str2[i]==str1[j]) + { + ind=j; + break; + } + } + } + return (ind+1); +} diff --git a/tests/unit_tests/testLinearAlgebra/testfullrf/testfullrf.sci b/tests/unit_tests/testLinearAlgebra/testfullrf/testfullrf.sci new file mode 100644 index 0000000..49d3c7a --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/testfullrf/testfullrf.sci @@ -0,0 +1,7 @@ +function testfullrf() + A = [1,2,3;4,5,6;7,8,9] + [Q,M,rk] = fullrf(A) + disp(Q) + disp(M) + disp(rk) +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/testgivens/testgivens.sci b/tests/unit_tests/testLinearAlgebra/testgivens/testgivens.sci new file mode 100644 index 0000000..3ef0d28 --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/testgivens/testgivens.sci @@ -0,0 +1,7 @@ +function testgivens() + a = [1] + b = [2] + [u,c] = givens(a,b) + disp(u) + disp(c) +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/testhess/testhess.sci b/tests/unit_tests/testLinearAlgebra/testhess/testhess.sci new file mode 100644 index 0000000..f991ae9 --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/testhess/testhess.sci @@ -0,0 +1,5 @@ +function testhess() + a = [0,0,0,0;0,6,7,8;9,10,11,12;13,14,15,16]; + h = hess(a) + disp(h) +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/testhouseholder/testhouseholder.sci b/tests/unit_tests/testLinearAlgebra/testhouseholder/testhouseholder.sci new file mode 100644 index 0000000..30b4c20 --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/testhouseholder/testhouseholder.sci @@ -0,0 +1,6 @@ +function testhouseholder() + A = [1;2;3;4;5] + B = [6;7;8;9;10] + u = householder(A,B) + disp(u) +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/testnorm/testnorm.sci b/tests/unit_tests/testLinearAlgebra/testnorm/testnorm.sci new file mode 100644 index 0000000..727a895 --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/testnorm/testnorm.sci @@ -0,0 +1,6 @@ +//* Function to find, norm(a,2) +function testnorm() + a = [1,2,3;4,5,6;7,8,9] // Matrix + d = norm(a,2); // Calling NORM function. + disp(d) // display output +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/testqr/testQR.sci b/tests/unit_tests/testLinearAlgebra/testqr/testQR.sci new file mode 100644 index 0000000..292e1cb --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/testqr/testQR.sci @@ -0,0 +1,8 @@ +function testQR() + A = [1,2,3;4,5,6] + [u,a,rk,e] = qr(A); + disp(u) + disp(a) + disp(rk) + disp(e) +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/testrowcomp/testrcomp.sci b/tests/unit_tests/testLinearAlgebra/testrowcomp/testrcomp.sci new file mode 100644 index 0000000..f8da948 --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/testrowcomp/testrcomp.sci @@ -0,0 +1,6 @@ +function testrcomp() + A = [1,2,3;4,5,6] + [u,rk] = rowcomp(A,"qr") + disp(u) + disp(rk) +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/testspec/testspec.sci b/tests/unit_tests/testLinearAlgebra/testspec/testspec.sci new file mode 100644 index 0000000..6e9346d --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/testspec/testspec.sci @@ -0,0 +1,9 @@ +function testspec() + A = [1,2,3;4,5,6;7,8,9] + B = [10,11,12;13,14,15;16,17,18] + [R,diagevals,c,d] = spec(A,B) + disp(R) + disp(diagevals) + disp(c) + disp(d) +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/testsqroot/testsqroot.sci b/tests/unit_tests/testLinearAlgebra/testsqroot/testsqroot.sci new file mode 100644 index 0000000..63db1f4 --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/testsqroot/testsqroot.sci @@ -0,0 +1,5 @@ +function testsqroot() + a = [1,2,3;4,5,6;7,8,9]; + e = sqroot(a); + disp(e) +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/testsva/testsva.sci b/tests/unit_tests/testLinearAlgebra/testsva/testsva.sci new file mode 100644 index 0000000..c710723 --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/testsva/testsva.sci @@ -0,0 +1,7 @@ +function testsva() + a = [1,2,3,4;5,6,7,8;9,10,11,12] + [u,s,v] = sva(a) + disp(u) + disp(s) + disp(v) +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/testsva/testsvatol.sci b/tests/unit_tests/testLinearAlgebra/testsva/testsvatol.sci new file mode 100644 index 0000000..b199ec3 --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/testsva/testsvatol.sci @@ -0,0 +1,9 @@ +// function Singular Value Approx. + +function testsvatol() + a = [1,2,3,4;5,6,7,8;9,10,11,12] + [u,s,v] = sva(a,1) + disp(u) + disp(s) + disp(v) +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/testsvd/testsvd.sci b/tests/unit_tests/testLinearAlgebra/testsvd/testsvd.sci new file mode 100644 index 0000000..9a3a50a --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/testsvd/testsvd.sci @@ -0,0 +1,6 @@ +function testsvd() + disp(" ** SVD Function (Singular Value Decomposition)** ") + A = [1,2,3,11;4,5,6,12;7,8,9,13] // Matrix - A + [s = svd(A) // Calling Function Sequence + disp(s) +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/testsvd/testsvdeconomy.sci b/tests/unit_tests/testLinearAlgebra/testsvd/testsvdeconomy.sci new file mode 100644 index 0000000..0459c79 --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/testsvd/testsvdeconomy.sci @@ -0,0 +1,11 @@ +function testsvdeconomy() + disp(" ** SVD Function (Singular Value Decomposition)** ") + A = [1,2,3,11;4,5,6,12;7,8,9,13] // Matrix - A + [u,s,vt] = svd(A,'e') // Calling Function Sequence + disp("U Matrix") + disp(u) // A = U*sigma*Vt + disp("Sigma Matrix") + disp(s) + disp(" V transpose ") + disp(vt) +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/testsvd/testsvdim.sci b/tests/unit_tests/testLinearAlgebra/testsvd/testsvdim.sci new file mode 100644 index 0000000..16633cc --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/testsvd/testsvdim.sci @@ -0,0 +1,6 @@ +// Function double_complex - test data. +function svdim() + b = [ (5.91+5.69*%i),(3.15-4.08*%i),(4.89+4.20*%i),(7.09+2.72*%i);(1.89+3.27*%i),(4.10+6.70*%i),(7.78+4.06*%i),(4.57+2.07*%i);(3.28+3.84*%i),(-0.79+7.21*%i),(3.88+3.30*%i),(3.84+1.19*%i)] + s = svd(b) + disp(s) +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/testsvd/testsvdrank.sci b/tests/unit_tests/testLinearAlgebra/testsvd/testsvdrank.sci new file mode 100644 index 0000000..108acde --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/testsvd/testsvdrank.sci @@ -0,0 +1,13 @@ +function testsvdrank() + disp(" ** SVD Function (Singular Value Decomposition)** ") + A = [1,2,3,11;4,5,6,12;7,8,9,13] // Matrix - A + [u,s,vt,rk] = svd(A) // Calling Function Sequence + disp("U Matrix") + disp(u) // A = U*sigma*Vt + disp("Sigma Matrix") + disp(s) + disp(" V transpose ") + disp(vt) + disp("Rank") + disp(rk) +endfunction diff --git a/tests/unit_tests/testLinearAlgebra/testsvd/testsvdreal.sci b/tests/unit_tests/testLinearAlgebra/testsvd/testsvdreal.sci new file mode 100644 index 0000000..0e68e00 --- /dev/null +++ b/tests/unit_tests/testLinearAlgebra/testsvd/testsvdreal.sci @@ -0,0 +1,11 @@ +function testsvdreal() + disp(" ** SVD Function (Singular Value Decomposition)** ") + A = [1,2,3,11;4,5,6,12;7,8,9,13] // Matrix - A + [u,s,vt] = svd(A) // Calling Function Sequence + disp("U Matrix") + disp(u) // A = U*sigma*Vt + disp("Sigma Matrix") + disp(s) + disp(" V transpose ") + disp(vt) +endfunction diff --git a/tests/unit_tests/test_analogFilters/scilabcode/main.sci b/tests/unit_tests/test_analogFilters/scilabcode/main.sci new file mode 100644 index 0000000..85fc494 --- /dev/null +++ b/tests/unit_tests/test_analogFilters/scilabcode/main.sci @@ -0,0 +1,33 @@ +// This is the demo function to test the analog filters +// They are of 4 types butterworth,chebyshev-1,chebyshev-2 and elliptic +// We are going to test here the butterworth, chebyshev-1 and chebyshev-2 filters +//zpbutt->butterworth filter +//zpch1 ->chebyshev type-1 filter +//zpch2 ->chebyshev type-2 filter +function main() + n=5; //n is the filter order + fl=3; //fl is the cutoff frequency + [pb,gb]=zpbutt(n,fl); + disp("poles of butterworth filter") + disp(pb); + disp("gain of butterworth filter"); + disp(gb); + + e=0.5; //e (epsilon) it is the ripples in pass band + wc=4; // wc cutoff frequency + [pc1,gc1]=zpch1(n,e,wc); + disp("poles of chebyshev-1 filter") + disp(pc1); + disp("gain of chebyshev-1 filter") + disp(gc1); + + a=4; //a is the attenuation in stop band + w=5; //w (omega) is the cutoff frequency + [zc2,pc2,gc2]=zpch2(n,a,w); + disp("zeros of chebyshev-2 filter") + disp(zc2); + disp("poles of chebyshev-2 filter") + disp(pc2); + disp("gain of chebyshev-2 filter") + disp(gc2); +endfunction diff --git a/tests/unit_tests/test_analogFilters/scilabcode/zpbutttest.sci b/tests/unit_tests/test_analogFilters/scilabcode/zpbutttest.sci new file mode 100644 index 0000000..1ea723d --- /dev/null +++ b/tests/unit_tests/test_analogFilters/scilabcode/zpbutttest.sci @@ -0,0 +1,7 @@ +function zpbutttest() + n=5; + fl=3; + [p,g]=zpbutt(n,fl); + disp(p); + disp(g); +endfunction diff --git a/tests/unit_tests/test_analogFilters/scilabcode/zpch1test.sci b/tests/unit_tests/test_analogFilters/scilabcode/zpch1test.sci new file mode 100644 index 0000000..4f29e0d4 --- /dev/null +++ b/tests/unit_tests/test_analogFilters/scilabcode/zpch1test.sci @@ -0,0 +1,9 @@ +function zpch1test() + + N=5; //N is the filter order + e=0.5; //e (epsilon) it is the ripples in pass band + wc=4; // wc cutoff frequency + [p,g]=zpch1(N,e,wc); + disp(p); + disp(g); +endfunction diff --git a/tests/unit_tests/test_analogFilters/scilabcode/zpch2test.sci b/tests/unit_tests/test_analogFilters/scilabcode/zpch2test.sci new file mode 100644 index 0000000..665fb41 --- /dev/null +++ b/tests/unit_tests/test_analogFilters/scilabcode/zpch2test.sci @@ -0,0 +1,9 @@ +function zpch2test() + n=5; + a=4; + w=5; + [z,p,g]=zpch2(n,a,w); + disp(z); + disp(p); + disp(g); +endfunction diff --git a/tests/unit_tests/test_filterResponse/scilabcode/buttmagtest.sci b/tests/unit_tests/test_filterResponse/scilabcode/buttmagtest.sci new file mode 100644 index 0000000..c7426c2 --- /dev/null +++ b/tests/unit_tests/test_filterResponse/scilabcode/buttmagtest.sci @@ -0,0 +1,7 @@ +function buttmagtest() + smp=[1:5]; + od=6; + frq=2.2; + oup=buttmag(od,frq,smp); + disp(oup); +endfunction diff --git a/tests/unit_tests/test_filterResponse/scilabcode/cheb1magtest.sci b/tests/unit_tests/test_filterResponse/scilabcode/cheb1magtest.sci new file mode 100644 index 0000000..7d09637 --- /dev/null +++ b/tests/unit_tests/test_filterResponse/scilabcode/cheb1magtest.sci @@ -0,0 +1,8 @@ +function cheb1magtest() + od=5; + wfc=3; + eps=0.3; + sap=[1:5]; + out=cheb1mag(od,wfc,eps,sap); + disp(out); +endfunction diff --git a/tests/unit_tests/test_filterResponse/scilabcode/ell1magtest.sci b/tests/unit_tests/test_filterResponse/scilabcode/ell1magtest.sci new file mode 100644 index 0000000..b53c435 --- /dev/null +++ b/tests/unit_tests/test_filterResponse/scilabcode/ell1magtest.sci @@ -0,0 +1,7 @@ +function ell1magtest() + eps1=0.2; + m11=0.4; + z1=[1,2,3]; + [s1]=ell1mag(eps1,m11,z1); + disp(s1); +endfunction diff --git a/tests/unit_tests/test_filterResponse/scilabcode/main.sci b/tests/unit_tests/test_filterResponse/scilabcode/main.sci new file mode 100644 index 0000000..6a8cbc5 --- /dev/null +++ b/tests/unit_tests/test_filterResponse/scilabcode/main.sci @@ -0,0 +1,20 @@ +function main() + + order=5; + sample1=[1:5]; + frq=2.2; + out1=buttmag(order,frq,sample1); + disp(out1); + + wfc=3; + eps=0.3; + sample2=[1:5]; + out2=cheb1mag(order,wfc,eps,sample2); + disp(out2); + + eps1=0.2; + m11=0.4; + z1=[1,2,3]; + [s1]=ell1mag(eps1,m11,z1); + disp(s1); +endfunction diff --git a/tests/unit_tests/test_jacobi/scilabcode/main.sci b/tests/unit_tests/test_jacobi/scilabcode/main.sci new file mode 100644 index 0000000..ee229eb --- /dev/null +++ b/tests/unit_tests/test_jacobi/scilabcode/main.sci @@ -0,0 +1,18 @@ +// Demo function to test %sn and %k functions +// %sn is the Jacobi's elliptic function +// %k is the Jacobi's complete integral +function main() + u=[1+2*%i 2+3*%i 3+1*%i]; // the corresponding complex vector + k=0.6; // parameter of elliptic integral + [out]=%sn(u,k); + disp(out); + m=[0.1 0.2 0.3]; // parametrt of Jacobi complete integral + s=%k(m); + disp(s); +endfunction + +//Output +//for %sn +// 1.5641568 - 0.2037920i 1.0580372 + 0.0100213i 1.1386855 - 0.4631921i +// for %k +// 1.6124413 1.6596236 1.7138894 diff --git a/tests/unit_tests/test_jacobi/scilabcode/modktest.sci b/tests/unit_tests/test_jacobi/scilabcode/modktest.sci new file mode 100644 index 0000000..613cd33 --- /dev/null +++ b/tests/unit_tests/test_jacobi/scilabcode/modktest.sci @@ -0,0 +1,5 @@ +function modktest() + m=[0.1 0.2 0.3]; + s=%k(m); + disp(s); +endfunction diff --git a/tests/unit_tests/test_jacobi/scilabcode/modsntest.sci b/tests/unit_tests/test_jacobi/scilabcode/modsntest.sci new file mode 100644 index 0000000..dc5d435 --- /dev/null +++ b/tests/unit_tests/test_jacobi/scilabcode/modsntest.sci @@ -0,0 +1,6 @@ +function modsntest() + u=[1+2*%i 2+3*%i 3+1*%i]; // the corresponding complex vector + k=0.6; // parameter of elliptic integral + [out]=%sn(u,k); + disp(out); +endfunction diff --git a/tests/unit_tests/test_string/scilabcode/asciitest.sci b/tests/unit_tests/test_string/scilabcode/asciitest.sci new file mode 100644 index 0000000..aa0017d --- /dev/null +++ b/tests/unit_tests/test_string/scilabcode/asciitest.sci @@ -0,0 +1,11 @@ +//This function test the ascii function in scilab. +//Ascii function takes the input string and then gives the ascii code of the string. +// The output for the scilab will be:- +//[97. 110. 107. 105. 116. 32. 105. 115. 32. 114. 97. 106.] + +function asciitest() + y="ankit is raj"; //This is the input string for testing the function. + x=ascii(y); //calling of the function + disp(x); +endfunction + diff --git a/tests/unit_tests/test_string/scilabcode/asciitest2.sci b/tests/unit_tests/test_string/scilabcode/asciitest2.sci new file mode 100644 index 0000000..ca7dcb7 --- /dev/null +++ b/tests/unit_tests/test_string/scilabcode/asciitest2.sci @@ -0,0 +1,5 @@ +function asciitest2() + d=[97 98 99 100 101]; + si=ascii(d); + disp(si); +endfunction diff --git a/tests/unit_tests/test_string/scilabcode/main.sci b/tests/unit_tests/test_string/scilabcode/main.sci new file mode 100644 index 0000000..4030ee0 --- /dev/null +++ b/tests/unit_tests/test_string/scilabcode/main.sci @@ -0,0 +1,30 @@ +//This is the demo function to test a set of string functions +// ascii->converts the input char vector/array to corresponding ascii code or vice versa +// strchr-> it finds the occurence of a charcter in a given string +// strncpy->copy charcters from string +// strspn-> get span of character set in string + +function main() + strascii1="ankit is raj"; //This is the input string for testing the function. + asciiout1=ascii(strascii1); //calling of the function + disp(asciiout1); + + strascii2=[97 98 99 100 101]; //Input as the ascii code to get converted to string + asciiout2=ascii(strascii2); //calling the function + disp(asciiout2); + + str="This is a sample string"; + ch="s"; + out1=strchr(str,ch); + disp(out1); + + ss="Ankit Raj"; + nn=5; + resu=strncpy(ss,nn); + disp(resu); + + strsample2="Hello this is Ankit"; + a="Ank"; + oup2=strspn(a,strsample2); + disp(oup2) +endfunction diff --git a/tests/unit_tests/test_string/scilabcode/strchrtest.sci b/tests/unit_tests/test_string/scilabcode/strchrtest.sci new file mode 100644 index 0000000..f8d3419 --- /dev/null +++ b/tests/unit_tests/test_string/scilabcode/strchrtest.sci @@ -0,0 +1,6 @@ +function strchrtest() + s="This is a sample string"; + ch="s"; + y=strchr(s,ch); + disp(y); +endfunction diff --git a/tests/unit_tests/test_string/scilabcode/strcspntest.sci b/tests/unit_tests/test_string/scilabcode/strcspntest.sci new file mode 100644 index 0000000..9a03c57 --- /dev/null +++ b/tests/unit_tests/test_string/scilabcode/strcspntest.sci @@ -0,0 +1,6 @@ +function strcspntest() + x="123243545assdsc"; + y="anki5t3"; + z=strcspn(y,x); + disp(z); +endfunction diff --git a/tests/unit_tests/test_string/scilabcode/strncpytest.sci b/tests/unit_tests/test_string/scilabcode/strncpytest.sci new file mode 100644 index 0000000..14eceb8 --- /dev/null +++ b/tests/unit_tests/test_string/scilabcode/strncpytest.sci @@ -0,0 +1,6 @@ +function strncpytest() + ss="Ankit Raj"; + nn=5; + resu=strncpy(ss,nn); + disp(resu); +endfunction diff --git a/thirdparty/lib/raspberrypi/libcblas.a b/thirdparty/lib/raspberrypi/libcblas.a Binary files differindex 719376d..bbba3e2 100644 --- a/thirdparty/lib/raspberrypi/libcblas.a +++ b/thirdparty/lib/raspberrypi/libcblas.a diff --git a/thirdparty/lib/raspberrypi/liblapack.a b/thirdparty/lib/raspberrypi/liblapack.a Binary files differindex 7ec0eb9..6165c43 100644 --- a/thirdparty/lib/raspberrypi/liblapack.a +++ b/thirdparty/lib/raspberrypi/liblapack.a diff --git a/thirdparty/lib/raspberrypi/librefblas.a b/thirdparty/lib/raspberrypi/librefblas.a Binary files differindex 0307f90..d1921c4 100644 --- a/thirdparty/lib/raspberrypi/librefblas.a +++ b/thirdparty/lib/raspberrypi/librefblas.a |