From 8893f7bbb03012a7189016d37afcedad80d569c9 Mon Sep 17 00:00:00 2001 From: imushir Date: Mon, 22 Feb 2016 14:18:24 +0530 Subject: added support of double for linspace --- macros/FunctionAnnotation/FA_SZ_LINSPACE_ROW.sci | 4 +++ .../ToolInitialization/INIT_FillSCI2LibCDirs.sci | 36 ++++++++++++++++++++++ macros/findDeps/getAllHeaders.sci | 1 + macros/findDeps/getAllInterfaces.sci | 1 + macros/findDeps/getAllSources.sci | 2 ++ 5 files changed, 44 insertions(+) create mode 100644 macros/FunctionAnnotation/FA_SZ_LINSPACE_ROW.sci (limited to 'macros') diff --git a/macros/FunctionAnnotation/FA_SZ_LINSPACE_ROW.sci b/macros/FunctionAnnotation/FA_SZ_LINSPACE_ROW.sci new file mode 100644 index 00000000..986b5291 --- /dev/null +++ b/macros/FunctionAnnotation/FA_SZ_LINSPACE_ROW.sci @@ -0,0 +1,4 @@ +function outsize = FA_SZ_LINSPACE_ROW(insize) + in1num = string(eval(insize(1))); + outsize = in1num; +endfunction: diff --git a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci index 1f07e4ad..2ad8b269 100644 --- a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci +++ b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci @@ -1074,6 +1074,39 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,E INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun); +// -------------------- +// --- Class linspace. --- +// -------------------- +ClassName = 'linspace'; + +// --- Class Annotation. --- +PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y'); +ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls); + +PrintStringInfo('NIN= 3',ClassFileName,'file','y'); +PrintStringInfo('NOUT= 1',ClassFileName,'file','y'); + +PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y'); +//PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y'); +PrintStringInfo('OUT(1).SZ(1)= FA_SZ_LINSPACE_ROW(IN(1).SZ)',ClassFileName,'file','y'); +PrintStringInfo('OUT(1).SZ(2)= IN(3).VAL',ClassFileName,'file','y'); + + +// ---Function List Class.---- +ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls); + + +PrintStringInfo('d0d0d0'+ArgSeparator+'d2',ClassFileName,'file','y'); +PrintStringInfo('d2d2d0'+ArgSeparator+'d2',ClassFileName,'file','y'); + + +// --- Annotation Function And Function List Function. --- +FunctionName = 'linspace'; // BJ : Done AS : Float_Done +PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y'); +INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun); +INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun); + + //--------------------- //-----Class Rand.------ @@ -3702,6 +3735,7 @@ ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls); PrintStringInfo('s0'+ArgSeparator+'s0',ClassFileName,'file','y'); PrintStringInfo('d0'+ArgSeparator+'d0',ClassFileName,'file','y'); PrintStringInfo('c0'+ArgSeparator+'c0',ClassFileName,'file','y'); + PrintStringInfo('z0'+ArgSeparator+'z0',ClassFileName,'file','y'); PrintStringInfo('s2'+ArgSeparator+'s2',ClassFileName,'file','y'); @@ -3847,6 +3881,7 @@ PrintStringInfo('OUT(1).TP= FA_TP_MAX(IN(1).TP,IN(2).TP)',ClassFileName,'file PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y'); PrintStringInfo('OUT(1).SZ(2)= IN(2).VAL',ClassFileName,'file','y'); PrintStringInfo('NIN= 2',ClassFileName,'file','y'); + PrintStringInfo('NOUT= 2',ClassFileName,'file','y'); PrintStringInfo('OUT(1).TP= FA_TP_MAX(IN(1).TP,IN(2).TP)',ClassFileName,'file','y'); PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y'); @@ -4806,6 +4841,7 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,Ex // // For every sci2c function library class we reported // // the domains , annotations only for the class-leader + // // Example [y1,y2]=Fun(x1,x2,x3) : scilab library function call // // Domain RxNxSel->{R,R} :the first input element is real number ,the second is integer , diff --git a/macros/findDeps/getAllHeaders.sci b/macros/findDeps/getAllHeaders.sci index 3d67a663..27a67376 100644 --- a/macros/findDeps/getAllHeaders.sci +++ b/macros/findDeps/getAllHeaders.sci @@ -94,6 +94,7 @@ function allHeaders = getAllHeaders(Target) "src/c/elementaryFunctions/includes/bitcmp.h" "src/c/elementaryFunctions/includes/bitset.h" "src/c/elementaryFunctions/includes/bitget.h" + "src/c/elementaryFunctions/includes/linspace.h" "src/c/elementaryFunctions/includes/asinh.h" "src/c/elementaryFunctions/includes/atan2.h" "src/c/elementaryFunctions/includes/atanh.h" diff --git a/macros/findDeps/getAllInterfaces.sci b/macros/findDeps/getAllInterfaces.sci index b8cd6d38..8b60d7c1 100644 --- a/macros/findDeps/getAllInterfaces.sci +++ b/macros/findDeps/getAllInterfaces.sci @@ -84,6 +84,7 @@ function allInterfaces = getAllInterfaces(Target) "src/c/elementaryFunctions/interfaces/int_bitcmp.h" "src/c/elementaryFunctions/interfaces/int_bitset.h" "src/c/elementaryFunctions/interfaces/int_bitget.h" + "src/c/elementaryFunctions/interfaces/int_linspace.h" "src/c/elementaryFunctions/interfaces/int_cosh.h" "src/c/elementaryFunctions/interfaces/int_uint8.h" "src/c/elementaryFunctions/interfaces/int_int8.h" diff --git a/macros/findDeps/getAllSources.sci b/macros/findDeps/getAllSources.sci index 64a4e470..ab4f9a0e 100644 --- a/macros/findDeps/getAllSources.sci +++ b/macros/findDeps/getAllSources.sci @@ -620,6 +620,8 @@ function allSources = getAllSources(Target) "src/c/elementaryFunctions/bitset/u16bitsets.c" "src/c/elementaryFunctions/bitget/u8bitgets.c" "src/c/elementaryFunctions/bitget/u16bitgets.c" + "src/c/elementaryFunctions/linspace/dlinspaces.c" + "src/c/elementaryFunctions/linspace/dlinspacea.c" "src/c/statisticsFunctions/max/dmaxa.c" "src/c/statisticsFunctions/max/smaxa.c" "src/c/statisticsFunctions/max/srowmaxa.c" -- cgit