diff options
author | ukashanoor | 2017-06-27 16:51:16 +0530 |
---|---|---|
committer | ukashanoor | 2017-06-27 16:51:16 +0530 |
commit | f15ab8a9f06e3936309886b52b0eb547ab1094e0 (patch) | |
tree | da9c1a9de0bc0d96fc3821120efc34d074f99ca8 /macros/CCodeGeneration | |
parent | 956aa2b9bcf6171234bc9749acbfabf8660beade (diff) | |
download | Scilab2C_fossee_old-f15ab8a9f06e3936309886b52b0eb547ab1094e0.tar.gz Scilab2C_fossee_old-f15ab8a9f06e3936309886b52b0eb547ab1094e0.tar.bz2 Scilab2C_fossee_old-f15ab8a9f06e3936309886b52b0eb547ab1094e0.zip |
matrix complete1
Diffstat (limited to 'macros/CCodeGeneration')
-rw-r--r-- | macros/CCodeGeneration/C_GenDeclarations_Dup.bin | bin | 24932 -> 29588 bytes | |||
-rw-r--r-- | macros/CCodeGeneration/C_GenDeclarations_Dup.sci | 67 |
2 files changed, 50 insertions, 17 deletions
diff --git a/macros/CCodeGeneration/C_GenDeclarations_Dup.bin b/macros/CCodeGeneration/C_GenDeclarations_Dup.bin Binary files differindex ab05955..7a4ed87 100644 --- a/macros/CCodeGeneration/C_GenDeclarations_Dup.bin +++ b/macros/CCodeGeneration/C_GenDeclarations_Dup.bin diff --git a/macros/CCodeGeneration/C_GenDeclarations_Dup.sci b/macros/CCodeGeneration/C_GenDeclarations_Dup.sci index 46d9de7..ab32ff1 100644 --- a/macros/CCodeGeneration/C_GenDeclarations_Dup.sci +++ b/macros/CCodeGeneration/C_GenDeclarations_Dup.sci @@ -85,28 +85,61 @@ if (ArgStruct.Dimension > 0) computedSizeField = computedSizeField + ', ' + ArgStruct.Size(sizeIterator); end Cdeclaration(1) = Cdeclaration(1)+C_Type(ArgStruct.Type)+' '+ArgStruct.Name+'['+computedSize+']={'; - if com_type == 0 - for i = 1:NInArg-1 - Cdeclaration(1) = Cdeclaration(1)+InArg(i).Name+','; - end - Cdeclaration(1) = Cdeclaration(1)+InArg(NInArg).Name+'};'; - else - for i=1:NInArg-1 - if InArg(i).Type <> 'z' - Cdeclaration(1) = Cdeclaration(1)+InArg(i).Name+',0,'; - else - Cdeclaration(1) = Cdeclaration(1)+InArg(i).Name+','; - end - end - if InArg(NInArg).Type <> 'z' - Cdeclaration(1) = Cdeclaration(1) + InArg(NInArg).Name + ',0};' + row = eval(ArgStruct.Size(1)) + col = eval(ArgStruct.Size(2)) + if row == 1 + if com_type == 0 + for i = 1:NInArg-1 + Cdeclaration(1) = Cdeclaration(1)+InArg(i).Name+','; + end + Cdeclaration(1) = Cdeclaration(1)+InArg(NInArg).Name+'};'; else - Cdeclaration(1) = Cdeclaration(1) + InArg(NInArg).Name + '};' + for i=1:NInArg-1 + if InArg(i).Type <> 'z' + Cdeclaration(1) = Cdeclaration(1)+InArg(i).Name+',0,'; + else + Cdeclaration(1) = Cdeclaration(1)+InArg(i).Name+','; + end + end + if InArg(NInArg).Type <> 'z' + Cdeclaration(1) = Cdeclaration(1) + InArg(NInArg).Name + ',0};' + else + Cdeclaration(1) = Cdeclaration(1) + InArg(NInArg).Name + '};' + end end + else + if com_type == 0 + for i = 1:col + for j = 0:row-1 + if (j*col)+i ~= row*col + Cdeclaration(1) = Cdeclaration(1) + InArg(((j*col)+i)).Name + ','; + end + end + end + Cdeclaration(1) = Cdeclaration(1) + InArg(NInArg).Name + '};'; + else + disp("hello") + for i = 1:col + for j = 0:row-1 + if (j*col)+i ~= row*col + if InArg(((j*col)+i)).Type <> 'z' + Cdeclaration(1) = Cdeclaration(1) + InArg(((j*col)+i)).Name + ',0,'; + else + Cdeclaration(1) = Cdeclaration(1) + InArg(((j*col)+i)).Name + ','; + end + end + end + end + if InArg(NInArg).Type <> 'z' + Cdeclaration(1) = Cdeclaration(1) + InArg(NInArg).Name + ',0};'; + else + Cdeclaration(1) = Cdeclaration(1) + InArg(NInArg).Name + '};'; + end + end end Cdeclaration(2) = Cdeclaration(2)+C_Type('i')+' __'+ArgStruct.Name+'Size['+string(computedSizeLength)+']'; if (FlagExt <> 1) - Cdeclaration(2) = Cdeclaration(2)+' = {'+computedSizeField+'};'; + Cdeclaration(2) = Cdeclaration(2)+' = {'+computedSizeField+'}'; end Cdeclaration(2) = Cdeclaration(2)+';'; end |