EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "elementary_functions", "modules\elementary_functions\src\c\elementary_functions.vcproj", "{5B110267-7C18-437C-B87D-DBA2B50729E9}"
ProjectSection(ProjectDependencies) = postProject
+ {96248E56-C84A-4803-9F50-25E2089AB6B8} = {96248E56-C84A-4803-9F50-25E2089AB6B8}
++ {8D45767A-9B03-4905-97F6-D2F3F79141EA} = {8D45767A-9B03-4905-97F6-D2F3F79141EA}
{6A84AD8C-BA18-4A3F-9C72-EC3DF0939E9E} = {6A84AD8C-BA18-4A3F-9C72-EC3DF0939E9E}
+ {F0F55692-0355-4BC3-BE9D-552C8AAC5238} = {F0F55692-0355-4BC3-BE9D-552C8AAC5238}
+ {620D8FA7-3704-438E-BB1E-391C84401A2E} = {620D8FA7-3704-438E-BB1E-391C84401A2E}
+ {43C5BAB1-1DCA-4743-A183-77E0D42FE7D0} = {43C5BAB1-1DCA-4743-A183-77E0D42FE7D0}
{3170E4C2-1173-4264-A222-7EE8CCB3DDF7} = {3170E4C2-1173-4264-A222-7EE8CCB3DDF7}
{A5911CD7-F8E8-440C-A23E-4843A0636F3A} = {A5911CD7-F8E8-440C-A23E-4843A0636F3A}
++ {1BB396F7-CE61-4CFC-9C22-266B2CFB2E74} = {1BB396F7-CE61-4CFC-9C22-266B2CFB2E74}
EndProjectSection
EndProject
Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "elementary_functions_f", "modules\elementary_functions\src\fortran\elementary_functions_f.vfproj", "{DBC45B0D-6E0A-4107-B284-5A3B0C5BB50D}"
{F6DA4FFA-E405-4DCF-883B-A3C1713F8C5D} = {F6DA4FFA-E405-4DCF-883B-A3C1713F8C5D}
EndProjectSection
EndProject
- Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "operations", "modules\operations\operations.vcproj", "{1BB396F7-CE61-4CFC-9C22-266B2CFB2E74}"
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ui_data", "modules\ui_data\src\c\ui_data.vcproj", "{142D643B-A9EC-49DB-9D48-A925A20F63B1}"
ProjectSection(ProjectDependencies) = postProject
{DD8A0506-8D31-4CF8-856A-C10ECE9C13A4} = {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}
- {DBC45B0D-6E0A-4107-B284-5A3B0C5BB50D} = {DBC45B0D-6E0A-4107-B284-5A3B0C5BB50D}
- {E1284D3E-4B3F-446B-B541-F661A8A166A7} = {E1284D3E-4B3F-446B-B541-F661A8A166A7}
+ {ECFFEB0C-1EDA-45EE-9A10-B18143852E17} = {ECFFEB0C-1EDA-45EE-9A10-B18143852E17}
+ {8028F371-6A94-4A26-8804-6E7F05F1D1AA} = {8028F371-6A94-4A26-8804-6E7F05F1D1AA}
{6A84AD8C-BA18-4A3F-9C72-EC3DF0939E9E} = {6A84AD8C-BA18-4A3F-9C72-EC3DF0939E9E}
+ {8BA2DDA8-BD04-4D4D-8EE6-6CAA955F7470} = {8BA2DDA8-BD04-4D4D-8EE6-6CAA955F7470}
{43C5BAB1-1DCA-4743-A183-77E0D42FE7D0} = {43C5BAB1-1DCA-4743-A183-77E0D42FE7D0}
- {3170E4C2-1173-4264-A222-7EE8CCB3DDF7} = {3170E4C2-1173-4264-A222-7EE8CCB3DDF7}
- {3735EFF9-925B-45B1-82CF-762658E69E70} = {3735EFF9-925B-45B1-82CF-762658E69E70}
+ {A5911CD7-F8E8-440C-A23E-4843A0636F3A} = {A5911CD7-F8E8-440C-A23E-4843A0636F3A}
+ EndProjectSection
+ EndProject
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ui_data-Ant", "modules\ui_data\src\java\ui_data-JAVA.vcproj", "{405E6B33-DBA9-4850-A19F-19298DA5A64D}"
+ ProjectSection(ProjectDependencies) = postProject
+ {142D643B-A9EC-49DB-9D48-A925A20F63B1} = {142D643B-A9EC-49DB-9D48-A925A20F63B1}
+ {FBA3BC3F-8A2C-4D47-A50D-EB808BE42F43} = {FBA3BC3F-8A2C-4D47-A50D-EB808BE42F43}
+ {ABCB724E-8534-4420-AC12-7C33A606ABA3} = {ABCB724E-8534-4420-AC12-7C33A606ABA3}
+ {B2911268-79E2-4FE5-AD59-2C3CB7CB794E} = {B2911268-79E2-4FE5-AD59-2C3CB7CB794E}
+ {2EA61E81-0F0C-4006-985C-12785093CD2F} = {2EA61E81-0F0C-4006-985C-12785093CD2F}
+ {E9783492-017E-4811-9CC7-6B71856F847C} = {E9783492-017E-4811-9CC7-6B71856F847C}
EndProjectSection
EndProject
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "history_browser-Ant", "modules\history_browser\src\java\history_browser-JAVA.vcproj", "{95C21D50-FFD1-4FCE-A545-49FA1F825B28}"
+ ProjectSection(ProjectDependencies) = postProject
+ {FBA3BC3F-8A2C-4D47-A50D-EB808BE42F43} = {FBA3BC3F-8A2C-4D47-A50D-EB808BE42F43}
+ {63965A84-E354-4CBC-BFAC-FDFC8224573F} = {63965A84-E354-4CBC-BFAC-FDFC8224573F}
+ {E9783492-017E-4811-9CC7-6B71856F847C} = {E9783492-017E-4811-9CC7-6B71856F847C}
+ {F01C26E3-E409-4E74-BA84-C7C4A71A7FDC} = {F01C26E3-E409-4E74-BA84-C7C4A71A7FDC}
+ EndProjectSection
+ EndProject
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "history_browser", "modules\history_browser\src\c\history_browser.vcproj", "{AB1EEB8F-86F7-45B7-8CEC-B18C8E97EEFF}"
+ ProjectSection(ProjectDependencies) = postProject
+ {8BA2DDA8-BD04-4D4D-8EE6-6CAA955F7470} = {8BA2DDA8-BD04-4D4D-8EE6-6CAA955F7470}
+ EndProjectSection
+ EndProject
++Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "operations", "modules\operations\operations.vcproj", "{1BB396F7-CE61-4CFC-9C22-266B2CFB2E74}"
++EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "elem_func", "modules\elementary_functions\src\cpp\elem_func\elem_func.vcproj", "{E1284D3E-4B3F-446B-B541-F661A8A166A7}"
+ ProjectSection(ProjectDependencies) = postProject
- {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4} = {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}
+ {DBC45B0D-6E0A-4107-B284-5A3B0C5BB50D} = {DBC45B0D-6E0A-4107-B284-5A3B0C5BB50D}
- {43C5BAB1-1DCA-4743-A183-77E0D42FE7D0} = {43C5BAB1-1DCA-4743-A183-77E0D42FE7D0}
- {3170E4C2-1173-4264-A222-7EE8CCB3DDF7} = {3170E4C2-1173-4264-A222-7EE8CCB3DDF7}
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
{DABDF840-2A2F-4B38-90B2-A4393E6DF38B}.Debug|x64.ActiveCfg = Debug|x64
{DABDF840-2A2F-4B38-90B2-A4393E6DF38B}.Release|Win32.ActiveCfg = Release|Win32
{DABDF840-2A2F-4B38-90B2-A4393E6DF38B}.Release|x64.ActiveCfg = Release|x64
+ {142D643B-A9EC-49DB-9D48-A925A20F63B1}.Debug|Win32.ActiveCfg = Debug|Win32
+ {142D643B-A9EC-49DB-9D48-A925A20F63B1}.Debug|Win32.Build.0 = Debug|Win32
+ {142D643B-A9EC-49DB-9D48-A925A20F63B1}.Debug|x64.ActiveCfg = Debug|x64
+ {142D643B-A9EC-49DB-9D48-A925A20F63B1}.Debug|x64.Build.0 = Debug|x64
+ {142D643B-A9EC-49DB-9D48-A925A20F63B1}.Release|Win32.ActiveCfg = Release|Win32
+ {142D643B-A9EC-49DB-9D48-A925A20F63B1}.Release|Win32.Build.0 = Release|Win32
+ {142D643B-A9EC-49DB-9D48-A925A20F63B1}.Release|x64.ActiveCfg = Release|x64
+ {142D643B-A9EC-49DB-9D48-A925A20F63B1}.Release|x64.Build.0 = Release|x64
+ {405E6B33-DBA9-4850-A19F-19298DA5A64D}.Debug|Win32.ActiveCfg = Debug|Win32
+ {405E6B33-DBA9-4850-A19F-19298DA5A64D}.Debug|Win32.Build.0 = Debug|Win32
+ {405E6B33-DBA9-4850-A19F-19298DA5A64D}.Debug|x64.ActiveCfg = Debug|x64
+ {405E6B33-DBA9-4850-A19F-19298DA5A64D}.Debug|x64.Build.0 = Debug|x64
+ {405E6B33-DBA9-4850-A19F-19298DA5A64D}.Release|Win32.ActiveCfg = Release|Win32
+ {405E6B33-DBA9-4850-A19F-19298DA5A64D}.Release|Win32.Build.0 = Release|Win32
+ {405E6B33-DBA9-4850-A19F-19298DA5A64D}.Release|x64.ActiveCfg = Release|x64
+ {405E6B33-DBA9-4850-A19F-19298DA5A64D}.Release|x64.Build.0 = Release|x64
+ {95C21D50-FFD1-4FCE-A545-49FA1F825B28}.Debug|Win32.ActiveCfg = Debug|Win32
+ {95C21D50-FFD1-4FCE-A545-49FA1F825B28}.Debug|Win32.Build.0 = Debug|Win32
+ {95C21D50-FFD1-4FCE-A545-49FA1F825B28}.Debug|x64.ActiveCfg = Debug|x64
+ {95C21D50-FFD1-4FCE-A545-49FA1F825B28}.Debug|x64.Build.0 = Debug|x64
+ {95C21D50-FFD1-4FCE-A545-49FA1F825B28}.Release|Win32.ActiveCfg = Release|Win32
+ {95C21D50-FFD1-4FCE-A545-49FA1F825B28}.Release|Win32.Build.0 = Release|Win32
+ {95C21D50-FFD1-4FCE-A545-49FA1F825B28}.Release|x64.ActiveCfg = Release|x64
+ {95C21D50-FFD1-4FCE-A545-49FA1F825B28}.Release|x64.Build.0 = Release|x64
+ {AB1EEB8F-86F7-45B7-8CEC-B18C8E97EEFF}.Debug|Win32.ActiveCfg = Debug|Win32
+ {AB1EEB8F-86F7-45B7-8CEC-B18C8E97EEFF}.Debug|Win32.Build.0 = Debug|Win32
+ {AB1EEB8F-86F7-45B7-8CEC-B18C8E97EEFF}.Debug|x64.ActiveCfg = Debug|x64
+ {AB1EEB8F-86F7-45B7-8CEC-B18C8E97EEFF}.Debug|x64.Build.0 = Debug|x64
+ {AB1EEB8F-86F7-45B7-8CEC-B18C8E97EEFF}.Release|Win32.ActiveCfg = Release|Win32
+ {AB1EEB8F-86F7-45B7-8CEC-B18C8E97EEFF}.Release|Win32.Build.0 = Release|Win32
+ {AB1EEB8F-86F7-45B7-8CEC-B18C8E97EEFF}.Release|x64.ActiveCfg = Release|x64
+ {AB1EEB8F-86F7-45B7-8CEC-B18C8E97EEFF}.Release|x64.Build.0 = Release|x64
+ {1BB396F7-CE61-4CFC-9C22-266B2CFB2E74}.Debug|Win32.ActiveCfg = Debug|Win32
+ {1BB396F7-CE61-4CFC-9C22-266B2CFB2E74}.Debug|Win32.Build.0 = Debug|Win32
+ {1BB396F7-CE61-4CFC-9C22-266B2CFB2E74}.Debug|x64.ActiveCfg = Debug|x64
+ {1BB396F7-CE61-4CFC-9C22-266B2CFB2E74}.Debug|x64.Build.0 = Debug|x64
+ {1BB396F7-CE61-4CFC-9C22-266B2CFB2E74}.Release|Win32.ActiveCfg = Release|Win32
+ {1BB396F7-CE61-4CFC-9C22-266B2CFB2E74}.Release|Win32.Build.0 = Release|Win32
+ {1BB396F7-CE61-4CFC-9C22-266B2CFB2E74}.Release|x64.ActiveCfg = Release|x64
+ {1BB396F7-CE61-4CFC-9C22-266B2CFB2E74}.Release|x64.Build.0 = Release|x64
+ {E1284D3E-4B3F-446B-B541-F661A8A166A7}.Debug|Win32.ActiveCfg = Debug|Win32
+ {E1284D3E-4B3F-446B-B541-F661A8A166A7}.Debug|Win32.Build.0 = Debug|Win32
+ {E1284D3E-4B3F-446B-B541-F661A8A166A7}.Debug|x64.ActiveCfg = Debug|x64
+ {E1284D3E-4B3F-446B-B541-F661A8A166A7}.Debug|x64.Build.0 = Debug|x64
+ {E1284D3E-4B3F-446B-B541-F661A8A166A7}.Release|Win32.ActiveCfg = Release|Win32
+ {E1284D3E-4B3F-446B-B541-F661A8A166A7}.Release|Win32.Build.0 = Release|Win32
+ {E1284D3E-4B3F-446B-B541-F661A8A166A7}.Release|x64.ActiveCfg = Release|x64
+ {E1284D3E-4B3F-446B-B541-F661A8A166A7}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "elementary_functions", "modules\elementary_functions\src\c\elementary_functions.vcproj", "{5B110267-7C18-437C-B87D-DBA2B50729E9}"
ProjectSection(ProjectDependencies) = postProject
+ {96248E56-C84A-4803-9F50-25E2089AB6B8} = {96248E56-C84A-4803-9F50-25E2089AB6B8}
++ {8D45767A-9B03-4905-97F6-D2F3F79141EA} = {8D45767A-9B03-4905-97F6-D2F3F79141EA}
{6A84AD8C-BA18-4A3F-9C72-EC3DF0939E9E} = {6A84AD8C-BA18-4A3F-9C72-EC3DF0939E9E}
+ {F0F55692-0355-4BC3-BE9D-552C8AAC5238} = {F0F55692-0355-4BC3-BE9D-552C8AAC5238}
+ {620D8FA7-3704-438E-BB1E-391C84401A2E} = {620D8FA7-3704-438E-BB1E-391C84401A2E}
+ {43C5BAB1-1DCA-4743-A183-77E0D42FE7D0} = {43C5BAB1-1DCA-4743-A183-77E0D42FE7D0}
{3170E4C2-1173-4264-A222-7EE8CCB3DDF7} = {3170E4C2-1173-4264-A222-7EE8CCB3DDF7}
{A5911CD7-F8E8-440C-A23E-4843A0636F3A} = {A5911CD7-F8E8-440C-A23E-4843A0636F3A}
++ {1BB396F7-CE61-4CFC-9C22-266B2CFB2E74} = {1BB396F7-CE61-4CFC-9C22-266B2CFB2E74}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "elementary_functions_f", "modules\elementary_functions\src\fortran\elementary_functions_f2c.vcproj", "{DBC45B0D-6E0A-4107-B284-5A3B0C5BB50D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "special_functions_f", "modules\special_functions\src\fortran\special_functions_f2c.vcproj", "{E3A01BE7-815F-4A06-9F0A-C95E80873966}"
ProjectSection(ProjectDependencies) = postProject
+ {DBC45B0D-6E0A-4107-B284-5A3B0C5BB50D} = {DBC45B0D-6E0A-4107-B284-5A3B0C5BB50D}
+ {5B110267-7C18-437C-B87D-DBA2B50729E9} = {5B110267-7C18-437C-B87D-DBA2B50729E9}
+ {EAF0949C-28D2-497C-954F-FC13B32FF2F3} = {EAF0949C-28D2-497C-954F-FC13B32FF2F3}
{3170E4C2-1173-4264-A222-7EE8CCB3DDF7} = {3170E4C2-1173-4264-A222-7EE8CCB3DDF7}
+ {A5911CD7-F8E8-440C-A23E-4843A0636F3A} = {A5911CD7-F8E8-440C-A23E-4843A0636F3A}
++ {18F043DA-1DB5-464F-B67D-CF1C23BE7EA0} = {18F043DA-1DB5-464F-B67D-CF1C23BE7EA0}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "differential_equations", "modules\differential_equations\src\c\differential_equations.vcproj", "{F0190B5D-FB21-47A2-99AC-06627CDD0F8A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "differential_equations_f", "modules\differential_equations\src\fortran\differential_equations_f2c.vcproj", "{28E4E9CA-3EEC-43EE-9F15-56259C6677B8}"
ProjectSection(ProjectDependencies) = postProject
+ {DBC45B0D-6E0A-4107-B284-5A3B0C5BB50D} = {DBC45B0D-6E0A-4107-B284-5A3B0C5BB50D}
+ {5B110267-7C18-437C-B87D-DBA2B50729E9} = {5B110267-7C18-437C-B87D-DBA2B50729E9}
+ {8D45767A-9B03-4905-97F6-D2F3F79141EA} = {8D45767A-9B03-4905-97F6-D2F3F79141EA}
- {425B887B-9FC5-4CD2-B632-DBFC000E3E25} = {425B887B-9FC5-4CD2-B632-DBFC000E3E25}
+ {F0F55692-0355-4BC3-BE9D-552C8AAC5238} = {F0F55692-0355-4BC3-BE9D-552C8AAC5238}
++ {1D219098-007C-4F76-9AE6-271ABBB7D393} = {1D219098-007C-4F76-9AE6-271ABBB7D393}
+ {EAF0949C-28D2-497C-954F-FC13B32FF2F3} = {EAF0949C-28D2-497C-954F-FC13B32FF2F3}
{3170E4C2-1173-4264-A222-7EE8CCB3DDF7} = {3170E4C2-1173-4264-A222-7EE8CCB3DDF7}
+ {A5911CD7-F8E8-440C-A23E-4843A0636F3A} = {A5911CD7-F8E8-440C-A23E-4843A0636F3A}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "double", "modules\double\src\c\double.vcproj", "{E61FEBA7-C98E-4C42-96CA-FC03F0DB26B2}"
{F6DA4FFA-E405-4DCF-883B-A3C1713F8C5D} = {F6DA4FFA-E405-4DCF-883B-A3C1713F8C5D}
EndProjectSection
EndProject
- Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "operations", "modules\operations\operations.vcproj", "{1BB396F7-CE61-4CFC-9C22-266B2CFB2E74}"
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ui_data", "modules\ui_data\src\c\ui_data.vcproj", "{142D643B-A9EC-49DB-9D48-A925A20F63B1}"
ProjectSection(ProjectDependencies) = postProject
{DD8A0506-8D31-4CF8-856A-C10ECE9C13A4} = {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}
- {DBC45B0D-6E0A-4107-B284-5A3B0C5BB50D} = {DBC45B0D-6E0A-4107-B284-5A3B0C5BB50D}
- {E1284D3E-4B3F-446B-B541-F661A8A166A7} = {E1284D3E-4B3F-446B-B541-F661A8A166A7}
+ {ECFFEB0C-1EDA-45EE-9A10-B18143852E17} = {ECFFEB0C-1EDA-45EE-9A10-B18143852E17}
+ {8028F371-6A94-4A26-8804-6E7F05F1D1AA} = {8028F371-6A94-4A26-8804-6E7F05F1D1AA}
{6A84AD8C-BA18-4A3F-9C72-EC3DF0939E9E} = {6A84AD8C-BA18-4A3F-9C72-EC3DF0939E9E}
+ {8BA2DDA8-BD04-4D4D-8EE6-6CAA955F7470} = {8BA2DDA8-BD04-4D4D-8EE6-6CAA955F7470}
{43C5BAB1-1DCA-4743-A183-77E0D42FE7D0} = {43C5BAB1-1DCA-4743-A183-77E0D42FE7D0}
- {3170E4C2-1173-4264-A222-7EE8CCB3DDF7} = {3170E4C2-1173-4264-A222-7EE8CCB3DDF7}
- {3735EFF9-925B-45B1-82CF-762658E69E70} = {3735EFF9-925B-45B1-82CF-762658E69E70}
+ {A5911CD7-F8E8-440C-A23E-4843A0636F3A} = {A5911CD7-F8E8-440C-A23E-4843A0636F3A}
+ EndProjectSection
+ EndProject
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ui_data-Ant", "modules\ui_data\src\java\ui_data-JAVA.vcproj", "{405E6B33-DBA9-4850-A19F-19298DA5A64D}"
+ ProjectSection(ProjectDependencies) = postProject
+ {142D643B-A9EC-49DB-9D48-A925A20F63B1} = {142D643B-A9EC-49DB-9D48-A925A20F63B1}
+ {FBA3BC3F-8A2C-4D47-A50D-EB808BE42F43} = {FBA3BC3F-8A2C-4D47-A50D-EB808BE42F43}
+ {ABCB724E-8534-4420-AC12-7C33A606ABA3} = {ABCB724E-8534-4420-AC12-7C33A606ABA3}
+ {B2911268-79E2-4FE5-AD59-2C3CB7CB794E} = {B2911268-79E2-4FE5-AD59-2C3CB7CB794E}
+ {2EA61E81-0F0C-4006-985C-12785093CD2F} = {2EA61E81-0F0C-4006-985C-12785093CD2F}
+ {E9783492-017E-4811-9CC7-6B71856F847C} = {E9783492-017E-4811-9CC7-6B71856F847C}
EndProjectSection
EndProject
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "history_browser-Ant", "modules\history_browser\src\java\history_browser-JAVA.vcproj", "{95C21D50-FFD1-4FCE-A545-49FA1F825B28}"
+ ProjectSection(ProjectDependencies) = postProject
+ {FBA3BC3F-8A2C-4D47-A50D-EB808BE42F43} = {FBA3BC3F-8A2C-4D47-A50D-EB808BE42F43}
+ {63965A84-E354-4CBC-BFAC-FDFC8224573F} = {63965A84-E354-4CBC-BFAC-FDFC8224573F}
+ {E9783492-017E-4811-9CC7-6B71856F847C} = {E9783492-017E-4811-9CC7-6B71856F847C}
+ {F01C26E3-E409-4E74-BA84-C7C4A71A7FDC} = {F01C26E3-E409-4E74-BA84-C7C4A71A7FDC}
+ EndProjectSection
+ EndProject
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "history_browser", "modules\history_browser\src\c\history_browser.vcproj", "{AB1EEB8F-86F7-45B7-8CEC-B18C8E97EEFF}"
+ ProjectSection(ProjectDependencies) = postProject
+ {8BA2DDA8-BD04-4D4D-8EE6-6CAA955F7470} = {8BA2DDA8-BD04-4D4D-8EE6-6CAA955F7470}
+ EndProjectSection
+ EndProject
++Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "operations", "modules\operations\operations.vcproj", "{1BB396F7-CE61-4CFC-9C22-266B2CFB2E74}"
++EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "elem_func", "modules\elementary_functions\src\cpp\elem_func\elem_func.vcproj", "{E1284D3E-4B3F-446B-B541-F661A8A166A7}"
+ ProjectSection(ProjectDependencies) = postProject
- {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4} = {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}
+ {DBC45B0D-6E0A-4107-B284-5A3B0C5BB50D} = {DBC45B0D-6E0A-4107-B284-5A3B0C5BB50D}
- {43C5BAB1-1DCA-4743-A183-77E0D42FE7D0} = {43C5BAB1-1DCA-4743-A183-77E0D42FE7D0}
- {3170E4C2-1173-4264-A222-7EE8CCB3DDF7} = {3170E4C2-1173-4264-A222-7EE8CCB3DDF7}
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
{DABDF840-2A2F-4B38-90B2-A4393E6DF38B}.Debug|x64.ActiveCfg = Debug|x64
{DABDF840-2A2F-4B38-90B2-A4393E6DF38B}.Release|Win32.ActiveCfg = Release|Win32
{DABDF840-2A2F-4B38-90B2-A4393E6DF38B}.Release|x64.ActiveCfg = Release|x64
+ {142D643B-A9EC-49DB-9D48-A925A20F63B1}.Debug|Win32.ActiveCfg = Debug|Win32
+ {142D643B-A9EC-49DB-9D48-A925A20F63B1}.Debug|Win32.Build.0 = Debug|Win32
+ {142D643B-A9EC-49DB-9D48-A925A20F63B1}.Debug|x64.ActiveCfg = Debug|x64
+ {142D643B-A9EC-49DB-9D48-A925A20F63B1}.Debug|x64.Build.0 = Debug|x64
+ {142D643B-A9EC-49DB-9D48-A925A20F63B1}.Release|Win32.ActiveCfg = Release|Win32
+ {142D643B-A9EC-49DB-9D48-A925A20F63B1}.Release|Win32.Build.0 = Release|Win32
+ {142D643B-A9EC-49DB-9D48-A925A20F63B1}.Release|x64.ActiveCfg = Release|x64
+ {142D643B-A9EC-49DB-9D48-A925A20F63B1}.Release|x64.Build.0 = Release|x64
+ {405E6B33-DBA9-4850-A19F-19298DA5A64D}.Debug|Win32.ActiveCfg = Debug|Win32
+ {405E6B33-DBA9-4850-A19F-19298DA5A64D}.Debug|Win32.Build.0 = Debug|Win32
+ {405E6B33-DBA9-4850-A19F-19298DA5A64D}.Debug|x64.ActiveCfg = Debug|x64
+ {405E6B33-DBA9-4850-A19F-19298DA5A64D}.Debug|x64.Build.0 = Debug|x64
+ {405E6B33-DBA9-4850-A19F-19298DA5A64D}.Release|Win32.ActiveCfg = Release|Win32
+ {405E6B33-DBA9-4850-A19F-19298DA5A64D}.Release|Win32.Build.0 = Release|Win32
+ {405E6B33-DBA9-4850-A19F-19298DA5A64D}.Release|x64.ActiveCfg = Release|x64
+ {405E6B33-DBA9-4850-A19F-19298DA5A64D}.Release|x64.Build.0 = Release|x64
+ {95C21D50-FFD1-4FCE-A545-49FA1F825B28}.Debug|Win32.ActiveCfg = Debug|Win32
+ {95C21D50-FFD1-4FCE-A545-49FA1F825B28}.Debug|Win32.Build.0 = Debug|Win32
+ {95C21D50-FFD1-4FCE-A545-49FA1F825B28}.Debug|x64.ActiveCfg = Debug|x64
+ {95C21D50-FFD1-4FCE-A545-49FA1F825B28}.Debug|x64.Build.0 = Debug|x64
+ {95C21D50-FFD1-4FCE-A545-49FA1F825B28}.Release|Win32.ActiveCfg = Release|Win32
+ {95C21D50-FFD1-4FCE-A545-49FA1F825B28}.Release|Win32.Build.0 = Release|Win32
+ {95C21D50-FFD1-4FCE-A545-49FA1F825B28}.Release|x64.ActiveCfg = Release|x64
+ {95C21D50-FFD1-4FCE-A545-49FA1F825B28}.Release|x64.Build.0 = Release|x64
+ {AB1EEB8F-86F7-45B7-8CEC-B18C8E97EEFF}.Debug|Win32.ActiveCfg = Debug|Win32
+ {AB1EEB8F-86F7-45B7-8CEC-B18C8E97EEFF}.Debug|Win32.Build.0 = Debug|Win32
+ {AB1EEB8F-86F7-45B7-8CEC-B18C8E97EEFF}.Debug|x64.ActiveCfg = Debug|x64
+ {AB1EEB8F-86F7-45B7-8CEC-B18C8E97EEFF}.Debug|x64.Build.0 = Debug|x64
+ {AB1EEB8F-86F7-45B7-8CEC-B18C8E97EEFF}.Release|Win32.ActiveCfg = Release|Win32
+ {AB1EEB8F-86F7-45B7-8CEC-B18C8E97EEFF}.Release|Win32.Build.0 = Release|Win32
+ {AB1EEB8F-86F7-45B7-8CEC-B18C8E97EEFF}.Release|x64.ActiveCfg = Release|x64
+ {AB1EEB8F-86F7-45B7-8CEC-B18C8E97EEFF}.Release|x64.Build.0 = Release|x64
+ {1BB396F7-CE61-4CFC-9C22-266B2CFB2E74}.Debug|Win32.ActiveCfg = Debug|Win32
+ {1BB396F7-CE61-4CFC-9C22-266B2CFB2E74}.Debug|Win32.Build.0 = Debug|Win32
+ {1BB396F7-CE61-4CFC-9C22-266B2CFB2E74}.Debug|x64.ActiveCfg = Debug|x64
+ {1BB396F7-CE61-4CFC-9C22-266B2CFB2E74}.Debug|x64.Build.0 = Debug|x64
+ {1BB396F7-CE61-4CFC-9C22-266B2CFB2E74}.Release|Win32.ActiveCfg = Release|Win32
+ {1BB396F7-CE61-4CFC-9C22-266B2CFB2E74}.Release|Win32.Build.0 = Release|Win32
+ {1BB396F7-CE61-4CFC-9C22-266B2CFB2E74}.Release|x64.ActiveCfg = Release|x64
+ {1BB396F7-CE61-4CFC-9C22-266B2CFB2E74}.Release|x64.Build.0 = Release|x64
+ {E1284D3E-4B3F-446B-B541-F661A8A166A7}.Debug|Win32.ActiveCfg = Debug|Win32
+ {E1284D3E-4B3F-446B-B541-F661A8A166A7}.Debug|Win32.Build.0 = Debug|Win32
+ {E1284D3E-4B3F-446B-B541-F661A8A166A7}.Debug|x64.ActiveCfg = Debug|x64
+ {E1284D3E-4B3F-446B-B541-F661A8A166A7}.Debug|x64.Build.0 = Debug|x64
+ {E1284D3E-4B3F-446B-B541-F661A8A166A7}.Release|Win32.ActiveCfg = Release|Win32
+ {E1284D3E-4B3F-446B-B541-F661A8A166A7}.Release|Win32.Build.0 = Release|Win32
+ {E1284D3E-4B3F-446B-B541-F661A8A166A7}.Release|x64.ActiveCfg = Release|x64
+ {E1284D3E-4B3F-446B-B541-F661A8A166A7}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
CPPFLAGS="$CPPFLAGS -Werror -O0"
fi
- ac_config_files="$ac_config_files libs/MALLOC/Makefile libs/dynamiclibrary/Makefile libs/doublylinkedlist/Makefile libs/hashtable/Makefile libs/libst/Makefile contrib/Makefile modules/helptools/Makefile modules/helptools/macros/xmlfiletohtml.sci modules/data_structures/Makefile modules/differential_equations/Makefile modules/optimization/Makefile modules/elementary_functions/Makefile modules/special_functions/Makefile modules/io/Makefile modules/shell/Makefile modules/completion/Makefile modules/history_manager/Makefile modules/jvm/Makefile modules/sound/Makefile modules/statistics/Makefile modules/mexlib/Makefile modules/sparse/Makefile modules/linear_algebra/Makefile modules/polynomials/Makefile modules/symbolic/Makefile modules/signal_processing/Makefile modules/arnoldi/Makefile modules/interpolation/Makefile modules/intersci/Makefile modules/localization/Makefile modules/cacsd/Makefile modules/boolean/Makefile modules/integer/Makefile modules/double/Makefile modules/fileio/Makefile modules/spreadsheet/Makefile modules/string/Makefile modules/time/Makefile modules/graphics/Makefile modules/graphic_export/Makefile modules/renderer/Makefile modules/action_binding/Makefile modules/gui/Makefile modules/pvm/Makefile modules/randlib/Makefile modules/tclsci/Makefile modules/windows_tools/Makefile modules/core/Makefile modules/api_scilab/Makefile modules/call_scilab/Makefile modules/types/Makefile modules/hdf5/Makefile modules/fftw/Makefile modules/umfpack/Makefile modules/scicos/Makefile modules/scicos_blocks/Makefile modules/functions/Makefile modules/dynamic_link/Makefile modules/overloading/Makefile modules/javasci/Makefile modules/maple2scilab/Makefile modules/m2sci/Makefile modules/compatibility_functions/Makefile modules/texmacs/Makefile modules/development_tools/Makefile modules/output_stream/Makefile modules/console/Makefile modules/demo_tools/Makefile modules/genetic_algorithms/Makefile modules/simulated_annealing/Makefile modules/parameters/Makefile modules/matio/Makefile modules/operations/Makefile modules/atoms/Makefile modules/xcos/Makefile modules/xpad/Makefile modules/graph/Makefile modules/parallel/Makefile modules/Makefile libs/Makefile Makefile scilab.pc etc/modules.xml etc/classpath.xml etc/jvm_options.xml scilab-lib.properties scilab-lib-doc.properties"
-ac_config_files="$ac_config_files libs/MALLOC/Makefile libs/dynamiclibrary/Makefile libs/doublylinkedlist/Makefile libs/hashtable/Makefile libs/libst/Makefile contrib/Makefile modules/helptools/Makefile modules/helptools/macros/xmlfiletohtml.sci modules/data_structures/Makefile modules/differential_equations/Makefile modules/optimization/Makefile modules/elementary_functions/Makefile modules/special_functions/Makefile modules/io/Makefile modules/shell/Makefile modules/completion/Makefile modules/history_manager/Makefile modules/jvm/Makefile modules/sound/Makefile modules/statistics/Makefile modules/mexlib/Makefile modules/sparse/Makefile modules/linear_algebra/Makefile modules/polynomials/Makefile modules/symbolic/Makefile modules/signal_processing/Makefile modules/arnoldi/Makefile modules/interpolation/Makefile modules/intersci/Makefile modules/localization/Makefile modules/cacsd/Makefile modules/boolean/Makefile modules/integer/Makefile modules/double/Makefile modules/fileio/Makefile modules/spreadsheet/Makefile modules/string/Makefile modules/time/Makefile modules/graphics/Makefile modules/graphic_export/Makefile modules/renderer/Makefile modules/action_binding/Makefile modules/gui/Makefile modules/pvm/Makefile modules/randlib/Makefile modules/tclsci/Makefile modules/windows_tools/Makefile modules/core/Makefile modules/api_scilab/Makefile modules/call_scilab/Makefile modules/types/Makefile modules/hdf5/Makefile modules/fftw/Makefile modules/umfpack/Makefile modules/scicos/Makefile modules/scicos_blocks/Makefile modules/functions/Makefile modules/dynamic_link/Makefile modules/overloading/Makefile modules/javasci/Makefile modules/maple2scilab/Makefile modules/m2sci/Makefile modules/compatibility_functions/Makefile modules/texmacs/Makefile modules/development_tools/Makefile modules/output_stream/Makefile modules/console/Makefile modules/demo_tools/Makefile modules/genetic_algorithms/Makefile modules/simulated_annealing/Makefile modules/parameters/Makefile modules/matio/Makefile modules/atoms/Makefile modules/xcos/Makefile modules/scinotes/Makefile modules/ui_data/Makefile modules/graph/Makefile modules/parallel/Makefile modules/modules_manager/Makefile modules/history_browser/Makefile modules/Makefile libs/Makefile Makefile scilab.pc etc/modules.xml etc/classpath.xml etc/jvm_options.xml scilab-lib.properties scilab-lib-doc.properties"
++ac_config_files="$ac_config_files libs/MALLOC/Makefile libs/dynamiclibrary/Makefile libs/doublylinkedlist/Makefile libs/hashtable/Makefile libs/libst/Makefile contrib/Makefile modules/helptools/Makefile modules/helptools/macros/xmlfiletohtml.sci modules/data_structures/Makefile modules/differential_equations/Makefile modules/optimization/Makefile modules/elementary_functions/Makefile modules/special_functions/Makefile modules/io/Makefile modules/shell/Makefile modules/completion/Makefile modules/history_manager/Makefile modules/jvm/Makefile modules/sound/Makefile modules/statistics/Makefile modules/mexlib/Makefile modules/sparse/Makefile modules/linear_algebra/Makefile modules/polynomials/Makefile modules/symbolic/Makefile modules/signal_processing/Makefile modules/arnoldi/Makefile modules/interpolation/Makefile modules/intersci/Makefile modules/localization/Makefile modules/cacsd/Makefile modules/boolean/Makefile modules/integer/Makefile modules/double/Makefile modules/fileio/Makefile modules/spreadsheet/Makefile modules/string/Makefile modules/time/Makefile modules/graphics/Makefile modules/graphic_export/Makefile modules/renderer/Makefile modules/action_binding/Makefile modules/gui/Makefile modules/pvm/Makefile modules/randlib/Makefile modules/tclsci/Makefile modules/windows_tools/Makefile modules/core/Makefile modules/api_scilab/Makefile modules/call_scilab/Makefile modules/types/Makefile modules/hdf5/Makefile modules/fftw/Makefile modules/umfpack/Makefile modules/scicos/Makefile modules/scicos_blocks/Makefile modules/functions/Makefile modules/dynamic_link/Makefile modules/overloading/Makefile modules/javasci/Makefile modules/maple2scilab/Makefile modules/m2sci/Makefile modules/compatibility_functions/Makefile modules/texmacs/Makefile modules/development_tools/Makefile modules/output_stream/Makefile modules/console/Makefile modules/demo_tools/Makefile modules/genetic_algorithms/Makefile modules/simulated_annealing/Makefile modules/parameters/Makefile modules/matio/Makefile modules/operations/Makefile modules/atoms/Makefile modules/xcos/Makefile modules/scinotes/Makefile modules/ui_data/Makefile modules/graph/Makefile modules/parallel/Makefile modules/modules_manager/Makefile modules/history_browser/Makefile modules/Makefile libs/Makefile Makefile scilab.pc etc/modules.xml etc/classpath.xml etc/jvm_options.xml scilab-lib.properties scilab-lib-doc.properties"
# Detection of the module for the future version of Scilab 6
"modules/simulated_annealing/Makefile") CONFIG_FILES="$CONFIG_FILES modules/simulated_annealing/Makefile" ;;
"modules/parameters/Makefile") CONFIG_FILES="$CONFIG_FILES modules/parameters/Makefile" ;;
"modules/matio/Makefile") CONFIG_FILES="$CONFIG_FILES modules/matio/Makefile" ;;
+ "modules/operations/Makefile") CONFIG_FILES="$CONFIG_FILES modules/operations/Makefile" ;;
"modules/atoms/Makefile") CONFIG_FILES="$CONFIG_FILES modules/atoms/Makefile" ;;
"modules/xcos/Makefile") CONFIG_FILES="$CONFIG_FILES modules/xcos/Makefile" ;;
- "modules/xpad/Makefile") CONFIG_FILES="$CONFIG_FILES modules/xpad/Makefile" ;;
+ "modules/scinotes/Makefile") CONFIG_FILES="$CONFIG_FILES modules/scinotes/Makefile" ;;
+ "modules/ui_data/Makefile") CONFIG_FILES="$CONFIG_FILES modules/ui_data/Makefile" ;;
"modules/graph/Makefile") CONFIG_FILES="$CONFIG_FILES modules/graph/Makefile" ;;
"modules/parallel/Makefile") CONFIG_FILES="$CONFIG_FILES modules/parallel/Makefile" ;;
+ "modules/modules_manager/Makefile") CONFIG_FILES="$CONFIG_FILES modules/modules_manager/Makefile" ;;
+ "modules/history_browser/Makefile") CONFIG_FILES="$CONFIG_FILES modules/history_browser/Makefile" ;;
"modules/Makefile") CONFIG_FILES="$CONFIG_FILES modules/Makefile" ;;
"libs/Makefile") CONFIG_FILES="$CONFIG_FILES libs/Makefile" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
modules/simulated_annealing/Makefile
modules/parameters/Makefile
modules/matio/Makefile
+modules/operations/Makefile
modules/atoms/Makefile
modules/xcos/Makefile
- modules/xpad/Makefile
+ modules/scinotes/Makefile
+ modules/ui_data/Makefile
modules/graph/Makefile
modules/parallel/Makefile
+ modules/modules_manager/Makefile
+ modules/history_browser/Makefile
modules/Makefile
libs/Makefile
Makefile
distdir
ETAGS = etags
CTAGS = ctags
-DIST_SUBDIRS = core output_stream arnoldi elementary_functions string \
- api_scilab dynamic_link fileio history_manager spreadsheet \
- tclsci localization action_binding renderer shell completion \
- console graphic_export gui jvm graphics optimization symbolic \
- randlib statistics special_functions interpolation \
- linear_algebra integer data_structures mexlib \
- differential_equations cacsd polynomials boolean double pvm io \
- intersci signal_processing call_scilab sound time sparse \
- windows_tools functions overloading maple2scilab m2sci texmacs \
- development_tools compatibility_functions helptools fftw \
- umfpack demo_tools genetic_algorithms simulated_annealing \
- parameters matio atoms types hdf5 graph xcos scinotes parallel \
- modules_manager ui_data history_browser scicos_blocks scicos . \
- javasci
+DIST_SUBDIRS = core operations output_stream arnoldi \
+ elementary_functions string api_scilab dynamic_link fileio \
+ history_manager spreadsheet tclsci localization action_binding \
+ renderer shell completion console graphic_export gui jvm \
+ graphics optimization symbolic randlib statistics \
+ special_functions interpolation linear_algebra integer \
+ data_structures mexlib differential_equations cacsd \
+ polynomials boolean double pvm io intersci signal_processing \
+ call_scilab sound time sparse windows_tools functions \
+ overloading maple2scilab m2sci texmacs development_tools \
+ compatibility_functions helptools fftw umfpack demo_tools \
+ genetic_algorithms simulated_annealing parameters matio atoms \
- types hdf5 graph xcos xpad parallel scicos_blocks scicos . \
- javasci
++ types hdf5 graph xcos scinotes parallel modules_manager \
++ ui_data history_browser scicos_blocks scicos . javasci
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
libscicacsd_la_FFLAGS= -I$(srcdir)/includes/
libscicacsd_la_CFLAGS= -I$(srcdir)/includes/ \
+ -I$(top_srcdir)/modules/output_stream/includes/ \
++ -I$(top_srcdir)/modules/elementary_functions/includes/ \
-I$(top_srcdir)/modules/api_scilab/includes \
- -I$(top_srcdir)/modules/output_stream/includes/
+ -I$(top_srcdir)/modules/operations/includes/
pkglib_LTLIBRARIES = libscicacsd.la
libscicacsd_la_FFLAGS = -I$(srcdir)/includes/
libscicacsd_la_CFLAGS = -I$(srcdir)/includes/ \
+ -I$(top_srcdir)/modules/output_stream/includes/ \
++ -I$(top_srcdir)/modules/elementary_functions/includes/ \
-I$(top_srcdir)/modules/api_scilab/includes \
- -I$(top_srcdir)/modules/output_stream/includes/
+ -I$(top_srcdir)/modules/operations/includes/
pkglib_LTLIBRARIES = libscicacsd.la
libscicacsd_la_LDFLAGS = -version-info $(SCILAB_LIBRARY_VERSION) $(ATLAS_LIBS)
Name="VCCLCompilerTool"
AdditionalOptions=""
Optimization="0"
- AdditionalIncludeDirectories=".;../../includes;../../../../libs/dynamiclibrary/includes;../../../../libs/doublylinkedlist/includes;../../../../libs/MALLOC/includes;../../../mexlib/includes;../../../gui/src/c/wsci;../../../api_scilab/includes;../../../string/includes;../../../functions/includes;../../../dynamic_link/includes;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../pvm/includes;../../../shell/includes;../../../../libs/intl;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes;../../../operations/includes"
- AdditionalIncludeDirectories=".;../../includes;../../../../libs/dynamiclibrary/includes;../../../../libs/doublylinkedlist/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../mexlib/includes;../../../gui/src/c/wsci;../../../api_scilab/includes;../../../string/includes;../../../functions/includes;../../../dynamic_link/includes;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../pvm/includes;../../../shell/includes;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes;../../../io/includes"
++ AdditionalIncludeDirectories=".;../../includes;../../../../libs/dynamiclibrary/includes;../../../../libs/doublylinkedlist/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../mexlib/includes;../../../gui/src/c/wsci;../../../api_scilab/includes;../../../string/includes;../../../functions/includes;../../../dynamic_link/includes;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../pvm/includes;../../../shell/includes;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes;../../../io/includes;../../../operations/includes"
PreprocessorDefinitions="_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;WITH_TK;WITH_ATLAS;__STDC__"
BasicRuntimeChecks="0"
RuntimeLibrary="3"
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories=".;../../includes;../../../../libs/dynamiclibrary/includes;../../../../libs/doublylinkedlist/includes;../../../../libs/MALLOC/includes;../../../mexlib/includes;../../../gui/src/c/wsci;../../../api_scilab/includes;../../../string/includes;../../../functions/includes;../../../dynamic_link/includes;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../pvm/includes;../../../shell/includes;../../../../libs/intl;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes;../../../operations/includes"
- AdditionalIncludeDirectories=".;../../includes;../../../../libs/dynamiclibrary/includes;../../../../libs/doublylinkedlist/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../mexlib/includes;../../../gui/src/c/wsci;../../../api_scilab/includes;../../../string/includes;../../../functions/includes;../../../dynamic_link/includes;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../pvm/includes;../../../shell/includes;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes;../../../io/includes"
++ AdditionalIncludeDirectories=".;../../includes;../../../../libs/dynamiclibrary/includes;../../../../libs/doublylinkedlist/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../mexlib/includes;../../../gui/src/c/wsci;../../../api_scilab/includes;../../../string/includes;../../../functions/includes;../../../dynamic_link/includes;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../pvm/includes;../../../shell/includes;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes;../../../io/includes;../../../operations/includes"
PreprocessorDefinitions="_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;WITH_TK;WITH_ATLAS;__STDC__"
BasicRuntimeChecks="0"
RuntimeLibrary="3"
Optimization="2"
InlineFunctionExpansion="1"
FavorSizeOrSpeed="1"
- AdditionalIncludeDirectories=".;../../includes;../../../../libs/dynamiclibrary/includes;../../../../libs/doublylinkedlist/includes;../../../../libs/MALLOC/includes;../../../mexlib/includes;../../../gui/src/c/wsci;../../../api_scilab/includes;../../../string/includes;../../../functions/includes;../../../dynamic_link/includes;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../pvm/includes;../../../shell/includes;../../../../libs/intl;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes;../../../operations/includes"
- AdditionalIncludeDirectories=".;../../includes;../../../../libs/dynamiclibrary/includes;../../../../libs/doublylinkedlist/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../mexlib/includes;../../../gui/src/c/wsci;../../../api_scilab/includes;../../../string/includes;../../../functions/includes;../../../dynamic_link/includes;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../pvm/includes;../../../shell/includes;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes;../../../io/includes"
++ AdditionalIncludeDirectories=".;../../includes;../../../../libs/dynamiclibrary/includes;../../../../libs/doublylinkedlist/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../mexlib/includes;../../../gui/src/c/wsci;../../../api_scilab/includes;../../../string/includes;../../../functions/includes;../../../dynamic_link/includes;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../pvm/includes;../../../shell/includes;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes;../../../io/includes;../../../operations/includes"
PreprocessorDefinitions="NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;WITH_TK;WITH_ATLAS;__STDC__"
StringPooling="true"
RuntimeLibrary="2"
Optimization="2"
InlineFunctionExpansion="1"
FavorSizeOrSpeed="1"
- AdditionalIncludeDirectories=".;../../includes;../../../../libs/dynamiclibrary/includes;../../../../libs/doublylinkedlist/includes;../../../../libs/MALLOC/includes;../../../mexlib/includes;../../../gui/src/c/wsci;../../../api_scilab/includes;../../../string/includes;../../../functions/includes;../../../dynamic_link/includes;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../pvm/includes;../../../shell/includes;../../../../libs/intl;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes;../../../operations/includes"
- AdditionalIncludeDirectories=".;../../includes;../../../../libs/dynamiclibrary/includes;../../../../libs/doublylinkedlist/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../mexlib/includes;../../../gui/src/c/wsci;../../../api_scilab/includes;../../../string/includes;../../../functions/includes;../../../dynamic_link/includes;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../pvm/includes;../../../shell/includes;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes;../../../io/includes"
++ AdditionalIncludeDirectories=".;../../includes;../../../../libs/dynamiclibrary/includes;../../../../libs/doublylinkedlist/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../mexlib/includes;../../../gui/src/c/wsci;../../../api_scilab/includes;../../../string/includes;../../../functions/includes;../../../dynamic_link/includes;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../pvm/includes;../../../shell/includes;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes;../../../io/includes;../../../operations/includes"
PreprocessorDefinitions="NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;WITH_TK;WITH_ATLAS;__STDC__"
StringPooling="true"
RuntimeLibrary="2"
libscidifferential_equations_la_CFLAGS= -I$(srcdir)/includes/ \
--I$(top_srcdir)/modules/api_scilab/includes \
--I$(top_srcdir)/modules/output_stream/includes \
--I$(top_srcdir)/modules/elementary_functions/includes \
--I$(top_srcdir)/modules/dynamic_link/includes
+ -I$(top_srcdir)/modules/output_stream/includes \
+ -I$(top_srcdir)/modules/dynamic_link/includes \
++ -I$(top_srcdir)/modules/elementary_functions/includes \
+ -I$(top_srcdir)/modules/api_scilab/includes \
+ -I$(top_srcdir)/modules/operations/includes
++ -I$(top_srcdir)/modules/api_scilab/includes \
++ -I$(top_srcdir)/modules/elementary_functions/includes \
++ -I$(top_srcdir)/modules/dynamic_link/includes
++
pkglib_LTLIBRARIES = libscidifferential_equations.la
sci_gateway/fortran/bbvode.f
libscidifferential_equations_la_CFLAGS = -I$(srcdir)/includes/ \
--I$(top_srcdir)/modules/api_scilab/includes \
--I$(top_srcdir)/modules/output_stream/includes \
--I$(top_srcdir)/modules/elementary_functions/includes \
--I$(top_srcdir)/modules/dynamic_link/includes
+ -I$(top_srcdir)/modules/output_stream/includes \
+ -I$(top_srcdir)/modules/dynamic_link/includes \
++ -I$(top_srcdir)/modules/elementary_functions/includes \
+ -I$(top_srcdir)/modules/api_scilab/includes \
+ -I$(top_srcdir)/modules/operations/includes
pkglib_LTLIBRARIES = libscidifferential_equations.la
libscidifferential_equations_la_LDFLAGS = -version-info $(SCILAB_LIBRARY_VERSION)
uninstall-libscidifferential_equations_la_sci_gatewayDATA \
uninstall-pkglibLTLIBRARIES
++ -I$(top_srcdir)/modules/api_scilab/includes \
++ -I$(top_srcdir)/modules/elementary_functions/includes \
++ -I$(top_srcdir)/modules/dynamic_link/includes
# This target enables tests for Scilab
check-local: $(top_builddir)/scilab-bin test
-I$(top_srcdir)/libs/MALLOC/includes/ \
-I$(top_srcdir)/modules/fileio/includes \
-I$(top_srcdir)/modules/localization/includes \
+ -I$(top_srcdir)/modules/string/includes \
-I$(top_srcdir)/modules/io/includes \
+-I$(top_srcdir)/modules/operations/includes \
-I$(top_srcdir)/libs/dynamiclibrary/includes \
-I$(srcdir)/src/c/ \
-I$(top_srcdir)/modules/api_scilab/includes \
-I$(top_srcdir)/libs/MALLOC/includes/ \
-I$(top_srcdir)/modules/fileio/includes \
-I$(top_srcdir)/modules/localization/includes \
+ -I$(top_srcdir)/modules/string/includes \
-I$(top_srcdir)/modules/io/includes \
+-I$(top_srcdir)/modules/operations/includes \
-I$(top_srcdir)/libs/dynamiclibrary/includes \
-I$(srcdir)/src/c/ \
-I$(top_srcdir)/modules/api_scilab/includes \
Name="VCCLCompilerTool"
AdditionalOptions=""
Optimization="0"
- AdditionalIncludeDirectories="../../includes;../../src/c;../../../../libs/MALLOC/includes;../../../../libs/dynamiclibrary/includes;../../../output_stream/includes;../../../windows_tools/includes;../../../localization/includes;../../../io/includes;../../../core/includes;../../../fileio/includes;../../../../libs/hashtable;../../../../libs/intl;../../../api_scilab/includes;../../../operations/includes"
- AdditionalIncludeDirectories="../../includes;../../src/c;../../../../libs/MALLOC/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/intl;../../../string/includes;../../../output_stream/includes;../../../windows_tools/includes;../../../localization/includes;../../../io/includes;../../../core/includes;../../../fileio/includes;../../../../libs/hashtable;../../../api_scilab/includes"
++ AdditionalIncludeDirectories="../../includes;../../src/c;../../../../libs/MALLOC/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/intl;../../../string/includes;../../../output_stream/includes;../../../windows_tools/includes;../../../operations/includes;../../../localization/includes;../../../io/includes;../../../core/includes;../../../fileio/includes;../../../../libs/hashtable;../../../api_scilab/includes"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;DYNAMIC_LINK_EXPORTS"
MinimalRebuild="true"
BasicRuntimeChecks="0"
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="../../includes;../../src/c;../../../../libs/MALLOC/includes;../../../../libs/dynamiclibrary/includes;../../../output_stream/includes;../../../windows_tools/includes;../../../localization/includes;../../../io/includes;../../../core/includes;../../../fileio/includes;../../../../libs/hashtable;../../../../libs/intl;../../../api_scilab/includes;../../../operations/includes"
- AdditionalIncludeDirectories="../../includes;../../src/c;../../../../libs/MALLOC/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/intl;../../../string/includes;../../../output_stream/includes;../../../windows_tools/includes;../../../localization/includes;../../../io/includes;../../../core/includes;../../../fileio/includes;../../../../libs/hashtable;../../../api_scilab/includes"
++ AdditionalIncludeDirectories="../../includes;../../src/c;../../../../libs/MALLOC/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/intl;../../../string/includes;../../../output_stream/includes;../../../windows_tools/includes;../../../operations/includes;../../../localization/includes;../../../io/includes;../../../core/includes;../../../fileio/includes;../../../../libs/hashtable;../../../api_scilab/includes"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;DYNAMIC_LINK_EXPORTS"
MinimalRebuild="true"
BasicRuntimeChecks="0"
InlineFunctionExpansion="1"
FavorSizeOrSpeed="1"
WholeProgramOptimization="false"
- AdditionalIncludeDirectories="../../includes;../../src/c;../../../../libs/MALLOC/includes;../../../../libs/dynamiclibrary/includes;../../../output_stream/includes;../../../windows_tools/includes;../../../localization/includes;../../../io/includes;../../../core/includes;../../../fileio/includes;../../../../libs/hashtable;../../../../libs/intl;../../../api_scilab/includes;../../../operations/includes"
- AdditionalIncludeDirectories="../../includes;../../src/c;../../../../libs/MALLOC/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/intl;../../../string/includes;../../../output_stream/includes;../../../windows_tools/includes;../../../localization/includes;../../../io/includes;../../../core/includes;../../../fileio/includes;../../../../libs/hashtable;../../../api_scilab/includes"
++ AdditionalIncludeDirectories="../../includes;../../src/c;../../../../libs/MALLOC/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/intl;../../../string/includes;../../../output_stream/includes;../../../windows_tools/includes;../../../operations/includes;../../../localization/includes;../../../io/includes;../../../core/includes;../../../fileio/includes;../../../../libs/hashtable;../../../api_scilab/includes"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;DYNAMIC_LINK_EXPORTS"
StringPooling="true"
RuntimeLibrary="2"
InlineFunctionExpansion="1"
FavorSizeOrSpeed="1"
WholeProgramOptimization="false"
- AdditionalIncludeDirectories="../../includes;../../src/c;../../../../libs/MALLOC/includes;../../../../libs/dynamiclibrary/includes;../../../output_stream/includes;../../../windows_tools/includes;../../../localization/includes;../../../io/includes;../../../core/includes;../../../fileio/includes;../../../../libs/hashtable;../../../../libs/intl;../../../api_scilab/includes;../../../operations/includes"
- AdditionalIncludeDirectories="../../includes;../../src/c;../../../../libs/MALLOC/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/intl;../../../string/includes;../../../output_stream/includes;../../../windows_tools/includes;../../../localization/includes;../../../io/includes;../../../core/includes;../../../fileio/includes;../../../../libs/hashtable;../../../api_scilab/includes"
++ AdditionalIncludeDirectories="../../includes;../../src/c;../../../../libs/MALLOC/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/intl;../../../string/includes;../../../output_stream/includes;../../../windows_tools/includes;../../../operations/includes;../../../localization/includes;../../../io/includes;../../../core/includes;../../../fileio/includes;../../../../libs/hashtable;../../../api_scilab/includes"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;DYNAMIC_LINK_EXPORTS"
StringPooling="true"
RuntimeLibrary="2"
/*
* Scilab( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright(C) INRIA
- *
+ * Copyright(C) DIGITEO - 2010 - Allan CORNET
- *
++
* 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
*
*/
- #ifndef __CALELM_H
- #define __CALELM_H
-
- #include "machine.h" /* int , C2F */
-
- typedef int(*I_fp)();
-
- int C2F(vfinite)(int *n, double *v);
+ #ifndef __ELEMENTARY_FUNCTIONS_H__
+ #define __ELEMENTARY_FUNCTIONS_H__
+ #include "machine.h" /* C2F */
- extern int C2F(rcsort)(I_fp test, int *isz, int *iptr, int *iv, int *n, int *index);
+ /* these functions as fortran subroutines of elementary_functions */
- extern double C2F(arcosh)(double *x);
- extern double C2F(arsinh)(double *x);
- extern int C2F(calerf)(double *arg, double *result, int *jint);
- extern double C2F(derf)(double *x);
- extern double C2F(derfc)(double *x);
- extern double C2F(derfcx)(double *x);
- extern int C2F(dgefa)(double *a, int *lda, int *n, int *ipvt, int *info);
- extern int C2F(ccopy)(int *n, char *dx, int *incx, char *dy, int *incy, int dx_len, int dy_len);
- extern double C2F(coshin)(double *x);
- extern int C2F(cusum)(int *n, double *w);
- extern int C2F(dadd)(int *n, double *dx, int *incx, double *dy, int *incy);
- extern int C2F(dad)(double *a, int *na, int *i1, int *i2, int *j1, int *j2, double *r__, int *isw);
- extern int C2F(ddif)(int *n, double *a, int *na, double *b, int *nb);
- extern int C2F(ddpow1)(int *n, double *v, int *iv, double *p, int *ip, double *rr, double *ri, int *ir, int *ierr, int *iscmpl);
- extern int C2F(ddpowe)(double *v, double *p, double *rr, double *ri, int *ierr, int *iscmpl);
- extern int C2F(ddpow)(int *n, double *vr, double *vi, int *iv, double *dpow, int *ierr, int *iscmpl);
- extern int C2F(ddrdiv)(double *a, int *ia, double *b, int *ib, double *r__, int *ir, int *n, int *ierr);
- extern int C2F(dipowe)(double *v, int *p, double *r__, int *ierr);
- extern int C2F(dipow)(int *n, double *v, int *iv, int *ipow, int *ierr);
- extern int C2F(dlblks)(char *name__, int *nbc, int name_len);
- extern double C2F(dlgama)(double *x);
- extern int C2F(dmcopy)(double *a, int *na, double *b, int *nb, int *m, int *n);
- extern int C2F(dmmul1)(double *a, int *na, double *b, int *nb, double *c__, int *nc, int *l, int *m, int *n);
- extern int C2F(dmmul)(double *a, int *na, double *b, int *nb, double *c__, int *nc, int *l, int *m, int *n);
- extern int C2F(dmprod)(int *flag__, double *a, int *na, int *m, int *n, double *v, int *nv);
- extern int C2F(dmsum)(int *flag__, double *a, int *na, int *m, int *n, double *v, int *nv);
- extern int C2F(drdiv)(double *a, int *ia, double *b, int *ib, double *r__, int *ir, int *n, int *ierr);
- extern int C2F(dset)(int *n, double *dx, double *dy, int *incy);
- extern int C2F(dsort)(double *count, int *n, int *index);
- extern double C2F(dsum)(int *n, double *dx, int *incx);
- extern int C2F(dtild)(int *n, double *x, int *incx);
- extern int C2F(dvmul)(int *n, double *dx, int *incx, double *dy, int *incy);
- extern int C2F(dwdiv)(double *ar, double *br, double *bi, double *cr, double *ci, int *ierr);
- extern int C2F(dwpow1)(int *n, double *v, int *iv, double *pr, double *pi, int *ip, double *rr, double *ri, int *ir, int *ierr);
- extern int C2F(dwpowe)(double *v, double *pr, double *pi, double *rr, double *ri, int *ierr);
- extern int C2F(dwpow)(int *n, double *vr, double *vi, int *iv, double *powr, double *powi, int *ierr);
- extern int C2F(dwrdiv)(double *ar, int *ia, double *br, double *bi, int *ib, double *rr, double *ri, int *ir, int *n, int *ierr);
- extern int C2F(franck)(double *a, int *na, int *n, int *job);
- extern double C2F(dgamma)(double *x);
- extern int C2F(gdcp2i)(int *n, int *itab, int *m);
- extern int C2F(hilber)(double *a, int *lda, int *n);
+ int C2F(dmcopy)(double *a, int *na, double *b, int *nb, int *m, int *n);
+ int C2F(dset)(int *n, double *dx, double *dy, int *incy);
+ int C2F(wwrdiv)(double *ar, double *ai, int *ia, double *br, double *bi, int *ib, double *rr, double *ri, int *ir, int *n, int *ierr);
+ int C2F(dmmul)(double *a, int *na, double *b, int *nb, double *c__, int *nc, int *l, int *m, int *n);
+ int C2F(dsort)(double *count, int *n, int *index);
- extern int C2F(idmax)(int *n, double *dx, int *incx);
- extern int C2F(idmin)(int *n, double *dx, int *incx);
- extern int C2F(imcopy)(int *a, int *na, int *b, int *nb, int *m, int *n);
- extern double C2F(infinity)(double *x);
- extern int C2F(intp)(double *x, double *xd, double *yd, int *n, int *nc, double *y);
- extern int C2F(isort)(int *count, int *n, int *index);
- extern int C2F(isova0)(double *a, int *lda, int *m, int *n, double *path, int *kpath, int *ir, int *ic, int *dir, int *pend, int *h__, int *v, double *c__);
- extern int C2F(isoval)(double *a, int *lda, int *m, int *n, double *c__, double *path, int *npath, int *maxp, int *ierr, int *iw, int *job);
- extern int C2F(ivimp)(int *i1, int *i2, int *pas, int *iv);
- extern int C2F(iwamax)(int *n, double *xr, double *xi, int *incx);
- extern int C2F(kronc)(double *ar, double *ai, int *ia, int *ma, int *na, double *br, double *bi, int *ib, int *mb, int *nb, double *pkr, double *pki, int *ik);
- extern int C2F(kronr)(double *a, int *ia, int *ma, int *na, double *b, int *ib, int *mb, int *nb, double *pk, int *ik);
- extern int C2F(lnblnk)(char *str, int str_len);
- extern int C2F(magic)(double *a, int *lda, int *n);
- extern int C2F(mtran)(double *a, int *na, double *b, int *nb, int *m, int *n);
- extern double C2F(nearfloat)(double *x, double *dir);
- extern double C2F(psi)(double *xx);
- extern double C2F(pythag)(double *a, double *b);
- extern int C2F(rat)(double *x, double *eps, int *n, int *d__, int *fail);
- extern int C2F(ribesl)(double *x, double *alpha, int *nb, int *ize, double *b, int *ncalc);
- extern int C2F(rjbesl)(double *x, double *alpha, int *nb, double *b, int *ncalc);
- extern int C2F(rkbesl)(double *x, double *alpha, int *nb, int *ize, double *bk, int *ncalc);
- /*extern double C2F(round)(double *x1);*/
- extern int C2F(rybesl)(double *x, double *alpha, int *nb, double *by, int *ncalc);
- extern double C2F(urand)(int *iy);
- extern int C2F(vpythag)(int *n, double *xr, double *xi);
- extern int C2F(wacos)(double *zr, double *zi, double *ar, double *ai);
- extern int C2F(wasin)(double *zr, double *zi, double *ar, double *ai);
- extern double C2F(wasum)(int *n, double *xr, double *xi, int *incx);
- extern int C2F(watan)(double *xr, double *xi, double *yr, double *yi);
- extern double C2F(lnp1m1)(double *s);
- extern double C2F(logp1)(double *x);
- /* comlen stack_ 16 */
- /* comlen vstk_ 65568 */
- /* comlen recu_ 8212 */
- /* comlen iop_ 65620 */
- /* comlen errgst_ 24 */
- /* comlen com_ 68 */
- /* comlen cha1_ 4222 */
- /* comlen dbg_ 976 */
- /* comlen adre_ 260 */
- /* comlen intersci_ 1924 */
- extern int C2F(waxpy)(int *n, double *sr, double *si, double *xr, double *xi, int *incx, double *yr, double *yi, int *incy);
- extern int C2F(wcopy)(int *n, double *dxr, double *dxi, int *incx, double *dyr, double *dyi, int *incy);
- extern int C2F(wddiv)(double *ar, double *ai, double *br, double *cr, double *ci, int *ierr);
- extern int C2F(wdiv)(double *ar, double *ai, double *br, double *bi, double *cr, double *ci);
- extern double C2F(wdotci)(int *n, double *xr, double *xi, int *incx, double *yr, double *yi, int *incy);
- extern double C2F(wdotcr)(int *n, double *xr, double *xi, int *incx, double *yr, double *yi, int *incy);
- extern int C2F(wdpow1)(int *n, double *vr, double *vi, int *iv, double *p, int *ip, double *rr, double *ri, int *ir, int *ierr);
- extern int C2F(wdpowe)(double *vr, double *vi, double *p, double *rr, double *ri, int *ierr);
- extern int C2F(wdpow)(int *n, double *vr, double *vi, int *iv, double *dpow, int *ierr);
- extern int C2F(wdrdiv)(double *ar, double *ai, int *ia, double *br, int *ib, double *rr, double *ri, int *ir, int *n, int *ierr);
- extern int C2F(wipowe)(double *vr, double *vi, int *p, double *rr, double *ri, int *ierr);
- extern int C2F(wipow)(int *n, double *vr, double *vi, int *iv, int *ipow, int *ierr);
- extern int C2F(wlog)(double *xr, double *xi, double *yr, double *yi);
- extern int C2F(wmmul)(double *ar, double *ai, int *na, double *br, double *bi, int *nb, double *cr, double *ci, int *nc, int *l, int *m, int *n);
- extern int C2F(wmprod)(int *flag__, double *ar, double *ai, int *na, int *m, int *n, double *vr, double *vi, int *nv);
- extern int C2F(wmsum)(int *flag__, double *ar, double *ai, int *na, int *m, int *n, double *vr, double *vi, int *nv);
- extern int C2F(wmul)(double *ar, double *ai, double *br, double *bi, double *cr, double *ci);
- extern int C2F(wrscal)(int *n, double *s, double *xr, double *xi, int *incx);
- extern int C2F(wscal)(int *n, double *sr, double *si, double *xr, double *xi, int *incx);
- extern int C2F(wsign)(double *xr, double *xi, double *yr, double *yi, double *zr, double *zi);
- extern int C2F(rptest)(double *r1, double *i1, double *r2, double *i2);
- extern int C2F(modtest)(double *r1, double *i1, double *r2, double *i2);
- extern int C2F(wsqrt)(double *xr, double *xi, double *yr, double *yi);
- extern int C2F(wswap)(int *n, double *xr, double *xi, int *incx, double *yr, double *yi, int *incy);
- extern int C2F(wtan)(double *xr, double *xi, double *yr, double *yi);
- extern int C2F(wvmul)(int *n, double *dxr, double *dxi, int *incx, double *dyr, double *dyi, int *incy);
- extern int C2F(wwdiv)(double *ar, double *ai, double *br, double *bi, double *cr, double *ci, int *ierr);
- extern int C2F(wwpow1)(int *n, double *vr, double *vi, int *iv, double *pr, double *pi, int *ip, double *rr, double *ri, int *ir, int *ierr);
- extern int C2F(wwpowe)(double *vr, double *vi, double *pr, double *pi, double *rr, double *ri, int *ierr);
- extern int C2F(wwpow)(int *n, double *vr, double *vi, int *iv, double *powr, double *powi, int *ierr);
- extern int C2F(wwrdiv)(double *ar, double *ai, int *ia, double *br, double *bi, int *ib, double *rr, double *ri, int *ir, int *n, int *ierr);
- #endif /** SCI_ **/
+ #endif /* __ELEMENTARY_FUNCTIONS_H__ */
-
/*--------------------------------------------------------------------------*/
static gw_generic_table Tab[] =
{
- {C2F(sci_abs),"abs"},
- {C2F(sci_real),"real"},
- {C2F(sci_imag),"imag"},
- {C2F(sci_conj),"conj"},
- {C2F(sci_round),"round"},
- {C2F(sci_int),"int"},
- {C2F(sci_size),"size"},
- {C2F(sci_sum),"sum"},
- {C2F(sci_prod),"prod"},
- {C2F(sci_diag),"diag"},
- {C2F(sci_triu),"triu"},
- {C2F(sci_tril),"tril"},
- {C2F(sci_eye),"eye"},
- {C2F(sci_rand),"rand"},
- {C2F(sci_ones),"ones"},
- {C2F(sci_maxi),"maxi"},
- {C2F(sci_maxi),"mini"},
- {C2F(sci_kron),"kron"},
- {C2F(sci_kron),".*."},
- {C2F(sci_kron),"./."},
- {C2F(sci_kron),".\\."},
- {C2F(sci_sin),"sin"},
- {C2F(sci_cos),"cos"},
- {C2F(sci_atan),"atan"},
- {C2F(sci_exp),"exp"},
- {C2F(sci_sqrt),"sqrt"},
- {C2F(sci_log),"log"},
- {C2F(sci_chinesehat),"^"},
- {C2F(sci_sign),"sign"},
- {C2F(sci_clean),"clean"},
- {C2F(sci_floor),"floor"},
- {C2F(sci_ceil),"ceil"},
- {C2F(sci_expm),"expm"},
- {C2F(sci_cumsum),"cumsum"},
- {C2F(sci_cumprod),"cumprod"},
- {C2F(sci_testmatrix),"testmatrix"},
- {C2F(sci_isreal),"isreal"},
- {C2F(sci_frexp),"frexp"},
- {C2F(sci_zeros),"zeros"},
- {C2F(sci_tan),"tan"},
- {C2F(sci_log1p),"log1p"},
- {C2F(sci_imult),"imult"},
- {C2F(sci_asin),"asin"},
- {C2F(sci_acos),"acos"},
- {C2F(sci_number_properties),"number_properties"},
- {C2F(sci_nearfloat),"nearfloat"},
- {C2F(sci_dsearch),"dsearch"},
- {C2F(sci_isequal),"isequal"},
- {C2F(sci_spones),"spones"},
- {C2F(sci_gsort),"gsort"},
- {C2F(sci_isequalbitwise),"isequalbitwise"},
- {C2F(sci_scimatrix),"matrix"}
+ {sci_abs, "abs"},
+ {sci_real, "real"},
+ {sci_imag, "imag"},
+ {sci_conj, "conj"},
+ {sci_round, "round"},
+ {sci_int, "int"},
+ {sci_size, "size"},
+ {sci_sum, "sum"},
+ {sci_prod, "prod"},
+ {sci_diag, "diag"},
+ {sci_triu, "triu"},
+ {sci_tril, "tril"},
+ {sci_eye, "eye"},
+ {sci_rand, "rand"},
+ {sci_ones, "ones"},
+ {sci_maxi, "max"},
+ {sci_maxi, "min"},
+ {sci_kron, "kron"},
+ {sci_kron, "kron"},
+ {sci_kron, "kron"},
- {sci_scimatrix, "matrix"},
+ {sci_sin, "sin"},
+ {sci_cos, "cos"},
+ {sci_atan, "atan"},
+ {sci_exp, "exp"},
+ {sci_sqrt, "sqrt"},
+ {sci_log, "log"},
+ {sci_chinesehat, "^"},
+ {sci_sign, "sign"},
+ {sci_clean, "clean"},
+ {sci_floor, "floor"},
+ {sci_ceil, "ceil"},
+ {sci_expm, "expm"},
+ {sci_cumsum, "cumsum"},
+ {sci_cumprod, "cumprod"},
+ {sci_testmatrix, "testmatrix"},
+ {sci_isreal, "isreal"},
+ {sci_frexp, "frexp"},
+ {sci_zeros, "zeros"},
+ {sci_tan, "tan"},
+ {sci_log1p, "log1p"},
+ {sci_imult, "imult"},
+ {sci_asin, "asin"},
+ {sci_acos, "acos"},
+ {sci_number_properties, "number_properties"},
+ {sci_nearfloat, "nearfloat"},
+ {sci_dsearch, "dsearch"},
+ {sci_isequal, "isequal"},
+ {sci_spones, "spones"},
+ {sci_gsort, "gsort"},
+ {sci_isequalbitwise, "isequalbitwise"},
++ {sci_scimatrix, "matrix"},
+ {sci_rat, "rat"},
+ {sci_maxi, "maxi"},
+ {sci_maxi, "mini"}
};
/*--------------------------------------------------------------------------*/
int gw_elementary_functions(void)
* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
*
*/
-/*--------------------------------------------------------------------------*/
-#include "gw_elementary_functions.h"
/*--------------------------------------------------------------------------*/
-extern int C2F(intabs)(int *id);
+#include "gw_elementary_functions.h"
+#include "stack-c.h"
+#include "api_scilab.h"
+#include "basic_functions.h"
+
+SciErr abs_double(int* _piAddress);
+SciErr abs_poly(int* _piAddress);
+SciErr abs_sparse(int* _piAddress);
+
/*--------------------------------------------------------------------------*/
- /*--------------------------------------------------------------------------*/
- int C2F(sci_abs) (char *fname,unsigned long fname_len)
+ int sci_abs(char *fname,unsigned long fname_len)
{
- static int id[6];
- C2F(intabs)(id);
+ SciErr sciErr;
+ int iType = 0;
+ int* piAddr = NULL;
+
+ CheckRhs(1,1);
+ CheckLhs(1,1);
+
+ sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ sciErr = getVarType(pvApiCtx, piAddr, &iType);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ switch(iType)
+ {
+ case sci_matrix:
+ sciErr = abs_double(piAddr);
+ break;
+ case sci_poly:
+ sciErr = abs_poly(piAddr);
+ break;
+ case sci_sparse:
+ sciErr = abs_sparse(piAddr);
+ break;
+ default:
+ OverLoad(1);
+ break;
+ }
+
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ LhsVar(1) = Rhs + 1;
+ PutLhsVar();
return 0;
}
+
+/*Absolute value for a double*/
+SciErr abs_double(int* _piAddress)
+{
+ SciErr sciErr;
+ int i;
+ int iRows = 0;
+ int iCols = 0;
+ double *pdblReal = NULL;
+ double* pdblImg = NULL;
+
+ double* pdblRealRet = NULL;
+
+ if(isVarComplex(pvApiCtx, _piAddress))
+ {
+ sciErr = getComplexMatrixOfDouble(pvApiCtx, _piAddress, &iRows, &iCols, &pdblReal, &pdblImg);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ sciErr = allocMatrixOfDouble(pvApiCtx, Rhs + 1, iRows, iCols, &pdblRealRet);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ for(i = 0 ; i < iRows * iCols ; i++)
+ {
+ pdblRealRet[i] = dabsz(pdblReal[i], pdblImg[i]);
+ }
+ }
+ else
+ {
+ sciErr = getMatrixOfDouble(pvApiCtx, _piAddress, &iRows, &iCols, &pdblReal);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ sciErr = allocMatrixOfDouble(pvApiCtx, Rhs + 1, iRows, iCols, &pdblRealRet);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ for(i = 0 ; i < iRows * iCols ; i++)
+ {
+ pdblRealRet[i] = dabss(pdblReal[i]);
+ }
+ }
+ return sciErr;
+}
+
+/*Absolute value for a polynomial ( absolute value of each coefficient )*/
+SciErr abs_poly(int* _piAddress)
+{
+ SciErr sciErr;
+ int i,j;
+ int iLen = 0;
+ int iRows = 0;
+ int iCols = 0;
+ int *piCoeff = NULL;
+ char pstVarName[16];
+
+ double** pdblReal = NULL;
+ double** pdblImg = NULL;
+ double** pdblRealRet = NULL;
+
+ sciErr = getPolyVariableName(pvApiCtx, _piAddress, pstVarName, &iLen);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ if(isVarComplex(pvApiCtx, _piAddress))
+ {
+ sciErr = getComplexMatrixOfPoly(pvApiCtx, _piAddress, &iRows, &iCols, NULL, NULL, NULL);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ piCoeff = (int*)malloc(iRows * iCols * sizeof(int));
+ sciErr = getComplexMatrixOfPoly(pvApiCtx, _piAddress, &iRows, &iCols, piCoeff, NULL, NULL);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ pdblReal = (double**)malloc(sizeof(double*) * iRows * iCols);
+ pdblImg = (double**)malloc(sizeof(double*) * iRows * iCols);
+ pdblRealRet = (double**)malloc(sizeof(double*) * iRows * iCols);
+
+ for(i = 0 ; i < iRows * iCols ; i++)
+ {
+ pdblReal[i] = (double*)malloc(sizeof(double) * piCoeff[i]);
+ pdblImg[i] = (double*)malloc(sizeof(double) * piCoeff[i]);
+ pdblRealRet[i] = (double*)malloc(sizeof(double) * piCoeff[i]);
+ }
+
+ sciErr = getComplexMatrixOfPoly(pvApiCtx, _piAddress, &iRows, &iCols, piCoeff, pdblReal, pdblImg);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ for(i = 0 ; i < iRows * iCols ; i++)
+ {
+ for(j = 0 ; i < piCoeff[i] ; j++)
+ {
+ pdblRealRet[i][j] = dabsz(pdblReal[i][j], pdblImg[i][j]);
+ }
+ }
+
+ sciErr = createMatrixOfPoly(pvApiCtx, Rhs + 1, pstVarName, iRows, iCols, piCoeff, pdblRealRet);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+ }
+ else
+ {
+ sciErr = getMatrixOfPoly(pvApiCtx, _piAddress, &iRows, &iCols, NULL, NULL);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ piCoeff = (int*)malloc(iRows * iCols * sizeof(int));
+ sciErr = getMatrixOfPoly(pvApiCtx, _piAddress, &iRows, &iCols, piCoeff, NULL);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ pdblReal = (double**)malloc(sizeof(double*) * iRows * iCols);
+ pdblRealRet = (double**)malloc(sizeof(double*) * iRows * iCols);
+
+ for(i = 0 ; i < iRows * iCols ; i++)
+ {
+ pdblReal[i] = (double*)malloc(sizeof(double) * piCoeff[i]);
+ pdblRealRet[i] = (double*)malloc(sizeof(double) * piCoeff[i]);
+ }
+
+ for(i = 0 ; i < iRows * iCols ; i++)
+ {
+ for(j = 0 ; i < piCoeff[i] ; j++)
+ {
+ pdblRealRet[i][j] = dabss(pdblReal[i][j]);
+ }
+ }
+
+ sciErr = createMatrixOfPoly(pvApiCtx, Rhs + 1, pstVarName, iRows, iCols, piCoeff, pdblRealRet);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+ }
+
+ free(piCoeff);
+ for(i = 0 ; i < iRows * iCols ; i++)
+ {
+ free(pdblReal[i]);
+ free(pdblRealRet[i]);
+ }
+ free(pdblReal);
+ free(pdblRealRet);
+
+ if(isVarComplex(pvApiCtx, _piAddress))
+ {
+ for(i = 0 ; i < iRows * iCols ; i++)
+ {
+ free(pdblImg[i]);
+ }
+ free(pdblImg);
+ }
+ return sciErr;
+}
+
+/*Absolute value for a sparse ( absolute value of each element )*/
+SciErr abs_sparse(int* _piAddress)
+{
+ SciErr sciErr;
+ int i;
+ int iRows = 0;
+ int iCols = 0;
+ int iNbItem = 0;
+ int *piNbItemRow = NULL;
+ int *piColPos = NULL;
+
+ int iIndex = 0;
+ int iIndex2 = 0;
+ int iIndex3 = 0;
+
+ double *pdblReal = NULL;
+ double *pdblImg = NULL;
+ double *pdblRealRet = NULL;
+
+ if(isVarComplex(pvApiCtx, _piAddress))
+ {
+ sciErr = getComplexSparseMatrix(pvApiCtx, _piAddress, &iRows, &iCols, &iNbItem, &piNbItemRow, &piColPos, &pdblReal, &pdblImg);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ pdblRealRet = (double*)malloc(sizeof(double) * iNbItem);
+
+ for(i = 0 ; i < iNbItem ; i++)
+ {
+ pdblRealRet[i] = dabsz(pdblReal[i], pdblImg[i]);
+ }
+
+ sciErr = createSparseMatrix(pvApiCtx, Rhs + 1, iRows, iCols, iNbItem, piNbItemRow, piColPos, pdblRealRet);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+ }
+ else
+ {
+ sciErr = getSparseMatrix(pvApiCtx, _piAddress, &iRows, &iCols, &iNbItem, &piNbItemRow, &piColPos, &pdblReal);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ pdblRealRet = (double*)malloc(sizeof(double) * iNbItem);
+
+ for(i = 0 ; i < iNbItem ; i++)
+ {
+ pdblRealRet[i] = dabss(pdblReal[i]);
+ }
+
+ sciErr = createSparseMatrix(pvApiCtx, Rhs + 1, iRows, iCols, iNbItem, piNbItemRow, piColPos, pdblRealRet);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+ }
+
+ return sciErr;
+}
+
/*--------------------------------------------------------------------------*/
* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
*
*/
-/*--------------------------------------------------------------------------*/
-#include "gw_elementary_functions.h"
/*--------------------------------------------------------------------------*/
-extern int C2F(intacos)(int *id);
+#include "gw_elementary_functions.h"
+#include "stack-c.h"
+#include "basic_functions.h"
+#include "api_scilab.h"
+
/*--------------------------------------------------------------------------*/
- int C2F(sci_acos) (char *fname,unsigned long fname_len)
+ int sci_acos(char *fname,unsigned long fname_len)
{
- static int id[6];
- C2F(intacos)(id);
+ SciErr sciErr;
+ int i;
+ int iRows = 0;
+ int iCols = 0;
+ int iType = 0;
+
+ int* piAddr = NULL;
+
+ double *pdblReal = NULL;
+ double *pdblImg = NULL;
+ double *pdblRealRet = NULL;
+ double *pdblImgRet = NULL;
+
+ CheckRhs(1,1);
+ CheckLhs(1,1);
+
+ sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+
+ sciErr = getVarType(pvApiCtx, piAddr, &iType);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ if(iType != sci_matrix)
+ {
+ OverLoad(1);
+ return 0;
+ }
+
+ if(isVarComplex(pvApiCtx, piAddr))
+ {// case complex
+ sciErr = getComplexMatrixOfDouble(pvApiCtx, piAddr, &iRows, &iCols, &pdblReal, &pdblImg);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ sciErr = allocComplexMatrixOfDouble(pvApiCtx, Rhs + 1, iRows, iCols, &pdblRealRet, &pdblImgRet);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ for(i = 0 ; i < iRows * iCols ; i++)
+ {
+ wacos(pdblReal[i], pdblImg[i], &pdblRealRet[i], &pdblImgRet[i]);
+ }
+ }
+ else
+ {// case real
+ int itr = 0;
+
+ sciErr = getMatrixOfDouble(pvApiCtx, piAddr, &iRows, &iCols, &pdblReal);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ //check if all variables are between [-1,1]
+ for(i = 0 ; i < iRows * iCols ; i++)
+ {
+ if(fabs(pdblReal[i]) > 1)
+ {
+ itr = 1;
+ break;
+ }
+ }
+
+
+ if(itr == 0)
+ {//all values are in [-1,1]
+ sciErr = allocMatrixOfDouble(pvApiCtx, Rhs + 1, iRows, iCols, &pdblRealRet);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ for(i = 0 ; i < iRows * iCols ; i++)
+ {
+ pdblRealRet[i] = dacoss(pdblReal[i]);
+ }
+ }
+ else
+ {// Values outside [-1,1]
+ sciErr = allocComplexMatrixOfDouble(pvApiCtx, Rhs + 1, iRows, iCols, &pdblRealRet, &pdblImgRet);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ for(i = 0 ; i < iRows * iCols ; i++)
+ {
+ wacos(pdblReal[i], 0, &pdblRealRet[i], &pdblImgRet[i]);
+ }
+ }
+ }
+
+ LhsVar(1) = Rhs + 1;
+ PutLhsVar();
return 0;
}
/*--------------------------------------------------------------------------*/
* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
*
*/
-/*--------------------------------------------------------------------------*/
-#include "gw_elementary_functions.h"
/*--------------------------------------------------------------------------*/
-extern int C2F(intasin)(int *id);
+#include "gw_elementary_functions.h"
+#include "stack-c.h"
+#include "basic_functions.h"
+#include "api_scilab.h"
+
/*--------------------------------------------------------------------------*/
- int C2F(sci_asin) (char *fname,unsigned long fname_len)
+ int sci_asin(char *fname,unsigned long fname_len)
{
- static int id[6];
- C2F(intasin)(id);
+ SciErr sciErr;
+ int i;
+ int iRows = 0;
+ int iCols = 0;
+ int iType = 0;
+
+ int* piAddr = NULL;
+ double *pdblReal = NULL;
+ double *pdblImg = NULL;
+ double *pdblRealRet = NULL;
+ double *pdblImgRet = NULL;
+
+
+ CheckRhs(1,1);
+ CheckLhs(1,1);
+
+ sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ sciErr = getVarType(pvApiCtx, piAddr, &iType);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ if(iType != sci_matrix)
+ {
+ OverLoad(1);
+ return 0;
+ }
+
+ if(isVarComplex(pvApiCtx, piAddr))
+ {// case complex
+
+ sciErr = getComplexMatrixOfDouble(pvApiCtx, piAddr, &iRows, &iCols, &pdblReal, &pdblImg);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ sciErr = allocComplexMatrixOfDouble(pvApiCtx, Rhs + 1, iRows, iCols, &pdblRealRet, &pdblImgRet);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ for(i = 0 ; i < iRows * iCols ; i++)
+ {
+ wasin(pdblReal[i], pdblImg[i], &pdblRealRet[i], &pdblImgRet[i]);
+ }
+ }
+ else
+ {// case real
+ int itr = 0;
+
+ sciErr = getMatrixOfDouble(pvApiCtx, piAddr, &iRows, &iCols, &pdblReal);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ //check if all variables are between [-1,1]
+ for(i = 0 ; i < iRows * iCols ; i++)
+ {
+ if(fabs(pdblReal[i]) > 1)
+ {
+ itr = 1;
+ break;
+ }
+ }
+
+ if(itr == 0)
+ {//all values are in [-1,1]
+ sciErr = allocMatrixOfDouble(pvApiCtx, Rhs + 1, iRows, iCols, &pdblRealRet);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ for(i = 0 ; i < iRows * iCols ; i++)
+ {
+ pdblRealRet[i] = dasins(pdblReal[i]);
+ }
+ }
+ else
+ {// Values outside [-1,1]
+ sciErr = allocComplexMatrixOfDouble(pvApiCtx, Rhs + 1, iRows, iCols, &pdblRealRet, &pdblImgRet);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ for(i = 0 ; i < iRows * iCols ; i++)
+ {
+ wasin(pdblReal[i], 0, &pdblRealRet[i], &pdblImgRet[i]);
+ }
+ }
+ }
+
+ LhsVar(1) = Rhs + 1;
+ PutLhsVar();
return 0;
}
/*--------------------------------------------------------------------------*/
* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
*
*/
-/*--------------------------------------------------------------------------*/
-#include "gw_elementary_functions.h"
/*--------------------------------------------------------------------------*/
-extern int C2F(intatan)(int *id);
+
+#include "gw_elementary_functions.h"
+#include "stack-c.h"
+#include "basic_functions.h"
+#include "../../core/src/c/parse.h"
+#include "Scierror.h"
+#include "api_scilab.h"
+
/*--------------------------------------------------------------------------*/
- int C2F(sci_atan) (char *fname,unsigned long fname_len)
+ int sci_atan(char *fname,unsigned long fname_len)
{
- static int id[6];
- C2F(intatan)(id);
+ SciErr sciErr;
+ int i;
+ int iRows1 = 0;
+ int iCols1 = 0;
+ int iType1 = 0;
+ int iRows2 = 0;
+ int iCols2 = 0;
+ int iType2 = 0;
+
+ int* piAddr1 = NULL;
+ int* piAddr2 = NULL;
+
+ double *pdblReal1 = NULL;
+ double *pdblImg1 = NULL;
+ double *pdblReal2 = NULL;
+ double *pdblImg2 = NULL;
+ double *pdblRealRet = NULL;
+ double *pdblImgRet = NULL;
+
+ CheckRhs(1,2);
+ CheckLhs(1,1);
+
+ sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr1);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ sciErr = getVarType(pvApiCtx, piAddr1, &iType1);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ if(iType1 != sci_matrix)
+ {
+ OverLoad(1);
+ return 0;
+ }
+
+ if(Rhs == 1)
+ {
+ if(isVarComplex(pvApiCtx, piAddr1))
+ {// case complex
+ sciErr = getComplexMatrixOfDouble(pvApiCtx, piAddr1, &iRows1, &iCols1, &pdblReal1, &pdblImg1);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ sciErr = allocComplexMatrixOfDouble(pvApiCtx, Rhs + 1, iRows1, iCols1, &pdblRealRet, &pdblImgRet);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ for(i = 0 ; i < iRows1 * iCols1 ; i++)
+ {
+ if(pdblReal1[i] == 0 && dabss(pdblImg1[i]) == 1)
+ {
+ if(C2F(errgst).ieee==0)
+ SciError(32);
+ else if(C2F(errgst).ieee==1)
+ Msgs(64,0);
+ }
+ watan(pdblReal1[i], pdblImg1[i], &pdblRealRet[i], &pdblImgRet[i]);
+ }
+ }
+ else
+ {// case real
+ sciErr = getMatrixOfDouble(pvApiCtx, piAddr1, &iRows1, &iCols1, &pdblReal1);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ sciErr = allocMatrixOfDouble(pvApiCtx, Rhs + 1, iRows1, iCols1, &pdblRealRet);
+ for(i = 0 ; i < iRows1 * iCols1 ; i++)
+ {
+ pdblRealRet[i] = datans(pdblReal1[i]);
+ }
+ }
+ }
+ else
+ {//Rhs == 2
+ sciErr = getVarAddressFromPosition(pvApiCtx, 2, &piAddr2);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ if(isVarComplex(pvApiCtx, piAddr1) == FALSE && isVarComplex(pvApiCtx, piAddr2) == FALSE)
+ {//Only works with real matrix
+ sciErr = getMatrixOfDouble(pvApiCtx, piAddr1, &iRows1, &iCols1, &pdblReal1);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ sciErr = getMatrixOfDouble(pvApiCtx, piAddr2, &iRows2, &iCols2, &pdblReal2);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ if(iRows1 * iCols1 == iRows2 * iCols2)
+ {
+ sciErr = allocMatrixOfDouble(pvApiCtx, Rhs + 1, iRows1, iCols1, &pdblRealRet);
+ for(i = 0 ; i < iRows1 * iCols1 ; i++)
+ {
+ pdblRealRet[i] = datan2s(pdblReal1[i], pdblReal2[i]);
+ }
+ }
+ else
+ SciError(60);
+ }
+ else
+ SciError(43);
+ }
+
+ LhsVar(1) = Rhs + 1;
+ PutLhsVar();
return 0;
}
/*--------------------------------------------------------------------------*/
/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2006 - INRIA - Allan CORNET
- *
- * 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 "gw_elementary_functions.h"
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2006 - INRIA - Allan CORNET
+*
+* 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
+*
+*/
/*--------------------------------------------------------------------------*/
-extern int C2F(intceil)(int *id);
+#include "gw_elementary_functions.h"
+#include "stack-c.h"
+#include "basic_functions.h"
+#include "api_scilab.h"
+
+
+SciErr ceil_double(int* _piAddress);
+SciErr ceil_poly(int* _piAddress);
+SciErr ceil_int(int* _piAddress);
+
/*--------------------------------------------------------------------------*/
- int C2F(sci_ceil) (char *fname,unsigned long fname_len)
+ int sci_ceil(char *fname,unsigned long fname_len)
{
- static int id[6];
- C2F(intceil)(id);
+ SciErr sciErr;
+ int iType = 0;
+
+ int* piAddr = NULL;
+
+ CheckRhs(1,1);
+ CheckLhs(1,1);
+
+ sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ sciErr = getVarType(pvApiCtx, piAddr, &iType);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ switch(iType)
+ {
+ case sci_matrix :
+ sciErr = ceil_double(piAddr);
+ break;
+ case sci_poly :
+ sciErr = ceil_poly(piAddr);
+ break;
+ case sci_ints :
+ sciErr = ceil_int(piAddr);
+ break;
+ default :
+ OverLoad(1);
+ return 0;
+ }
+
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ PutLhsVar();
return 0;
}
+
+SciErr ceil_double(int* _piAddress)
+{
+ SciErr sciErr;
+ int i;
+ int iRows = 0;
+ int iCols = 0;
+ double *pdblReal = NULL;
+ double *pdblImg = NULL;
+ double *pdblRealRet = NULL;
+ double *pdblImgRet = NULL;
+
+ if(isVarComplex(pvApiCtx, _piAddress))
+ {
+ sciErr = getComplexMatrixOfDouble(pvApiCtx, _piAddress, &iRows, &iCols, &pdblReal, &pdblImg);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ sciErr = allocComplexMatrixOfDouble(pvApiCtx, Rhs + 1, iRows, iCols, &pdblRealRet, &pdblImgRet);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ for(i = 0 ; i < iCols * iRows ; i++)
+ {
+ pdblRealRet[i] = dceils(pdblReal[i]);
+ pdblImgRet[i] = dceils(pdblImg[i]);
+ }
+ }
+ else
+ {
+ sciErr = getMatrixOfDouble(pvApiCtx, _piAddress, &iRows, &iCols, &pdblReal);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ sciErr = allocMatrixOfDouble(pvApiCtx, Rhs + 1, iRows, iCols, &pdblRealRet);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ for(i = 0 ; i < iCols * iRows ; i++)
+ {
+ pdblRealRet[i] = dceils(pdblReal[i]);
+ }
+ }
+
+ LhsVar(1) = Rhs + 1;
+ return sciErr;
+}
+
+SciErr ceil_poly(int* _piAddress)
+{
+ SciErr sciErr;
+ int i,j;
+ int iRows = 0;
+ int iCols = 0;
+ int iLen = 0;
+ double** pdblReal = NULL;
+ double** pdblImg = NULL;
+ double** pdblRealRet = NULL;
+ double** pdblImgRet = NULL;
+ int *piCoeff = NULL;
+ char pstVarName[16];
+
+ sciErr = getPolyVariableName(pvApiCtx, _piAddress, pstVarName, &iLen);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ if(isVarComplex(pvApiCtx, _piAddress))
+ {
+ sciErr = getComplexMatrixOfPoly(pvApiCtx, _piAddress, &iRows, &iCols, NULL, NULL, NULL);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ piCoeff = (int*)malloc(iRows * iCols * sizeof(int));
+ sciErr = getComplexMatrixOfPoly(pvApiCtx, _piAddress, &iRows, &iCols, piCoeff, NULL, NULL);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ pdblReal = (double**)malloc(sizeof(double*) * iRows * iCols);
+ pdblImg = (double**)malloc(sizeof(double*) * iRows * iCols);
+ pdblRealRet = (double**)malloc(sizeof(double*) * iRows * iCols);
+ pdblImgRet = (double**)malloc(sizeof(double*) * iRows * iCols);
+
+ for(i = 0 ; i < iRows * iCols ; i++)
+ {
+ pdblReal[i] = (double*)malloc(sizeof(double) * piCoeff[i]);
+ pdblImg[i] = (double*)malloc(sizeof(double) * piCoeff[i]);
+ pdblRealRet[i] = (double*)malloc(sizeof(double) * piCoeff[i]);
+ pdblImgRet[i] = (double*)malloc(sizeof(double) * piCoeff[i]);
+ }
+
+ sciErr = getComplexMatrixOfPoly(pvApiCtx, _piAddress, &iRows, &iCols, piCoeff, pdblReal, pdblImg);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ for(i = 0 ; i < iRows * iCols ; i++)
+ {
+ for(j = 0 ; j < piCoeff[i] ; j++)
+ {
+ pdblRealRet[i][j] = dceils(pdblReal[i][j]);
+ pdblImgRet[i][j] = dceils(pdblImg[i][j]);
+ }
+ }
+
+ sciErr = createComplexMatrixOfPoly(pvApiCtx, Rhs + 1, pstVarName, iRows, iCols, piCoeff, pdblRealRet, pdblImgRet);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ free(piCoeff);
+
+ for(i = 0 ; i < iRows * iCols ; i++)
+ {
+ free(pdblReal[i]);
+ free(pdblRealRet[i]);
+ }
+ free(pdblReal);
+ free(pdblRealRet);
+
+ if(isVarComplex(pvApiCtx, _piAddress))
+ {
+ for(i = 0 ; i < iRows * iCols ; i++)
+ {
+ free(pdblImg[i]);
+ free(pdblImgRet[i]);
+ }
+ free(pdblImg);
+ free(pdblImgRet);
+ }
+ }
+ else
+ {
+ sciErr = getMatrixOfPoly(pvApiCtx, _piAddress, &iRows, &iCols, NULL, NULL);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ piCoeff = (int*)malloc(iRows * iCols * sizeof(int));
+ sciErr = getMatrixOfPoly(pvApiCtx, _piAddress, &iRows, &iCols, piCoeff, NULL);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ pdblReal = (double**)malloc(sizeof(double*) * iRows * iCols);
+ pdblRealRet = (double**)malloc(sizeof(double*) * iRows * iCols);
+
+ for(i = 0 ; i < iRows * iCols ; i++)
+ {
+ pdblReal[i] = (double*)malloc(sizeof(double) * piCoeff[i]);
+ pdblRealRet[i] = (double*)malloc(sizeof(double) * piCoeff[i]);
+ }
+
+ sciErr = getMatrixOfPoly(pvApiCtx, _piAddress, &iRows, &iCols, piCoeff, pdblReal);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ for(i = 0 ; i < iRows * iCols ; i++)
+ {
+ for(j = 0 ; j < piCoeff[i] ; j++)
+ {
+ pdblRealRet[i][j] = dceils(pdblReal[i][j]);
+ }
+ }
+
+ sciErr = createMatrixOfPoly(pvApiCtx, Rhs + 1, pstVarName, iRows, iCols, piCoeff, pdblRealRet);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ free(piCoeff);
+
+ for(i = 0 ; i < iRows * iCols ; i++)
+ {
+ free(pdblReal[i]);
+ free(pdblRealRet[i]);
+ }
+ free(pdblReal);
+ free(pdblRealRet);
+ }
+
+ LhsVar(1) = Rhs + 1;
+ return sciErr;
+}
+
+SciErr ceil_int(int* _piAddress)
+{//No change for integer
+ SciErr sciErr;
+ LhsVar(1) = 1;
+ return sciErr;
+}
/*--------------------------------------------------------------------------*/
* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
*
*/
-/*--------------------------------------------------------------------------*/
-#include "gw_elementary_functions.h"
-/*--------------------------------------------------------------------------*/
-extern int C2F(intclean)(int *id);
/*--------------------------------------------------------------------------*/
-int sci_clean(char *fname,unsigned long fname_len)
+#include "gw_elementary_functions.h"
+#include "stack-c.h"
+#include "basic_functions.h"
+#include "api_scilab.h"
+#include "Scierror.h"
+
+
+/*Some call to other module ( polynomial et sparse*/
+extern int sci_cleanp(char *fname,unsigned long fname_len);
- extern int C2F(sci_spclean) (char *fname,unsigned long fname_len);
++extern int sci_spclean (char *fname,unsigned long fname_len);
+extern int C2F(ref2val) (void);
+extern double C2F(dasum)();
+
+SciErr clean_double(int* _piAddress);
+int clean_poly(int* _piAddress);
+int clean_sparse(int* _piAddress);
+
- int C2F(sci_clean) (char *fname,unsigned long fname_len)
++int sci_clean (char *fname,unsigned long fname_len)
+{
+ SciErr sciErr;
+
+ int* piAddr1 = NULL;
+ int iType = 0;
+
+ CheckRhs(1,3);
+ CheckLhs(1,1);
+
+ sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr1);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ sciErr = getVarType(pvApiCtx, piAddr1, &iType);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ switch(iType)
+ {
+ case sci_matrix :
+ sciErr = clean_double(piAddr1);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ PutLhsVar();
+ break;
+ case sci_poly :
+ clean_poly(piAddr1);
+ break;
+ case sci_sparse :
+ clean_sparse(piAddr1);
+ break;
+ default :
+ OverLoad(1);
+ return 0;
+ }
+
+ return 0;
+}
+
+int clean_poly(int* _piAddress)
+{
+ sci_cleanp("clean", 5);
+ return 0;
+}
+
+int clean_sparse(int* _piAddress)
{
- static int id[6];
- C2F(intclean)(id);
+ C2F(ref2val)();
- C2F(sci_spclean)("clean", 5);
++ sci_spclean("clean", 5);
return 0;
}
+
+SciErr clean_double(int* _piAddress)
+{
+ SciErr sciErr;
+ int i;
+
+ int iRows1 = 0;
+ int iCols1 = 0;
+ double *pdblReal1 = NULL;
+ double *pdblImg1 = NULL;
+
+ int iRows2 = 0;
+ int iCols2 = 0;
+ double *pdblReal2 = NULL;
+
+ int iRows3 = 0;
+ int iCols3 = 0;
+ double *pdblReal3 = NULL;
+
+ double *pdblRealRet = NULL;
+ double *pdblImgRet = NULL;
+
+ double dblEpsR = 1E-10;
+ double dblEpsA = 1E-10;
+ double dblEps = 0;
+ double dblNorm = 0;
+
+ int* piAddr2 = NULL;
+ int* piAddr3 = NULL;
+
+ if(Rhs == 3)
+ {
+ sciErr = getVarAddressFromPosition(pvApiCtx, 3, &piAddr3);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ sciErr = getMatrixOfDouble(pvApiCtx, piAddr3, &iRows3, &iCols3, &pdblReal3);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ if(iRows3 != 1 || iCols3 != 1)
+ {
+ SciError(60);
+ return sciErr;
+ }
+ dblEpsR = pdblReal3[0];
+ }
+
+ if(Rhs >= 2)
+ {
+ sciErr = getVarAddressFromPosition(pvApiCtx, 2, &piAddr2);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ sciErr = getMatrixOfDouble(pvApiCtx, piAddr2, &iRows2, &iCols2, &pdblReal2);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ if(iRows2 != 1 || iCols2 != 1)
+ {
+ SciError(60);
+ return sciErr;
+ }
+ dblEpsA = pdblReal2[0];
+ }
+
+ if(isVarComplex(pvApiCtx, _piAddress))
+ {
+ sciErr = getComplexMatrixOfDouble(pvApiCtx, _piAddress, &iRows1, &iCols1, &pdblReal1, &pdblImg1);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+
+ dblNorm = wasums(iRows1 * iCols1, pdblReal1, pdblImg1);
+
+ sciErr = allocComplexMatrixOfDouble(pvApiCtx, Rhs + 1, iRows1, iCols1, &pdblRealRet, &pdblImgRet);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+
+ dblEps = Max(dblEpsA, dblEpsR * dblNorm);
+ for(i = 0 ; i < iRows1 * iCols1 ; i++)
+ {
+ pdblRealRet[i] = dabss(pdblReal1[i]) <= dblEps ? 0 : pdblReal1[i];
+ pdblImgRet[i] = dabss(pdblImg1[i]) <= dblEps ? 0 : pdblImg1[i];
+ }
+ }
+ else
+ {
+ int iOne = 1;
+ int iSize1 = 0;
+
+ sciErr = getMatrixOfDouble(pvApiCtx, _piAddress, &iRows1, &iCols1, &pdblReal1);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+
+ iSize1 = iRows1 * iCols1;
+ dblNorm = C2F(dasum)(&iSize1, pdblReal1, &iOne);
+
+ dblEps = Max(dblEpsA, dblEpsR * dblNorm);
+ sciErr = allocMatrixOfDouble(pvApiCtx, Rhs + 1, iRows1, iCols1, &pdblRealRet);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+
+ for(i = 0 ; i < iRows1 * iCols1 ; i++)
+ {
+ pdblRealRet[i] = dabss(pdblReal1[i]) <= dblEps ? 0 : pdblReal1[i];
+ }
+ }
+
+ LhsVar(1) = Rhs + 1;
+ return sciErr;
+}
/*--------------------------------------------------------------------------*/
/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2006 - INRIA - Allan CORNET
- *
- * 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 "gw_elementary_functions.h"
-/*--------------------------------------------------------------------------*/
-extern int C2F(intconj)(int *id);
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2006 - INRIA - Allan CORNET
+*
+* 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 "gw_elementary_functions.h"
+#include "stack-c.h"
+#include "basic_functions.h"
+#include "api_scilab.h"
+
+extern int C2F(dscal)();
+
+SciErr conj_double(int* _piAddress);
+SciErr conj_poly(int* _piAddress);
+
- int C2F(sci_conj) (char *fname,unsigned long fname_len)
+ int sci_conj(char *fname,unsigned long fname_len)
{
- static int id[6];
- C2F(intconj)(id);
+ SciErr sciErr;
+ int iType = 0;
+ int* piAddr = NULL;
+
+ CheckRhs(1,1);
+ CheckLhs(1,1);
+
+ sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ sciErr = getVarType(pvApiCtx, piAddr, &iType);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ switch(iType)
+ {
+ case sci_matrix :
+ sciErr = conj_double(piAddr);
+ break;
+ case sci_poly :
+ sciErr = conj_poly(piAddr);
+ break;
+ default :
+ OverLoad(1);
+ return 0;
+ }
+
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ LhsVar(1) = Rhs + 1;
+ PutLhsVar();
return 0;
}
+
+SciErr conj_double(int* _piAddress)
+{
+ SciErr sciErr;
+ int iRows = 0;
+ int iCols = 0;
+ double *pdblReal = NULL;
+ double *pdblImg = NULL;
+ double *pdblRealRet = NULL;
+ double *pdblImgRet = NULL;
+
+ int iOne = 1;
+ int iSize = 0;
+ double dblCoef = -1;
+
+ if(isVarComplex(pvApiCtx, _piAddress))
+ {
+ sciErr = getComplexMatrixOfDouble(pvApiCtx, _piAddress, &iRows, &iCols, &pdblReal, &pdblImg);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ iSize = iRows * iCols;
+
+ sciErr = allocComplexMatrixOfDouble(pvApiCtx, Rhs + 1, iRows, iCols, &pdblRealRet, &pdblImgRet);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ memcpy(pdblRealRet, pdblReal, iSize * sizeof(double));
+ memcpy(pdblImgRet, pdblImg, iSize * sizeof(double));
+
+ C2F(dscal)(&iSize, &dblCoef, pdblImgRet, &iOne);
+ }
+ else
+ {//do nothing, just copy in a new variable
+ sciErr = getMatrixOfDouble(pvApiCtx, _piAddress, &iRows, &iCols, &pdblReal);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ sciErr = createMatrixOfDouble(pvApiCtx, Rhs + 1, iRows, iCols, pdblReal);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+ }
+ return sciErr;
+}
+
+SciErr conj_poly(int* _piAddress)
+{
+ SciErr sciErr;
+ int i;
+ int iRows = 0;
+ int iCols = 0;
+ int *piCoeff = NULL;
+ double** pdblReal = NULL;
+ double** pdblImg = NULL;
+ double** pdblRealRet = NULL;
+ double** pdblImgRet = NULL;
+ char pstVarName[16];
+
+ int iOne = 1;
+ int iSize = 0;
+ double dblCoef = -1;
+
+ if(isVarComplex(pvApiCtx, _piAddress))
+ {
+ sciErr = getComplexMatrixOfPoly(pvApiCtx, _piAddress, &iRows, &iCols, NULL, NULL, NULL);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ piCoeff = (int*)malloc(iRows * iCols * sizeof(int));
+ sciErr = getComplexMatrixOfPoly(pvApiCtx, _piAddress, &iRows, &iCols, piCoeff, NULL, NULL);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ pdblReal = (double**)malloc(sizeof(double*) * iRows * iCols);
+ pdblImg = (double**)malloc(sizeof(double*) * iRows * iCols);
+ pdblRealRet = (double**)malloc(sizeof(double*) * iRows * iCols);
+ pdblImgRet = (double**)malloc(sizeof(double*) * iRows * iCols);
+
+ for(i = 0 ; i < iRows * iCols ; i++)
+ {
+ pdblReal[i] = (double*)malloc(sizeof(double) * piCoeff[i]);
+ pdblImg[i] = (double*)malloc(sizeof(double) * piCoeff[i]);
+ pdblRealRet[i] = (double*)malloc(sizeof(double) * piCoeff[i]);
+ pdblImgRet[i] = (double*)malloc(sizeof(double) * piCoeff[i]);
+ }
+
+ sciErr = getComplexMatrixOfPoly(pvApiCtx, _piAddress, &iRows, &iCols, piCoeff, pdblReal, pdblImg);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ for(i = 0 ; i < iRows * iCols ; i++)
+ {
+ memcpy(pdblRealRet[i], pdblReal[i], piCoeff[i] * sizeof(double));
+ memcpy(pdblImgRet[i], pdblImg[i], piCoeff[i] * sizeof(double));
+ C2F(dscal)(&piCoeff[i], &dblCoef, pdblImgRet[i], &iOne);
+ }
+
+ sciErr = createComplexMatrixOfPoly(pvApiCtx, Rhs + 1, pstVarName, iRows, iCols, piCoeff, pdblRealRet, pdblImgRet);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+ }
+ else
+ {
+ sciErr = getMatrixOfPoly(pvApiCtx, _piAddress, &iRows, &iCols, NULL, NULL);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ piCoeff = (int*)malloc(iRows * iCols * sizeof(int));
+ sciErr = getMatrixOfPoly(pvApiCtx, _piAddress, &iRows, &iCols, piCoeff, NULL);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ pdblReal = (double**)malloc(sizeof(double*) * iRows * iCols);
+ for(i = 0 ; i < iRows * iCols ; i++)
+ {
+ pdblReal[i] = (double*)malloc(sizeof(double) * piCoeff[i]);
+ }
+
+ sciErr = getMatrixOfPoly(pvApiCtx, _piAddress, &iRows, &iCols, piCoeff, pdblReal);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ sciErr = createMatrixOfPoly(pvApiCtx, Rhs + 1, pstVarName, iRows, iCols, piCoeff, pdblReal);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+ }
+
+ //free memory
+ free(piCoeff);
+
+ for(i = 0 ; i < iRows * iCols ; i++)
+ {
+ free(pdblReal[i]);
+ }
+ free(pdblReal);
+
+ if(isVarComplex(pvApiCtx, _piAddress))
+ {
+ for(i = 0 ; i < iRows * iCols ; i++)
+ {
+ free(pdblRealRet[i]);
+ free(pdblImg[i]);
+ free(pdblImgRet[i]);
+ }
+ free(pdblRealRet);
+ free(pdblImg);
+ free(pdblImgRet);
+ }
+ return sciErr;
+}
/*--------------------------------------------------------------------------*/
* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
*
*/
-/*--------------------------------------------------------------------------*/
-#include "gw_elementary_functions.h"
/*--------------------------------------------------------------------------*/
-extern int C2F(intcos)(int *id);
+#include "gw_elementary_functions.h"
+#include "stack-c.h"
+#include "basic_functions.h"
+#include "api_scilab.h"
/*--------------------------------------------------------------------------*/
-
- int C2F(sci_cos) (char *fname,unsigned long fname_len)
+ int sci_cos(char *fname,unsigned long fname_len)
{
- static int id[6];
- C2F(intcos)(id);
+ SciErr sciErr;
+ int i;
+ int iRows = 0;
+ int iCols = 0;
+ int iType = 0;
+ int* piAddr = NULL;
+
+ double *pdblReal = NULL;
+ double *pdblImg = NULL;
+ double *pdblRealRet = NULL;
+ double *pdblImgRet = NULL;
+
+ CheckRhs(1,1);
+ CheckLhs(1,1);
+
+ sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ sciErr = getVarType(pvApiCtx, piAddr, &iType);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ if(iType != sci_matrix)
+ {
+ OverLoad(1);
+ return 0;
+ }
+
+ if(isVarComplex(pvApiCtx, piAddr))
+ {
+ sciErr = getComplexMatrixOfDouble(pvApiCtx, piAddr, &iRows, &iCols, &pdblReal, &pdblImg);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ sciErr = allocComplexMatrixOfDouble(pvApiCtx, Rhs + 1, iRows, iCols, &pdblRealRet, &pdblImgRet);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ for(i = 0 ; i < iCols * iRows ; i++)
+ {
+ zcoss(pdblReal[i], pdblImg[i], &pdblRealRet[i], &pdblImgRet[i]);
+ }
+ }
+ else
+ {
+ sciErr = getMatrixOfDouble(pvApiCtx, piAddr, &iRows, &iCols, &pdblReal);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ sciErr = allocMatrixOfDouble(pvApiCtx, Rhs + 1, iRows, iCols, &pdblRealRet);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ for(i = 0 ; i < iCols * iRows ; i++)
+ {
+ pdblRealRet[i] = dcoss(pdblReal[i]);
+ }
+ }
+
+ LhsVar(1) = Rhs + 1;
+ PutLhsVar();
return 0;
}
/*--------------------------------------------------------------------------*/
/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2006 - INRIA - Allan CORNET
- *
- * 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 "gw_elementary_functions.h"
-/*--------------------------------------------------------------------------*/
-extern int C2F(intcumprod)(int *id);
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2006 - INRIA - Allan CORNET
+*
+* 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 "gw_elementary_functions.h"
+#include "stack-c.h"
+#include "basic_functions.h"
+#include "api_scilab.h"
+#include "Scierror.h"
+
- int C2F(sci_cumprod) (char *fname,unsigned long fname_len)
+ int sci_cumprod(char *fname,unsigned long fname_len)
{
- static int id[6];
- C2F(intcumprod)(id);
+ SciErr sciErr;
+ int i;
+ int iRows = 0;
+ int iCols = 0;
+ int iType = 0;
+ int* piAddr1 = NULL;
+
+ double *pdblReal = NULL;
+ double *pdblImg = NULL;
+ double *pdblRealRet = NULL;
+ double *pdblImgRet = NULL;
+
+ int iMode = 0;
+
+ CheckRhs(1,2);
+ CheckLhs(1,1);
+
+ sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr1);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ sciErr = getVarType(pvApiCtx, piAddr1, &iType);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ if(iType != sci_matrix)
+ {
+ OverLoad(1);
+ return 0;
+ }
+
+ if(Rhs == 2)
+ {
+ sciErr = getProcessMode(pvApiCtx, 2, piAddr1, &iMode);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ }
+
+ if(isVarComplex(pvApiCtx, piAddr1))
+ {
+ sciErr = getComplexMatrixOfDouble(pvApiCtx, piAddr1, &iRows, &iCols, &pdblReal, &pdblImg);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ sciErr = allocComplexMatrixOfDouble(pvApiCtx, Rhs + 1, iRows, iCols, &pdblRealRet, &pdblImgRet);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ /*Set the first column of returned matrix at the same value of the input matrix*/
+ memcpy(pdblRealRet, pdblReal, iRows * sizeof(double));
+ memcpy(pdblImgRet, pdblImg, iRows * sizeof(double));
+
+ if(iMode == BY_ROWS)
+ {
+ for(i = 0 ; i < iCols ; i++)
+ {
+ vCuproi(iRows, pdblReal + iRows * i, pdblImg + iRows * i, pdblRealRet + iRows * i, pdblImgRet + iRows * i);
+ }
+ }
+ else if(iMode == BY_COLS)
+ {
+ int iOffset = 0;
+
+ for(i = 0 ; i < iCols - 1; i++)
+ {
+ vWvmul(
+ iRows, pdblRealRet + iOffset,
+ pdblImgRet + iOffset,
+ pdblReal + iOffset + iRows,
+ pdblImg + iOffset + iRows,
+ 1, 1,
+ pdblRealRet + iOffset + iRows,
+ pdblImgRet + iOffset + iRows);
+ iOffset += iRows;
+ }
+ }
+ else if(iMode == BY_ALL)
+ {
+ vCuproi(iRows * iCols, pdblReal, pdblImg, pdblRealRet, pdblImgRet);
+ }
+ else
+ {
+ SciError(44);
+ return 2;
+ }
+ }
+ else
+ {
+ sciErr = getMatrixOfDouble(pvApiCtx, piAddr1, &iRows, &iCols, &pdblReal);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ sciErr = allocMatrixOfDouble(pvApiCtx, Rhs + 1, iRows, iCols, &pdblRealRet);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ memcpy(pdblRealRet, pdblReal, iRows * sizeof(double));
+
+ if(iMode == BY_ROWS)
+ {
+ for(i = 0 ; i < iCols ; i++)
+ {
+ vCupro(iRows, pdblReal + iRows * i, pdblRealRet + iRows * i);
+ }
+ }
+ else if(iMode == BY_COLS)
+ {
+ int iOffset = 0;
+
+ for(i = 0 ; i < iCols - 1; i++)
+ {
+ vDvmul(iRows, pdblRealRet + iOffset, pdblReal + iOffset + iRows, 1, 1, pdblRealRet + iOffset + iRows);
+ iOffset += iRows;
+ }
+ }
+ else if(iMode == BY_ALL)
+ {
+ vCupro(iRows * iCols, pdblReal, pdblRealRet);
+ }
+ else
+ {
+ SciError(44);
+ return 2;
+ }
+ }
+
+ LhsVar(1) = Rhs + 1;
+ PutLhsVar();
return 0;
}
/*--------------------------------------------------------------------------*/
* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
*
*/
-/*--------------------------------------------------------------------------*/
-#include "gw_elementary_functions.h"
/*--------------------------------------------------------------------------*/
-extern int C2F(intcumsum)(int *id);
+#include "gw_elementary_functions.h"
+#include "stack-c.h"
+#include "basic_functions.h"
+#include "api_scilab.h"
+#include "Scierror.h"
+
/*--------------------------------------------------------------------------*/
- int C2F(sci_cumsum) (char *fname,unsigned long fname_len)
+ int sci_cumsum(char *fname,unsigned long fname_len)
{
- static int id[6];
- C2F(intcumsum)(id);
+ SciErr sciErr;
+ int i;
+ int iRows = 0;
+ int iCols = 0;
+ int iType = 0;
+ int* piAddr1 = NULL;
+
+ double *pdblReal = NULL;
+ double *pdblImg = NULL;
+ double *pdblRealRet = NULL;
+ double *pdblImgRet = NULL;
+
+ int iMode = 0;
+
+ CheckRhs(1,2);
+ CheckLhs(1,1);
+
+ sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr1);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ sciErr = getVarType(pvApiCtx, piAddr1, &iType);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ if(iType != sci_matrix)
+ {
+ OverLoad(1);
+ return 0;
+ }
+
+ if(Rhs == 2)
+ {
+ sciErr = getProcessMode(pvApiCtx, 2, piAddr1, &iMode);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ }
+
+ if(isVarComplex(pvApiCtx, piAddr1))
+ {
+ sciErr = getComplexMatrixOfDouble(pvApiCtx, piAddr1, &iRows, &iCols, &pdblReal, &pdblImg);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ sciErr = allocComplexMatrixOfDouble(pvApiCtx, Rhs + 1, iRows, iCols, &pdblRealRet, &pdblImgRet);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ /*Set the first column of returned matrix at the same value of the input matrix*/
+ memcpy(pdblRealRet, pdblReal, iRows * sizeof(double));
+ memcpy(pdblImgRet, pdblImg, iRows * sizeof(double));
+
+ if(iMode == BY_ROWS)
+ {
+ for(i = 0 ; i < iCols ; i++)
+ {
+ vCusum(iRows, pdblReal + iRows * i, pdblRealRet + iRows * i);
+ vCusum(iRows, pdblImg + iRows * i, pdblImgRet + iRows * i);
+ }
+ }
+ else if(iMode == BY_COLS)
+ {
+ int iOffset = 0;
+
+ for(i = 0 ; i < iCols - 1; i++)
+ {
+ vDadd(iRows, pdblRealRet + iOffset, pdblReal + iOffset + iRows, 1, 1, pdblRealRet + iOffset + iRows);
+ vDadd(iRows, pdblImgRet + iOffset, pdblImg + iOffset + iRows, 1, 1, pdblImgRet + iOffset + iRows);
+ iOffset += iRows;
+ }
+ }
+ else if(iMode == BY_ALL)
+ {
+ vCusum(iRows * iCols, pdblReal, pdblRealRet);
+ vCusum(iRows * iCols, pdblImg, pdblImgRet);
+ }
+ else
+ {
+ SciError(44);
+ return 2;
+ }
+ }
+ else
+ {
+ sciErr = getMatrixOfDouble(pvApiCtx, piAddr1, &iRows, &iCols, &pdblReal);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ sciErr = allocMatrixOfDouble(pvApiCtx, Rhs + 1, iRows, iCols, &pdblRealRet);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ memcpy(pdblRealRet, pdblReal, iRows * sizeof(double));
+
+ if(iMode == BY_ROWS)
+ {
+ for(i = 0 ; i < iCols ; i++)
+ {
+ vCusum(iRows, pdblReal + iRows * i, pdblRealRet + iRows * i);
+ }
+ }
+ else if(iMode == BY_COLS)
+ {
+ int iOffset = 0;
+
+ for(i = 0 ; i < iCols - 1; i++)
+ {
+ vDadd(iRows, pdblRealRet + iOffset, pdblReal + iOffset + iRows, 1, 1, pdblRealRet + iOffset + iRows);
+ iOffset += iRows;
+ }
+ }
+ else if(iMode == BY_ALL)
+ {
+ vCusum(iRows * iCols, pdblReal, pdblRealRet);
+ }
+ else
+ {
+ SciError(44);
+ return 2;
+ }
+ }
+
+ LhsVar(1) = Rhs + 1;
+ PutLhsVar();
return 0;
}
/*--------------------------------------------------------------------------*/
/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2006 - INRIA - Allan CORNET
- *
- * 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 "gw_elementary_functions.h"
-/*--------------------------------------------------------------------------*/
-extern int C2F(intdiag)(int *id);
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2006 - INRIA - Allan CORNET
+*
+* 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
+*
+*/
/*--------------------------------------------------------------------------*/
-int sci_diag(char *fname,unsigned long fname_len)
+#include "gw_elementary_functions.h"
+#include "stack-c.h"
+#include "basic_functions.h"
+#include "api_scilab.h"
+#include "Scierror.h"
+
+SciErr getStartPosition(int _iPos, int* _piStartPos);
+
+SciErr diag_double(int* _piAddress, int _iStartPos);
+int diag_poly(int* _piAddress, int _iStartPos);
+
+extern int sci_pdiag(char *fname,unsigned long fname_len);
+
- int C2F(sci_diag) (char *fname,unsigned long fname_len)
++int sci_diag (char *fname,unsigned long fname_len)
+{
+ SciErr sciErr;
+ int iRows = 0;
+ int iCols = 0;
+ int iType = 0;
+
+ int iStartPos = 0;
+ int iMatrixSize = 0;
+
+ int* piAddr = NULL;
+
+ CheckRhs(1,2);
+ CheckLhs(1,1);
+
+ if(Rhs == 2)
+ {
+ sciErr = getStartPosition(2, &iStartPos);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ }
+
+ sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ sciErr = getVarType(pvApiCtx, piAddr, &iType);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ switch(iType)
+ {
+ case sci_matrix :
+ sciErr = diag_double(piAddr, iStartPos);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ break;
+ case sci_poly :
+ if(diag_poly(piAddr, iStartPos))
+ {
+ return 1;
+ }
+ break;
+ default :
+ OverLoad(1);
+ return 0;
+ }
+
+ LhsVar(1) = Rhs + 1;
+ PutLhsVar();
+ return 0;
+}
+
+SciErr diag_double(int* _piAddress, int _iStartPos)
+{
+ SciErr sciErr;
+ int iRows = 0;
+ int iCols = 0;
+ int iMatrixSize = 0;
+
+ double *pdblReal = NULL;
+ double *pdblImg = NULL;
+ double *pdblRealRet = NULL;
+ double *pdblImgRet = NULL;
+
+ if(isVarComplex(pvApiCtx, _piAddress))
+ {
+ sciErr = getComplexMatrixOfDouble(pvApiCtx, _piAddress, &iRows, &iCols, &pdblReal, &pdblImg);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+ }
+ else
+ {
+ sciErr = getMatrixOfDouble(pvApiCtx, _piAddress, &iRows, &iCols, &pdblReal);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+ }
+
+ if(iRows != 1 && iCols != 1)
+ {
+ if(_iStartPos >= 0)
+ iMatrixSize = Max(0, Min(iRows, iCols - _iStartPos));
+ else
+ iMatrixSize = Max(0, Min(iRows + _iStartPos, iCols));
+
+ if(iMatrixSize == 0)
+ {
+ iRows = 0;
+ iCols = 0;
+
+ sciErr = allocMatrixOfDouble(pvApiCtx, Rhs + 1, iRows, iCols, &pdblRealRet);
+ return sciErr;
+ }
+ else
+ {
+ int iIncIn = iRows + 1;
+ int iIncOut = 1;
+ if(isVarComplex(pvApiCtx, _piAddress))
+ {
+ sciErr = allocComplexMatrixOfDouble(pvApiCtx, Rhs + 1, iMatrixSize, 1, &pdblRealRet, &pdblImgRet);
+ }
+ else
+ {
+ sciErr = allocMatrixOfDouble(pvApiCtx, Rhs + 1, iMatrixSize, 1, &pdblRealRet);
+ }
+
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ if(_iStartPos >= 0)
+ {
+ double *pdblStartAddr = pdblReal + _iStartPos * iRows;
+ C2F(unsfdcopy)(&iMatrixSize, pdblStartAddr, &iIncIn, pdblRealRet, &iIncOut);
+
+ if(isVarComplex(pvApiCtx, _piAddress))
+ {
+ pdblStartAddr = pdblImg + _iStartPos * iRows;
+ C2F(unsfdcopy)(&iMatrixSize, pdblStartAddr, &iIncIn, pdblImgRet, &iIncOut);
+ }
+ }
+ else
+ {
+ double *pdblStartAddr = pdblReal - _iStartPos;
+ C2F(unsfdcopy)(&iMatrixSize, pdblStartAddr, &iIncIn, pdblRealRet, &iIncOut);
+
+ if(isVarComplex(pvApiCtx, _piAddress))
+ {
+ pdblStartAddr = pdblImg - _iStartPos;
+ C2F(unsfdcopy)(&iMatrixSize, pdblStartAddr, &iIncIn, pdblImgRet, &iIncOut);
+ }
+ iRows = iMatrixSize;
+ iCols = 1;
+ }
+ return sciErr;
+ }
+ }
+ else
+ {//iRows == 1 || iCols == 1
+ int iIncIn = 1;
+ int iIncOut = 0;
+ int iOriginalSize = iRows * iCols;
+
+ iMatrixSize = Max(iRows, iCols) + (int)dabss(_iStartPos);
+ iIncOut = iMatrixSize + 1;
+
+ if(isVarComplex(pvApiCtx, _piAddress))
+ {
+ sciErr = allocComplexMatrixOfDouble(pvApiCtx, Rhs + 1, iMatrixSize, iMatrixSize, &pdblRealRet, &pdblImgRet);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ memset(pdblImgRet, 0x00, iMatrixSize * iMatrixSize * sizeof(double));
+ }
+ else
+ {
+ sciErr = allocMatrixOfDouble(pvApiCtx, Rhs + 1, iMatrixSize, iMatrixSize, &pdblRealRet);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+ }
+
+ memset(pdblRealRet, 0x00, iMatrixSize * iMatrixSize * sizeof(double));
+
+ if(_iStartPos >= 0)
+ {
+ double *pdblStartAddr = pdblRealRet + iMatrixSize * _iStartPos;
+ C2F(unsfdcopy)(&iOriginalSize, pdblReal, &iIncIn, pdblStartAddr, &iIncOut);
+
+ if(isVarComplex(pvApiCtx, _piAddress))
+ {
+ pdblStartAddr = pdblImgRet + iMatrixSize * _iStartPos;
+ C2F(unsfdcopy)(&iOriginalSize, pdblImg, &iIncIn, pdblStartAddr, &iIncOut);
+ }
+ }
+ else
+ {
+ double *pdblStartAddr = pdblRealRet - _iStartPos;
+ C2F(unsfdcopy)(&iOriginalSize, pdblReal, &iIncIn, pdblStartAddr, &iIncOut);
+
+ if(isVarComplex(pvApiCtx, _piAddress))
+ {
+ pdblStartAddr = pdblImgRet - _iStartPos;
+ C2F(unsfdcopy)(&iOriginalSize, pdblImg, &iIncIn, pdblStartAddr, &iIncOut);
+ }
+ }
+ }
+ return sciErr;
+}
+
+int diag_poly(int* _piAddress, int _iStartPos)
{
- static int id[6];
- C2F(intdiag)(id);
+ sci_pdiag("diag", 4);
return 0;
}
+
+SciErr getStartPosition(int _iPos, int* _piStartPos)
+{
+ SciErr sciErr;
+ int iRows = 0;
+ int iCols = 0;
+ int* piAddr = NULL;
+ double* pdblReal = NULL;
+
+ sciErr = getVarAddressFromPosition(pvApiCtx, _iPos, &piAddr);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ sciErr = getMatrixOfDouble(pvApiCtx, piAddr, &iRows, &iCols, &pdblReal);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ if(iRows != 1 || iCols != 1)
+ {
+ SciError(89);
+ }
+
+ *_piStartPos = (int)pdblReal[0];
+ return sciErr;
+}
/*--------------------------------------------------------------------------*/
* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
*
*/
-/*--------------------------------------------------------------------------*/
-#include "gw_elementary_functions.h"
/*--------------------------------------------------------------------------*/
-extern int C2F(intdsearch)(int *id);
+#include "gw_elementary_functions.h"
+#include "stack-c.h"
+#include "basic_functions.h"
+#include "sciprint.h"
+#include "localization.h"
+#include "api_scilab.h"
+#include "Scierror.h"
+
+static SciErr getMode(int _iPos, char *_pcMode);
+
/*--------------------------------------------------------------------------*/
- int C2F(sci_dsearch) (char *fname,unsigned long fname_len)
-int sci_dsearch(char *fname,unsigned long fname_len)
++int sci_dsearch (char *fname,unsigned long fname_len)
{
- static int id[6];
- C2F(intdsearch)(id);
+ SciErr sciErr;
+ int i;
+
+ int* piAddr1 = NULL;
+ int iRows1 = 0;
+ int iCols1 = 0;
+ int iType1 = 0;
+ double *pdblReal1 = NULL;
+
+ int* piAddr2 = NULL;
+ int iRows2 = 0;
+ int iCols2 = 0;
+ int iType2 = 0;
+ double *pdblReal2 = NULL;
+
+ char cMode = 0;
+
+ int iRowsOcc = 0;
+ int iColsOcc = 0;
+ double *pdblRealOcc = NULL;
+
+ double *pdblRealInfo = NULL;
+ double *pdblRealInd = NULL;
+
+ CheckRhs(2,3);
+ CheckLhs(1,3);
+
+ sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr1);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ sciErr = getVarAddressFromPosition(pvApiCtx, 2, &piAddr2);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ sciErr = getVarType(pvApiCtx, piAddr1, &iType1);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ sciErr = getVarType(pvApiCtx, piAddr2, &iType2);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ if(iType1 != sci_matrix || iType2 != sci_matrix)
+ {
+ OverLoad(1);
+ return 0;
+ }
+
+ //get ch
+ if(Rhs == 3)
+ {
+ sciErr = getMode(3, &cMode);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ }
+ else
+ {
+ cMode = 'c';
+ }
+
+ if(cMode != 'c' && cMode != 'd')
+ {
+ sciprint(_("%s: unknown char specifier (must be ''c'' or ''d'').\n"), fname);
+ SciError(999);
+ return 0;
+ }
+
+ if(isVarComplex(pvApiCtx, piAddr1) || isVarComplex(pvApiCtx, piAddr2))
+ {
+ SciError(202);
+ return 0;
+ }
+ else
+ {
+ sciErr = getMatrixOfDouble(pvApiCtx, piAddr2, &iRows2, &iCols2, &pdblReal2);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ //verif that val is in strict increasing order
+ for(i = 1 ; i < iRows2 * iCols2 ; i++)
+ {
+ if(pdblReal2[i] < pdblReal2[i - 1])
+ {
+ sciprint(_("%s: the array val (arg 2) is not well ordered.\n"), fname);
+ SciError(999);
+ return 0;
+ }
+ }
+ }
+
+ iRowsOcc = iRows2;
+ iColsOcc = iCols2;
+ if(cMode == 'd')
+ {
+ if( iRowsOcc * iColsOcc < 1)
+ {
+ sciprint(_("%s: Argument 2: argument 2 must not be an empty vector.\n"), fname);
+ SciError(999);
+ return 0;
+ }
+ }
+ else
+ {// cMode == 'c'
+ if( iRowsOcc * iColsOcc < 2)
+ {
+ sciprint(_("%s: in the interval case, argument 2 must be a vector with length > 1.\n"), fname);
+ SciError(999);
+ return 0;
+ }
+ if(iRowsOcc == 1)
+ {
+ iColsOcc--;
+ }
+ else
+ {
+ iRowsOcc--;
+ }
+ }
+
+ //Get X
+ sciErr = getMatrixOfDouble(pvApiCtx, piAddr1, &iRows1, &iCols1, &pdblReal1);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ if(Lhs >= 1)
+ {
+ sciErr = allocMatrixOfDouble(pvApiCtx, Rhs + 1, iRows1, iCols1, &pdblRealInd);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ }
+
+ if(Lhs >= 2)
+ {
+ sciErr = allocMatrixOfDouble(pvApiCtx, Rhs + 2, iRowsOcc, iColsOcc, &pdblRealOcc);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ }
+
+ if(Lhs >= 3)
+ {
+ sciErr = allocMatrixOfDouble(pvApiCtx, Rhs + 3, 1, 1, &pdblRealInfo);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ }
+
+ if(iRows1 == 0 || iCols1 == 0)
+ {
+ pdblRealInfo[0] = 0;
+ if(Lhs >= 2)
+ {
+ memset(pdblRealOcc, 0x00, iRowsOcc * iColsOcc * sizeof(double));
+ }
+ }
+ else
+ {
+ //go on for the computation
+ if(cMode == 'c')
+ {
+ vDsearchC(pdblReal1, iRows1 * iCols1, pdblReal2, iRows2 * iCols2 - 1, pdblRealInd, pdblRealOcc, pdblRealInfo);
+ }
+ else
+ {
+ vDsearchD(pdblReal1, iRows1 * iCols1, pdblReal2, iRows2 * iCols2, pdblRealInd, pdblRealOcc, pdblRealInfo);
+ }
+ }
+
+ if(Lhs >= 1)
+ {
+ LhsVar(1) = Rhs + 1;
+ }
+
+ if(Lhs >= 2)
+ {
+ LhsVar(2) = Rhs + 2;
+ }
+
+ if(Lhs >= 3)
+ {
+ LhsVar(3) = Rhs + 3;
+ }
+
+ PutLhsVar();
return 0;
}
+
+static SciErr getMode(int _iPos, char *_pcMode)
+{
+ SciErr sciErr;
+ int iRows = 0;
+ int iCols = 0;
+ int iMode = 0;
+ int* piAddr = NULL;
+
+ int iLen = 0;
+ char pstMode[1][2] = {""};
+
+ sciErr = getVarAddressFromPosition(pvApiCtx, _iPos, &piAddr);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+
+ sciErr = getVarDimension(pvApiCtx, piAddr, &iRows, &iCols);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ if(iRows == 1 && iCols == 1)
+ {
+ sciErr = getMatrixOfString(pvApiCtx, piAddr, &iRows, &iCols, &iLen, (char**)pstMode);
+ if(sciErr.iErr)
+ {
+ return sciErr;
+ }
+
+ *_pcMode = pstMode[0][0];
+ }
+ else
+ {
+ SciError(89);
+ }
+ return sciErr;
+}
/*--------------------------------------------------------------------------*/
* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
*
*/
-/*--------------------------------------------------------------------------*/
-#include "gw_elementary_functions.h"
/*--------------------------------------------------------------------------*/
-extern int C2F(intexp)(int *id);
+#include "gw_elementary_functions.h"
+#include "stack-c.h"
+#include "basic_functions.h"
+#include "api_scilab.h"
-
- int C2F(sci_exp) (char *fname,unsigned long fname_len)
+ /*--------------------------------------------------------------------------*/
+ int sci_exp(char *fname,unsigned long fname_len)
{
- static int id[6];
- C2F(intexp)(id);
+ SciErr sciErr;
+ int i;
+ int iRows = 0;
+ int iCols = 0;
+ int iType = 0;
+
+ int* piAddr = NULL;
+
+ double *pdblReal = NULL;
+ double *pdblImg = NULL;
+ double *pdblRealRet = NULL;
+ double *pdblImgRet = NULL;
+
+ CheckRhs(1,1);
+ CheckLhs(1,1);
+
+ sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ sciErr = getVarType(pvApiCtx, piAddr, &iType);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ if(iType != sci_matrix)
+ {
+ OverLoad(1);
+ return 0;
+ }
+
+ if(isVarComplex(pvApiCtx, piAddr))
+ {
+ sciErr = getComplexMatrixOfDouble(pvApiCtx, piAddr, &iRows, &iCols, &pdblReal, &pdblImg);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ sciErr = allocComplexMatrixOfDouble(pvApiCtx, Rhs + 1, iRows, iCols, &pdblRealRet, &pdblImgRet);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ for(i = 0 ; i < iRows * iCols ; i++)
+ {
+ zexps(pdblReal[i], pdblImg[i], &pdblRealRet[i], &pdblImgRet[i]);
+ }
+ }
+ else
+ {
+ sciErr = getMatrixOfDouble(pvApiCtx, piAddr, &iRows, &iCols, &pdblReal);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ sciErr = allocMatrixOfDouble(pvApiCtx, Rhs + 1, iRows, iCols, &pdblRealRet);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ for(i = 0 ; i < iCols * iRows ; i++)
+ {
+ pdblRealRet[i] = dexps(pdblReal[i]);
+ }
+ }
+
+ LhsVar(1) = Rhs + 1;
+ PutLhsVar();
return 0;
}
/*--------------------------------------------------------------------------*/
#endif
-extern int C2F(intexpm)(int *id);
/*--------------------------------------------------------------------------*/
-int sci_expm(char *fname,unsigned long fname_len)
+void vSwitchVal(double *_pdblVal, int _iPos1, int _iPos2);
+
+void vExchangeVal(double *_pdblScale, double *_pdblVal,
+ int _iStart1, int _iEnd1,
+ int _iStart2, int _iEnd2,
+ int _iSize, int _iCoord1, int _iCoord2);
+
+int dexpms(int _iLeadDim, int _iSize, double *_pdblVal, double *_pdblReturn);
+
+int dbalancs(int _iRows, int _iSize, double *_pdblVal,
+ int *_piLow, int *_piHigh, double *_pdblScale);
+
+int dbdiaga(int _iLeadDim, int _iSize, double *_pdblVal, double _dblEps,
+ double _dblMax, double *_pdblEigenReal, double *_pdblEigenImg,
+ int *_piBlockStruc, double *_pdblRightReduce,
+ double *_pdblInvRightReduce, double *_pdblScale, int _iMode);
+
+int dorthess( int _iLead, int _iSize, int _iLow, int _iHigh,
+ double *_pdblVal, double *_pdblOrt);
+
+int dortrans( int _iLead, int _iSize, int _iLow, int _iHigh,
+ double *_pdblVal, double *_pdblOrt, double *_pdblTrans);
+
+int dhqror2s(int _iLead, int _iSize, int _iLow, int _iHigh,
+ double *_pdblHessUp, double *_pdblEigenReal,
+ double *_pdblEigenImg, double *_pdblTrans, int _iMode);
+int dpades(double *_pdblVal, int _iLeadDimIn, int _iSize,
+ double *_pdblExp, int _iLeadDimOut, double *_pdblAlpha,
+ double *_pdblWS, int *_piWS);
+
+void ddmmuls(double *_pdblA, int _iLeadDimA,
+ double *_pdblB, int _iLeadDimB,
+ double *_pdblOut, int _iLeadDimOut,
+ int _iRowsA, int _iColsA, int _iColsB);
+
+int dexchs(int _iMax, int _iLeadDim, double *_pdblIn, double *_pdblOut,
+ int _iPos, int _iSize1, int _iSize2);
+
+int dgivs(double _dblA, double _dblB, double *_pdblSC, double *_pdblSS);
+
+int dsplits(double *_pdblVal, double *_pdblSplit, int _iSize, int _iPos,
+ double *_pdblE1, double *_pdblE2, int _iSizeVal, int _iSizeSplit);
+
+double dblGetMatrixInfiniteNorm(double *_pdblReal, double *_pdblImg, int _iRows, int _iCols);
+int dexpms2(double *_pdblReal, double *_pdblReturnReal, int _iLeadDim);
+int zexpms2(double *_pdblReal, double *_pdblImg, double *_pdblReturnReal, double *_pdblReturnImg, int _iLeadDim);
+
+
+extern int C2F(split)();
+extern int C2F(exch)();
+extern int C2F(shrslv)();
+extern int C2F(balbak)();
+extern double C2F(ddot)();
+extern int C2F(pade)();
+extern int C2F(dcopy)();
+extern int C2F(dscal)();
+
+extern int C2F(dgeco)();
+extern int C2F(dgesl)();
+extern int C2F(coef)();
+extern int C2F(cerr)();
+extern int C2F(dclmat)();
+extern int C2F(dexpm1)();
+extern int C2F(wexpm1)();
+extern int C2F(drot)();
+
+/*--------------------------------------------------------------------------*/
- int C2F(sci_expm) (char *fname,unsigned long fname_len)
++int sci_expm (char *fname,unsigned long fname_len)
{
- static int id[6];
- C2F(intexpm)(id);
+ SciErr sciErr;
+ int iRet = 0;
+ int iRows = 0;
+ int iCols = 0;
+ int iType = 0;
+
+ double *pdblReal = NULL;
+ double *pdblImg = NULL;
+
+ int* piAddr = NULL;
+
+ double *pdblRealRet = NULL;
+ double *pdblImgRet = NULL;
+
+ CheckLhs(1,1);
+ CheckRhs(1,1);
+
+ sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ sciErr = getVarType(pvApiCtx, piAddr, &iType);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ if(iType != sci_matrix)
+ {
+ OverLoad(1);
+ return 0;
+ }
+
+ if(isVarComplex(pvApiCtx, piAddr))
+ {
+ sciErr = getComplexMatrixOfDouble(pvApiCtx, piAddr, &iRows, &iCols, &pdblReal, &pdblImg);
+ }
+ else
+ {
+ sciErr = getMatrixOfDouble(pvApiCtx, piAddr, &iRows, &iCols, &pdblReal);
+ }
+
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ if(iRows * iCols == 0)
+ {
+ sciErr = allocMatrixOfDouble(pvApiCtx, Rhs + 1, 0, 0, &pdblRealRet);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ LhsVar(1) = Rhs + 1;
+ PutLhsVar();
+ return 0;
+ }
+
+ if(iRows != iCols)
+ {
+ SciError(2);
+ return 0;
+ }
+
+ if(isVarComplex(pvApiCtx, piAddr))
+ {
+ sciErr = allocComplexMatrixOfDouble(pvApiCtx, Rhs + 1, iRows, iCols, &pdblRealRet, &pdblImgRet);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ iRet = zexpms2(pdblReal, pdblImg, pdblRealRet, pdblImgRet, iCols);
+ if(iRet)
+ {
+ return 1;
+ }
+ }
+ else
+ {
+ sciErr = allocMatrixOfDouble(pvApiCtx, Rhs + 1, iRows, iCols, &pdblRealRet);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ iRet = dexpms2(pdblReal, pdblRealRet, iCols);
+ if(iRet)
+ {
+ return 1;
+ }
+ }
+
+ LhsVar(1) = Rhs + 1;
+ PutLhsVar();
return 0;
}
-/*--------------------------------------------------------------------------*/
+
+/*
+purpose
+ compute the exponential of a matrix a by the pade's
+ approximants(subroutine pade).a block diagonalization
+ is performed prior call pade.
+calling sequence
+ subroutine dexpm1(ia,n,a,ea,iea,w,iw,ierr)
+
+ integer ia,n,iw,ierr
+ double precision a,ea,w
+ dimension a(ia,n),ea(iea,n),w(*),iw(*)
+
+ ia: the leading dimension of array a.
+ n: the order of the matrices a,ea,x,xi .
+ a: the real double precision array that contains the n*n matrix a
+ ea: the array that contains the n*n exponential of a.
+ iea : the leading dimension of array ea
+ w : work space array of size: n*(2*ia+2*n+5)
+ iw : integer work space array of size 2*n
+ ierr: =0 if the prosessus is normal.
+ =-1 if n>ia.
+ =-2 if the block diagonalization is not possible.
+ =-4 if the subroutine dpade can not computes exp(a)
+*/
+int dexpms(int _iLeadDim, int _iSize, double *_pdblVal, double *_pdblReturn)
+{
+ int iErr = 0;
+ int iScal = 1;
+ int iIndex1 = 0;
+ int iIndex2 = 0;
+ int iIndex4 = 0;
+ int iIndex5 = 0;
+ int iIndex6 = 0;
+ int *piWS = NULL;
+
+ int iEigenReal = 0, iEigenImg = 0;
+ int iBlockStruc = 0, iRightReduce = 0;
+ int iInvRightReduce = 0, iScale = 0;
+ int iiPadeWS = 0, idblPadeWS = 0;
+
+ double *pdblWS = NULL;
+ double dblANorm = 0;
+
+ /*global static variable, used to initialization*/
+ sdblExpmN = -1;
+
+ for(iIndex1 = 0 ; iIndex1 < _iSize ; iIndex1++)
+ {
+ double dblAlpha = 0;
+ for(iIndex2 = 0 ; iIndex2 < _iSize ; iIndex2++)
+ {
+ dblAlpha += dabss(_pdblVal[iIndex2 + _iSize * iIndex1]);
+ }
+ if(dblAlpha > dblANorm)
+ dblANorm = dblAlpha;
+ }
+
+ if(dblANorm == 0)
+ {
+ for(iIndex1 = 0 ; iIndex1 < _iSize ; iIndex1++)
+ {
+ _pdblReturn[iIndex1] = 0;
+ _pdblReturn[iIndex1 + iIndex1 * _iSize] = 1;
+ }
+ return 0;
+ }
+
+ piWS = (int*)malloc(_iSize * _iSize * sizeof(int));
+ pdblWS = (double*)malloc(sizeof(double) * (_iSize * (4 * _iSize + 5)));
+
+ iScale = 0;
+ iRightReduce = _iSize;
+ iInvRightReduce = iRightReduce + _iLeadDim * _iSize;
+ iEigenReal = iInvRightReduce + _iLeadDim * _iSize;
+ iEigenImg = iEigenReal + _iSize;
+ idblPadeWS = iEigenImg + _iSize;
+
+ iBlockStruc = 0;
+ iiPadeWS = iBlockStruc + _iSize;
+
+ dblANorm = Max(dblANorm, 1);
+ iErr = dbdiaga(_iLeadDim, _iSize, _pdblVal, 0, dblANorm,
+ &pdblWS[iEigenReal], &pdblWS[iEigenImg], &piWS[iBlockStruc],
+ &pdblWS[iRightReduce], &pdblWS[iInvRightReduce], &pdblWS[iScale], 1);
+
+ if(iErr)
+ return -2;
+
+ for(iIndex1 = 0 ; iIndex1 < _iSize ; iIndex1++)
+ {
+ vDset(_iSize, 0, &_pdblReturn[iIndex1], _iSize);
+ }
+
+ //compute the pade's approximants of the block.
+ //block origin is shifted before calling pade.
+
+ iIndex1 = 1;
+ iIndex2 = 0;
+
+ //loop on the block.
+ while(iIndex2 <= _iSize)
+ {
+ double dblTemp = 0;
+ double dblAlpha = 0;
+
+ iIndex2 += iIndex1;
+ if(iIndex2 <= _iSize)
+ {
+ iIndex1 = piWS[iBlockStruc + iIndex2 - 1];
+ if(iIndex1 != 1)
+ {
+ iIndex4 = iIndex2 + iIndex1;
+ for(iIndex5 = iIndex2 ; iIndex5 < iIndex4 ; iIndex5++)
+ dblTemp += pdblWS[iEigenReal - 1 + iIndex5];
+ dblTemp /= iIndex1;
+
+ for(iIndex5 = iIndex2 ; iIndex5 < iIndex4 ; iIndex5++)
+ {
+ pdblWS[iEigenReal - 1 + iIndex5] -= dblTemp;
+ _pdblVal[iIndex5 + iIndex5 * _iSize] -= dblTemp;
+ }
+ dblAlpha = 0;
+ for(iIndex5 = iIndex2 ; iIndex5 < iIndex4 ; iIndex5++)
+ {
+ double dblTemp1 = pow(pdblWS[iEigenReal - 1 + iIndex5],2) + pow(pdblWS[iEigenImg - 1 + iIndex5],2);
+ dblTemp1 = dsqrts(dblTemp1);
+ if(dblTemp1 > dblAlpha)
+ dblAlpha = dblTemp1;
+ }
+
+ //call pade subroutine.
+ iErr = dpades(&_pdblVal[iIndex2 + iIndex2 * _iSize], _iSize, iIndex1, &_pdblReturn[iIndex2 + iIndex2 * _iSize],
+ _iSize, &dblAlpha, &pdblWS[idblPadeWS], &piWS[iiPadeWS]);
+/*
+ C2F(pade)(&_pdblVal[iIndex2 + iIndex2 * _iSize], &_iSize, &iIndex1, &_pdblReturn[iIndex2 + iIndex2 * _iSize],
+ &_iSze, &dblAlpha, &pdblWS[idblPadeWS], &piWS[iiPadeWS], &iErr);
+*/
+ if(iErr < 0)
+ return 0;
+
+ //remove the effect of origin shift on the block.
+ dblTemp = dexps(dblTemp);
+ for(iIndex5 = iIndex2 ; iIndex5 < iIndex4 ; iIndex5++)
+ for(iIndex6 = iIndex2 ; iIndex6 < iIndex4 ; iIndex6++)
+ _pdblReturn[iIndex5 + iIndex6 * _iSize] *= dblTemp;
+ }
+ else
+ {
+ _pdblReturn[(iIndex2 - 1) + (iIndex2 - 1) * _iSize] =
+ dexps(_pdblVal[(iIndex2 - 1) + (iIndex2 - 1) * _iSize]);
+ }
+ }
+ }
+
+ //remove the effect of block diagonalization.
+ ddmmuls(&pdblWS[iRightReduce], _iSize, _pdblReturn, _iSize, &pdblWS[idblPadeWS], _iSize, _iSize, _iSize, _iSize);
+ ddmmuls(&pdblWS[idblPadeWS], _iSize, &pdblWS[iInvRightReduce], _iSize, _pdblReturn, _iSize, _iSize, _iSize, _iSize);
+
+ free(piWS);
+ free(pdblWS);
+ return 0;
+}
+
+/*
+purpose
+ dbdiag reduces a matrix a to block diagonal form by first
+ reducing it to quasi-triangular form by hqror2 and then by
+ solving the matrix equation -a11*p+p*a22=a12 to introduce zeros
+ above the diagonal.
+ right transformation is factored : p*d*u*y ;where:
+ p is a permutation matrix and d positive diagonal matrix
+ u is orthogonal and y block upper triangular with identity
+ blocks on the diagonal
+
+ starred parameters are altered by the subroutine
+
+
+ *a an array that initially contains the m x n matrix
+ to be reduced. on return, see job
+
+ lda the leading dimension of array a. and array x,xi.
+ n the order of the matrices a,x,xi
+
+ epsshr the minimal conditionnement allowed for linear sytems
+
+ rmax the maximum size allowed for any element of the
+ transformations.
+
+ *er a singly subscripted real array containing the real
+ parts of the eigenvalues.
+
+ *ei a singly subscripted real array containg the imaginary
+ parts of the eigenvalues.
+
+ *bs a singly subscripted integer array that contains block
+ structure information. if there is a block of order
+ k starting at a(l,l) in the output matrix a, then
+ bs(l) contains the positive integer k, bs(l+1) contains
+ -(k-1), bs(la+2) = -(k-2), ..., bs(l+k-1) = -1.
+ thus a positive integer in the l-th entry of bs
+ indicates a new block of order bs(l) starting at a(l,l).
+
+ *x contains, either right reducing transformation u*y,
+ either orthogonal tranformation u (see job)
+
+ *xi xi contains the inverse reducing matrix transformation
+ or y matrix (see job)
+
+ *scale contains the scale factor and definitions of p size(n)
+
+ job integer parametre specifying outputed transformations
+ job=0 : a contains block diagonal form
+ x right transformation
+ xi dummy variable
+ job=1 : like job=0 and xi contain x**-1
+ job=2 a contains block diagonal form
+ x contains u and xi contain y
+ job=3 : a contains:
+ -block diagonal form in the diagonal blocks
+ -a factorisation of y in the upper triangular
+ x contains u
+ xi dummy
+ *fail a logical variable which is false on normal return and
+ true if there is any error in bdiag.
+*/
+int dbdiaga(int _iLeadDim, int _iSize, double *_pdblVal, double _dblEps,
+ double _dblMax, double *_pdblEigenReal, double *_pdblEigenImg,
+ int *_piBlockStruc, double *_pdblRightReduce, double *_pdblInvRightReduce,
+ double *_pdblScale, int _iMode)
+{
+ int iErr = 0;
+ int iIndex1 = 0;
+ int iIndex2 = 0;
+ int iIndex3 = 0;
+ int iLow = 0;
+ int iHigh = 0;
+ int iLoop11 = 0;
+ int iLoop22 = 0;
+ int iSize11 = 0;
+ int iSize22 = 0;
+ int iLoop22m1 = 0;
+ int iK = 0;
+ int iL = 0;
+ int inK = 0;
+ int iKm1 = 0;
+ int iKm2 = 0;
+
+ int iMinusOne = -1;
+ int iZero = 0;
+ int iOne = 1;
+ int iTwo = 2;
+
+ double dblMinusOne = -1;
+ double dblZero = 0;
+ double dblOne = 1;
+ double dblTwo = 2;
+
+ double dblEps = 0;
+ double dblAvgReal = 0;
+ double dblAvgImg = 0;
+ double dblD = 0;
+
+ for(iIndex1 = 0 ; iIndex1 < _iSize ; iIndex1++)
+ {
+ double dblTemp = 0;
+ for(iIndex2 = 0 ; iIndex2 < _iSize ; iIndex2++)
+ dblTemp += dabss(_pdblVal[iIndex2 + _iSize * iIndex1]);
+
+ dblEps = Max(dblEps, dblTemp);
+ }
+ if(dblEps == 0)
+ dblEps = 1;
+ dblEps = F2C(dlamch)("p",1L) * dblEps;
+
+ //convert a to upper hessenberg form.
+ dbalancs(_iLeadDim, _iSize, _pdblVal, &iLow, &iHigh, _pdblScale);
+ dorthess(_iLeadDim, _iSize, iLow, iHigh, _pdblVal, _pdblEigenReal);
+ dortrans(_iLeadDim, _iSize, iLow, iHigh, _pdblVal, _pdblEigenReal, _pdblRightReduce);
+
+ //convert a to quasi-upper triangular form by qr method.
+ iErr = dhqror2s(_iLeadDim, _iSize, 1, _iSize, _pdblVal, _pdblEigenReal, _pdblEigenImg, _pdblRightReduce, 21);
+
+ //check to see if hqror2 failed in computing any eigenvalue
+ if(iErr != 0)
+ return iErr;
+
+/*
+ reduce a to block diagonal form
+
+
+ segment a into 4 matrices: a11, a da11 x da11 block
+ whose (1,1)-element is at a(l11,l11)) a22, a da22 x da22
+ block whose (1,1)-element is at a(l22,l22)) a12,
+ a da11 x da22 block whose (1,1)-element is at a(l11,l22))
+ and a21, a da22 x da11 block = 0 whose (1,1)-
+ element is at a(l22,l11).
+
+
+
+ this loop uses l11 as loop index and splits off a block
+ starting at a(l11,l11).
+*/
+ iLoop11 = 1;
+
+ //L40
+ while(iLoop11 <= _iSize)
+ {
+ iLoop22 = iLoop11;
+
+ //this loop uses da11 as loop variable and attempts to split
+ //off a block of size da11 starting at a(l11,l11)
+
+ //sorry for "while(1)" but the original source code in fortran
+ //do loop until goto outside the loop
+ //L50
+ while(1)
+ {
+ if(iLoop22 == iLoop11)
+ {
+ iSize11 = 1;
+ if(iLoop11 != (_iSize - 1))
+ if(dabss(_pdblVal[iLoop11 + (iLoop11 - 1) * _iSize]) > dblEps)
+ iSize11 = 2;
+
+ iLoop22 = iLoop11 + iSize11;
+ iLoop22m1 = iLoop22 - 1;
+
+ }
+ else
+ {
+ //compute the average of the eigenvalues in a11
+ dblAvgReal = 0;
+ dblAvgImg = 0;
+ for(iIndex1 = iLoop11 - 1 ; iIndex1 < iLoop22m1 - 1 ; iIndex1++)
+ {
+ dblAvgReal += _pdblEigenReal[iIndex1];
+ dblAvgImg += dabss(_pdblEigenImg[iIndex1]);
+ }
+ dblAvgReal /= iSize11;
+ dblAvgImg /= iSize11;
+
+ //loop on eigenvalues of a22 to find the one closest to the av
+ dblD = pow(dblAvgReal - _pdblEigenReal[iLoop22],2) + pow(dblAvgImg - _pdblEigenImg[iLoop22],2);
+ iK = iLoop22;
+ iL = iK + 1;
+
+ if(iLoop22 != (_iSize - 1))
+ if(dabss(_pdblVal[(iLoop22 + 1) + iLoop22 * _iSize]) > dblEps)
+ iL = iLoop22 + 2;
+
+ //L71
+
+ //L80
+ while(iL < _iSize)
+ {
+ double dblTemp = pow(dblAvgReal - _pdblEigenReal[iL],2) + pow(dblAvgImg - _pdblEigenImg[iL],2);
+ if(dblTemp < dblD)
+ {
+ iK = iL;
+ dblD = dblTemp;
+ }
+ iL++;
+ if(iL <= _iSize)
+ if(dabss(_pdblVal[iL + (iL *- 1) * _iSize]) > dblEps)
+ iL++;
+ }
+ //loop to move the eigenvalue just located
+ //into first position of block a22.
+ if(iK != (_iSize -1) && dabss(_pdblVal[(iK + 1) + iK * _iSize] > dblEps))
+ {
+ inK = 1;
+ while(iK > iLoop22)
+ {
+ iKm1 = iK - 1;
+ if(dabss(_pdblVal[iKm1 + (iK - 2) * _iSize]) >= dblEps)
+ {
+ double dblE1 = 0, dblE2 = 0;
+ //we're swapping the closest block with a 2 x 2
+ iKm2 = iK - 2;
+ //C2F(exch)(&_iLeadDim, &_iSize, _pdblVal, _pdblRightReduce, &iKm2, &iTwo, &iOne);
+ dexchs(_iLeadDim, _iSize, _pdblVal, _pdblRightReduce, iKm2, 2, 1);
+ //try to split this block into 2 real eigenvalues
+ //C2F(split)(_pdblVal, _pdblRightReduce, &_iSize, &iKm1, &dblE1, &dblE2, &_iLeadDim, &_iLeadDim);
+ dsplits(_pdblVal, _pdblRightReduce, _iSize, iKm1, &dblE1, &dblE2, _iLeadDim, _iLeadDim);
+ }
+ }
+ }
+
+ inK = 2;
+ }
+
+ //L240
+ if(iLoop22 <= _iSize)
+ {
+ //attempt to split off a block of size da11.
+ iSize22 = _iSize - iLoop22 + 1;
+ //save a12 in its transpose form in block a21.
+
+ for(iIndex1 = iLoop11 - 1 ; iIndex1 < iLoop22m1 ; iIndex1++)
+ {
+ for(iIndex2 = iLoop22 - 1 ; iIndex2 < _iSize ; iIndex2++)
+ {
+ _pdblVal[iIndex2 + iIndex1 * _iSize] = _pdblVal[iIndex1 + iIndex2 * _iSize];
+ }
+ }
+
+ //convert a11 to lower quasi-triangular and multiply it by -1 and
+ //a12 appropriately (for solving -a11*p+p*a22=a12).
+ C2F(dad)(_pdblVal, &_iLeadDim, &iLoop11, &iLoop22m1, &iLoop11, &_iSize, &dblOne, &iZero);
+ C2F(dad)(_pdblVal, &_iLeadDim, &iLoop11, &iLoop22m1, &iLoop11, &iLoop22m1, &dblMinusOne, &iOne);
+
+ //solve -a11*p + p*a22 = a12.
+
+ C2F(shrslv)(&_pdblVal[(iLoop11 - 1) + (iLoop11 - 1) * _iSize], &_pdblVal[(iLoop22 - 1) + (iLoop22 - 1) * _iSize],
+ &_pdblVal[(iLoop11 - 1) + (iLoop22 - 1) * _iSize], &iSize11, &iSize22,
+ &_iLeadDim, &_iLeadDim, &_iLeadDim, &dblEps, &_dblEps, &_dblMax, &iErr);
+
+ if(iErr)
+ {
+ //change a11 back to upper quasi-triangular.
+ C2F(dad)(_pdblVal, &_iLeadDim, &iLoop11, &iLoop22m1, &iLoop11, &iLoop22m1, &dblOne, &iOne);
+ C2F(dad)(_pdblVal, &_iLeadDim, &iLoop11, &iLoop22m1, &iLoop11, &iLoop22m1, &dblMinusOne, &iOne);
+
+ //was unable to solve for p - try again
+ //move saved a12 back into its correct position.
+ for(iIndex1 = iLoop11 ; iIndex1 < iLoop22m1 ; iIndex1++)
+ {
+ for(iIndex2 = iLoop22 ; iIndex2 < _iSize ; iIndex2++)
+ {
+ _pdblVal[iIndex1 + iIndex2 * _iSize] = _pdblVal[iIndex2 + iIndex1 * _iSize];
+ _pdblVal[iIndex2 + iIndex1 * _iSize] = 0;
+ }
+ }
+ }//if iErr
+ else
+ break;
+ }//if iLoop22 <= _iSize
+ else
+ break;
+ }// while 1
+ //L290
+ //change solution to p to proper form.
+ if(iLoop22 <= _iSize)
+ {
+ C2F(dad)(_pdblVal, &_iLeadDim, &iLoop11, &iLoop22m1, &iLoop11, &_iSize, &dblOne, &iZero);
+ C2F(dad)(_pdblVal, &_iLeadDim, &iLoop11, &iLoop22m1, &iLoop11, &iLoop22m1, &dblMinusOne, &iOne);
+ }
+
+ //store block size in array bs.
+ _piBlockStruc[iLoop11-1] = iSize11;
+ iIndex1 = iSize11 - 1;
+ if(iIndex1 != 0)
+ {
+ for(iIndex2 = 0 ; iIndex2 < iIndex1; iIndex2++)
+ {
+ _piBlockStruc[(iLoop11 - 1) + iIndex2] = -(iSize11 - iIndex2);
+ }
+ }
+ iLoop11 = iLoop22;
+ }//while iLoop11 < _iSize (L350)
+
+ //set transformations matrices as required
+ if(_iMode == 3)
+ return 0;
+
+ switch(_iMode)
+ {
+ case 2 : //extract non orthogonal tranformation from a
+ for(iIndex1 = 0 ; iIndex1 < _iSize ; iIndex1++)
+ vDset(_iSize, 0, &_pdblInvRightReduce[iIndex1 * _iSize], 1);
+ vDset(_iSize, 1, _pdblInvRightReduce, _iLeadDim + 1);
+
+ iLoop22 = 1;
+ while(iLoop11 <= _iSize)
+ {
+ iLoop11 = iLoop22;
+ iLoop22 = iLoop11 + _piBlockStruc[iLoop11];
+ for(iIndex1 = (iLoop22 - 1) ; iIndex1 < _iSize ; iIndex1++)
+ {
+ for(iIndex2 = 0 ; iIndex2 < _iSize ; iIndex2++)
+ {
+ int iTemp1 = iLoop22 - iLoop11;
+ _pdblInvRightReduce[iIndex2 + iIndex1 * _iSize] +=
+ C2F(ddot)(&iTemp1, &_pdblInvRightReduce[iIndex2 + (iLoop11 - 1) * _iSize], &_iLeadDim, &_pdblVal[(iLoop11 - 1) + iIndex1 * _iSize], &iOne);
+ }
+ }
+ }
+ break;
+ case 1 : //compute inverse transformation
+ for(iIndex1 = 0 ; iIndex1 < _iSize ; iIndex1++)
+ {
+ for(iIndex2 = 0 ; iIndex2 < _iSize ; iIndex2++)
+ {
+ _pdblInvRightReduce[iIndex1 + iIndex2 * _iSize] = _pdblRightReduce[iIndex2 + iIndex1 * _iSize];
+ }
+ }
+ iLoop22 = 1;
+
+ while(iLoop22 <= _iSize)
+ {
+ iLoop11 = iLoop22;
+ iLoop22 = iLoop11 + _piBlockStruc[iLoop11 - 1];
+ if(iLoop22 <= _iSize)
+ {
+ iLoop22m1 = iLoop22 - 1;
+
+ for(iIndex1 = (iLoop11 - 1) ; iIndex1 < iLoop22m1 ; iIndex1++)
+ {
+ for(iIndex2 = 0 ; iIndex2 < _iSize ; iIndex2++)
+ {
+ int iTemp1 = _iSize - iLoop22m1;
+ _pdblInvRightReduce[iIndex1 + iIndex2 * _iSize] -=
+ C2F(ddot)(&iTemp1, &_pdblVal[iIndex1 + (iLoop22 - 1) * _iSize], &_iLeadDim, &_pdblInvRightReduce[(iLoop22 - 1) + iIndex2 * _iSize], &iOne);
+ }
+ }
+ }
+ }//while(iLoop22 <= _iSize)
+
+ if(iHigh != iLow)
+ {
+ for(iIndex1 = iLow ; iIndex1 < iHigh ; iIndex1++)
+ {
+ double dblTemp = 1.0 / _pdblScale[iIndex1];
+ for(iIndex2 = 0 ; iIndex2 < _iSize ; iIndex2++)
+ {
+ _pdblInvRightReduce[iIndex2 + iIndex1 * _iSize] *= dblTemp;
+ }
+ }
+ }
+
+ for(iIndex1 = 0 ; iIndex1 < _iSize ; iIndex1++)
+ {
+ iIndex2 = iIndex1;
+ if(iIndex2 < iLow || iIndex2 > iHigh)
+ {
+ if(iIndex2 < iLow)
+ iIndex2 = iLow - iIndex1;
+
+ iK = (int)_pdblScale[iIndex2];
+ if(iK != iIndex2)
+ {
+ for(iIndex3 = 0 ; iIndex3 < _iSize ; iIndex3++)
+ {
+ vSwitchVal(_pdblInvRightReduce, iIndex3 + iIndex2 * _iSize, iIndex3 + iK * _iSize);
+ }
+ }
+ }
+ }
+ // Warning, case 1 continue to default process
+ //break;
+ default : //compute right transformation
+ iLoop22 = 1;
+ while(iLoop22 <= _iSize)
+ {
+ iLoop11 = iLoop22;
+ iLoop22 = iLoop11 + _piBlockStruc[iLoop11-1];
+ if(iLoop11 <= _iSize)
+ {
+ for(iIndex1 = (iLoop22 - 1) ; iIndex1 < _iSize ; iIndex1++)
+ {
+ for(iIndex2 = 0 ; iIndex2 < _iSize ; iIndex2++)
+ {
+ int iTemp1 = iLoop22 - iLoop11;
+ _pdblRightReduce[iIndex2 + iIndex1 * _iSize] +=
+ C2F(ddot)(&iTemp1, &_pdblRightReduce[iIndex2 + (iLoop11 - 1) * _iSize], &_iLeadDim, &_pdblVal[(iLoop11 - 1) + iIndex1 * _iSize], &iOne);
+ }
+ }
+ }
+ }
+
+ C2F(balbak)(&_iLeadDim, &_iSize, &iLow, &iHigh, _pdblScale, &_iSize, _pdblRightReduce);
+ break;
+ }
+
+ //set zeros in the matrix a
+ iLoop11 = 1;
+ iLoop22 = iLoop11 + _piBlockStruc[iLoop11 - 1];
+ while(iLoop22 < _iSize)
+ {
+ iLoop22 = iLoop11 + _piBlockStruc[iLoop11 - 1];
+ if(iLoop22 <= _iSize)
+ {
+ iLoop22m1 = iLoop22 - 1;
+ for(iIndex1 = (iLoop11 - 1) ; iIndex1 < iLoop22m1 ; iIndex1++)
+ {
+ vDset(_iSize - iLoop22m1, 0, &_pdblVal[iIndex1 + (iLoop22 - 1) * _iSize], _iLeadDim);
+ vDset(_iSize - iLoop22m1, 0, &_pdblVal[(iLoop22 - 1) + iIndex1 * _iSize], 1);
+ }
+ iLoop11 = iLoop22;
+ }
+ }
+
+
+ return iErr;
+}
+
+/*
+purpose
+
+ this subroutine balances a real matrix and isolates
+ eigenvalues whenever possible.
+calling sequence
+
+ on input:
+
+ nm must be set to the row dimension of two-dimensional
+ array parameters as declared in the calling program
+ dimension statement;
+
+ n is the order of the matrix;
+
+ a contains the input matrix to be balanced.
+
+ on output:
+
+ a contains the balanced matrix;
+
+ low and igh are two integers such that a(i,j)
+ is equal to zero if
+ (1) i is greater than j and
+ (2) j=1,...,low-1 or i=igh+1,...,n;
+
+ scale contains information determining the
+ permutations and scaling factors used.
+
+ suppose that the principal submatrix in rows low through igh
+ has been balanced, that p(j) denotes the index interchanged
+ with j during the permutation step, and that the elements
+ of the diagonal matrix used are denoted by d(i,j). then
+ scale(j) = p(j), for j = 1,...,low-1
+ = d(j,j), j = low,...,igh
+ = p(j) j = igh+1,...,n.
+ the order in which the interchanges are made is n to igh+1,
+ then 1 to low-1.
+
+ note that 1 is returned for igh if igh is zero formally.
+
+ the algol procedure exc contained in balance appears in
+ balanc in line. (note that the algol roles of identifiers
+ k,l have been reversed.)
+
+originator
+
+ this subroutine is a translation of the algol procedure balance,
+ num. math. 13, 293-304(1969) by parlett and reinsch.
+ handbook for auto. comp., vol.ii-linear algebra, 315-326(1971).
+
+ questions and comments should be directed to b. s. garbow,
+ applied mathematics division, argonne national laboratory
+
+ ------------------------------------------------------------------
+
+ :::::::::: radix is a machine dependent parameter specifying
+ the base of the machine floating point representation.
+*/
+int dbalancs(int _iRows, int _iSize, double *_pdblVal, int *_piLow, int *_piHigh, double *_pdblScale)
+{
+ double dblRadix = 2;
+ double dblRadix2 = dblRadix * dblRadix;
+ int iIndex1 = 0;
+ int iIndex2 = 0;
+ int iLoop1 = _iSize;
+ int iLoop2 = 1;
+
+ //flag
+ int bLoop1 = 1;
+ int bLoop2 = 1;
+ int iNoConv = 0;
+
+ double dblRowSum = 0;
+ double dblColSum = 0;
+ double dblG = 0;
+ double dblF = 0;
+ double dblS = 0;
+
+ //go to 100
+ while(bLoop1)
+ {
+ int iTemp = 0;
+ bLoop1 = 0;
+ for(iIndex1 = 0 ; iIndex1 < iLoop1 ; iIndex1++)
+ {
+ iTemp = iLoop1 - iIndex1 - 1;
+ for(iIndex2 = iLoop2-1 ; iIndex2 < iLoop1 ; iIndex2++)
+ {
+ if(iIndex2 == iTemp)
+ continue;
+ if(_pdblVal[iTemp + iIndex2 * _iSize] != 0)
+ break;
+ }
+ if(iIndex2 < iLoop1 && iIndex1 < iLoop1 && _pdblVal[iTemp + iIndex2 * _iSize] != 0)
+ continue;
+ bLoop1 = 1;
+ break;
+ }
+ if(bLoop1)
+ {
+ vExchangeVal( _pdblScale, _pdblVal,
+ 0, iLoop1-1,
+ iLoop2-1, _iSize,
+ _iSize, iTemp, iLoop1-1);
+ if(iLoop1 == 1)
+ {
+ *_piLow = iLoop2;
+ *_piHigh = iLoop1;
+ return 0;
+ }
+ else
+ iLoop1--;
+ }
+ }
+
+ while(bLoop2)
+ {
+ int iTemp = 0;
+ bLoop2 = 0;
+ for(iIndex1 = iLoop2-1 ; iIndex1 < iLoop1 ; iIndex1++)
+ {
+ for(iIndex2 = iLoop2-1 ; iIndex2 < iLoop1 ; iIndex2++)
+ {
+ if(iIndex2 == iIndex1)
+ continue;
+ if(_pdblVal[iIndex2 + iIndex1 * _iSize] != 0)
+ break;
+ }
+ if(iIndex2 < iLoop1 && iIndex1 < iLoop1 && _pdblVal[iIndex2 + iIndex1 * _iSize] != 0)
+ continue;
+ bLoop2 = 1;
+ break;
+ }
+ if(bLoop2)
+ {
+ vExchangeVal( _pdblScale, _pdblVal,
+ 0, iLoop1-1,
+ iLoop2-1, _iSize,
+ _iSize, iIndex1, iLoop2-1);
+
+ iLoop2++;
+ }
+ }
+
+ for(iIndex1 = iLoop2-1 ; iIndex1 < iLoop1 ; iIndex1++)
+ _pdblScale[iIndex1] = 1;
+
+ do
+ {
+ iNoConv = 0;
+ for(iIndex1 = iLoop2-1 ; iIndex1 < iLoop1 ; iIndex1++)
+ {
+ dblRowSum = 0;
+ dblColSum = 0;
+
+ for(iIndex2 = iLoop2-1 ; iIndex2 < iLoop1 ; iIndex2++)
+ {
+ dblColSum += dabss(_pdblVal[iIndex2 + iIndex1 * _iSize]);
+ dblRowSum += dabss(_pdblVal[iIndex1 + iIndex2 * _iSize]);
+ }
+
+ //:::::::::: guard against zero c or r due to underflow ::::::::::
+ if(dblRowSum == 0 || dblColSum == 0)
+ continue;
+
+ dblG = dblRowSum / dblRadix;
+ dblF = 1;
+ dblS = dblColSum + dblRowSum;
+
+ while(dblColSum < dblG)
+ {
+ dblF *= dblRadix;
+ dblColSum *= dblRadix2;
+ }
+
+ dblG = dblRowSum * dblRadix;
+
+ while(dblColSum >= dblG)
+ {
+ dblF /= dblRadix;
+ dblColSum /= dblRadix2;
+ }
+
+ //:::::::::: now balance ::::::::::
+ if( ((dblColSum + dblRowSum) / dblF) >= (0.95 * dblS))
+ continue;
+
+ dblG = 1 / dblF;
+ _pdblScale[iIndex1] *= dblF;
+ iNoConv = 1;
+
+ for(iIndex2 = iLoop2-1 ; iIndex2 < _iSize ; iIndex2++)
+ _pdblVal[iIndex1 + iIndex2 * _iSize] *= dblG;
+
+ for(iIndex2 = 0 ; iIndex2 < iLoop1 ; iIndex2++)
+ _pdblVal[iIndex2 + iIndex1 * _iSize] *= dblF;
+ }
+ }while(iNoConv == 1);
+
+ *_piLow = iLoop2; //Check if this value is use like array index or not ( 0 indexed or 1 indexed )
+ *_piHigh = iLoop1; //Check if this value is use like array index or not ( 0 indexed or 1 indexed )
+
+ //:::::::::: last card of balanc ::::::::::
+ return 0;
+}
+
+void vExchangeVal(double *_pdblScale, double *_pdblVal,
+ int _iStart1, int _iEnd1,
+ int _iStart2, int _iEnd2,
+ int _iSize, int _iCoord1, int _iCoord2)
+{
+ int iIndex = 0;
+
+ _pdblScale[_iEnd1] = _iCoord1;
+ if(_iCoord1 == _iEnd1)
+ return;
+ for(iIndex = _iStart1 ; iIndex <= _iEnd1 ; iIndex++)
+ vSwitchVal( _pdblVal,
+ iIndex + _iCoord1 * _iSize,
+ iIndex + _iCoord2 * _iSize);
+
+ for(iIndex = _iStart2 ; iIndex < _iEnd2 ; iIndex++)
+ vSwitchVal( _pdblVal,
+ _iCoord1 + iIndex * _iSize,
+ _iCoord2 + iIndex * _iSize);
+}
+
+void vSwitchVal(double *_pdblVal, int _iPos1, int _iPos2)
+{
+ double dblTemp = 0;
+
+ dblTemp = _pdblVal[_iPos1];
+ _pdblVal[_iPos1] = _pdblVal[_iPos2];
+ _pdblVal[_iPos2] = dblTemp;
+}
+
+/*
+ purpose
+
+ given a real general matrix, this subroutine
+ reduces a submatrix situated in rows and columns
+ low through igh to upper hessenberg form by
+ orthogonal similarity transformations.
+
+ calling sequence
+
+ subroutine orthes(nm,n,low,igh,a,ort)
+
+ on input:
+
+ nm must be set to the row dimension of two-dimensional
+ array parameters as declared in the calling program
+ dimension statement;
+
+ n is the order of the matrix;
+
+ low and igh are integers determined by the balancing
+ subroutine balanc. if balanc has not been used,
+ set low=1, igh=n;
+
+ a contains the input matrix.
+
+ on output:
+
+ a contains the hessenberg matrix. information about
+ the orthogonal transformations used in the reduction
+ is stored in the remaining triangle under the
+ hessenberg matrix;
+
+ ort contains further information about the transformations.
+ only elements low through igh are used.
+
+originator
+
+ this subroutine is a translation of the algol procedure orthes,
+ num. math. 12, 349-368(1968) by martin and wilkinson.
+ handbook for auto. comp., vol.ii-linear algebra, 339-358(1971).
+ questions and comments should be directed to b. s. garbow,
+ applied mathematics division, argonne national laboratory
+*/
+int dorthess(int _iLead, int _iSize, int _iLow, int _iHigh, double *_pdblVal, double *_pdblOrt)
+{
+ int iIndex1 = 0;
+ int iIndex2 = 0;
+ int iIndex3 = 0;
+
+ int iNewHigh = _iHigh - 1;
+ int iNewLow = _iLow + 1;
+
+ if(iNewHigh < iNewLow)
+ return 0;
+
+ for(iIndex1 = iNewLow-1 ; iIndex1 < iNewHigh ; iIndex1++)
+ {
+ double dblH = 0;
+ double dblG = 0;
+ double dblScale = 0;
+ int iOffMax = 0;
+
+ _pdblOrt[iIndex1] = 0;
+
+ //:::::::::: scale column (algol tol then not needed) ::::::::::
+ for(iIndex2 = iIndex1 ; iIndex2 < _iHigh; iIndex2++)
+ dblScale += dabss(_pdblVal[iIndex2 + (iIndex1-1) * _iSize]);
+
+ if(dblScale == 0)
+ continue;
+
+ iOffMax = iIndex1 + _iHigh;
+
+ //:::::::::: for i=igh step -1 until m do -- ::::::::::
+ for(iIndex2 = iIndex1 ; iIndex2 < _iHigh; iIndex2++)
+ {
+ iIndex3 = iOffMax - (iIndex2+1);
+ _pdblOrt[iIndex3] = _pdblVal[iIndex3 + (iIndex1-1) * _iSize] / dblScale;
+ dblH += _pdblOrt[iIndex3] * _pdblOrt[iIndex3];
+ }
+
+ dblG = -dsigns(dsqrts(dblH), _pdblOrt[iIndex1]);
+ dblH -= _pdblOrt[iIndex1] * dblG;
+ _pdblOrt[iIndex1] -= dblG;
+
+ //:::::::::: form (i-(u*ut)/h) * a ::::::::::
+ for(iIndex2 = iIndex1 ; iIndex2 < _iSize; iIndex2++)
+ {
+ double dblF = 0;
+
+ //:::::::::: for i=igh step -1 until m do -- ::::::::::
+ for(iIndex3 = iIndex1; iIndex3 < _iHigh; iIndex3++)
+ {
+ int iTemp = iOffMax - (iIndex3+1);
+ dblF += _pdblOrt[iTemp] * _pdblVal[iTemp + iIndex2 * _iSize];
+ }
+
+ dblF /= dblH;
+
+ for(iIndex3 = iIndex1; iIndex3 < _iHigh; iIndex3++)
+ _pdblVal[iIndex3 + iIndex2 * _iSize] -= dblF * _pdblOrt[iIndex3];
+ }
+
+ //:::::::::: form (i-(u*ut)/h)*a*(i-(u*ut)/h) ::::::::::
+ for(iIndex2 = 0 ; iIndex2 < _iHigh; iIndex2++)
+ {
+ double dblF = 0;
+
+ //:::::::::: for j=igh step -1 until m do -- ::::::::::
+ for(iIndex3 = iIndex1; iIndex3 < _iHigh; iIndex3++)
+ {
+ int iTemp = iOffMax - (iIndex3+1);
+ dblF += _pdblOrt[iTemp] * _pdblVal[iIndex2 + iTemp * _iSize];
+ }
+
+ dblF /= dblH;
+
+ for(iIndex3 = iIndex1; iIndex3 < _iHigh; iIndex3++)
+ _pdblVal[iIndex2 + iIndex3 * _iSize] -= dblF * _pdblOrt[iIndex3];
+ }
+
+ _pdblOrt[iIndex1] *= dblScale;
+ _pdblVal[iIndex1 + (iIndex1-1) * _iSize] = dblScale * dblG;
+ }
+ //:::::::::: last card of orthes ::::::::::
+ return 0;
+}
+
+/*
+purpose
+
+ this subroutine accumulates the orthogonal similarity
+ transformations used in the reduction of a real general
+ matrix to upper hessenberg form by orthes.
+
+calling sequence
+
+ subroutine ortran(nm,n,low,igh,a,ort,z)
+
+ on input:
+
+ nm must be set to the row dimension of two-dimensional
+ array parameters as declared in the calling program
+ dimension statement;
+
+ n is the order of the matrix;
+
+ low and igh are integers determined by the balancing
+ subroutine balanc. if balanc has not been used,
+ set low=1, igh=n;
+
+ a contains information about the orthogonal trans-
+ formations used in the reduction by orthes
+ in its strict lower triangle;
+
+ ort contains further information about the trans-
+ formations used in the reduction by orthes.
+ only elements low through igh are used.
+
+ on output:
+
+ z contains the transformation matrix produced in the
+ reduction by orthes;
+
+ ort has been altered.
+
+originator
+
+ this subroutine is a translation of the algol procedure ortrans,
+ num. math. 16, 181-204(1970) by peters and wilkinson.
+ handbook for auto. comp., vol.ii-linear algebra, 372-395(1971).
+
+ questions and comments should be directed to b. s. garbow,
+ applied mathematics division, argonne national laboratory
+*/
+int dortrans(int _iLead, int _iSize, int _iLow, int _iHigh, double *_pdblVal, double *_pdblOrt, double *_pdblTrans)
+{
+ int iIndex1 = 0;
+ int iIndex2 = 0;
+ int iIndex3 = 0;
+ int iLoop = 0;
+
+ for(iIndex1 = 0 ; iIndex1 < _iSize ; iIndex1++)
+ {
+ for(iIndex2 = 0 ; iIndex2 < _iSize ; iIndex2++)
+ _pdblTrans[iIndex1 + iIndex2 * _iSize] = 0;
+
+ _pdblTrans[iIndex1 + iIndex1 * _iSize] = 1;
+ }
+
+ iLoop = _iHigh - _iLow - 1;
+ if(iLoop < 0)
+ return 0;
+
+ //:::::::::: for mp=igh-1 step -1 until low+1 do -- ::::::::::
+ for(iIndex1 = 0 ; iIndex1 < iLoop ; iIndex1++)
+ {
+ int iTemp = _iHigh - (iIndex1+1) - 1;
+
+ if(_pdblVal[iTemp + (iTemp-1) * _iSize] == 0)
+ continue;
+
+ for(iIndex2 = iTemp + 1 ; iIndex2 < _iHigh ; iIndex2++)
+ _pdblOrt[iIndex2] = _pdblVal[iIndex2 + (iTemp-1) * _iSize];
+
+ for(iIndex2 = iTemp ; iIndex2 < _iHigh ; iIndex2++)
+ {
+ double dblG = 0;
+
+ for(iIndex3 = iTemp ; iIndex3 < _iHigh ; iIndex3++)
+ dblG += _pdblOrt[iIndex3] * _pdblTrans[iIndex3 + iIndex2 * _iSize];
+
+ //::::::::::divisor below is negative of h formed in orthes.
+ //::::::::::double division avoids possible underflow
+ dblG = (dblG / _pdblOrt[iTemp] ) / _pdblVal[iTemp + (iTemp-1) * _iSize];
+
+ for(iIndex3 = iTemp ; iIndex3 < _iHigh ; iIndex3++)
+ _pdblTrans[iIndex3 + iIndex2 * _iSize] += dblG * _pdblOrt[iIndex3];
+
+ }
+ }
+
+ return 0;
+}
+
+/*
+
+ this subroutine is a translation of the algol procedure hqr2,
+ num. math. 16, 181-204(1970) by peters and wilkinson.
+ handbook for auto. comp., vol.ii-linear algebra, 372-395(1971).
+
+cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+
+ MODIFICATIONS WRT EISPACK VERSION
+ ---------------------------------
+ 1. 1x1 and 2x2 diagonal blocks are clearly isolated by
+ forcing subdiagonal entries to zero
+ 2. Merging of hqr/hqr2 driven by a job parameter
+
+cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+
+ This subroutine finds the eigenvalues of a real upper
+ hessenberg matrix by the qr method. In addition, the
+ orthogonal transformation leading to the Schur form is
+ accumulated
+
+ on input
+
+ nm must be set to the row dimension of two-dimensional
+ array parameters as declared in the calling program
+ dimension statement.
+
+ n is the order of the matrix.
+
+ low and igh are integers determined by the balancing
+ subroutine balanc. if balanc has not been used,
+ set low=1, igh=n.
+
+ h contains the upper hessenberg matrix.
+
+ z contains the transformation matrix produced by eltran
+ after the reduction by elmhes, or by ortran after the
+ reduction by orthes, if performed. if the eigenvectors
+ of the hessenberg matrix are desired, z must contain the
+ identity matrix.
+
+ job has the decimal decomposition xy;
+ if x=0 hqror2 compute eigen-decomposition of h
+ if x=1 hqror2 computes schur decomposition of h
+ if x=2 eigenvalues are computed via schur decomposition
+ if y=0 coordinate transformation is not accumulated
+ if y=1 coordinate transformation is accumulated
+
+
+ on output
+
+ h contains the Schur form
+
+ wr and wi contain the real and imaginary parts,
+ respectively, of the eigenvalues. the eigenvalues
+ are unordered except that complex conjugate pairs
+ of values appear consecutively with the eigenvalue
+ having the positive imaginary part first. if an
+ error exit is made, the eigenvalues should be correct
+ for indices ierr+1,...,n.
+
+ z contains the orthogonal transformation to the real schur
+ form. If an error exit is made, z may be incorrect.
+
+ ierr is set to
+ zero for normal return,
+ j if the limit of 30*n iterations is exhausted
+ while the j-th eigenvalue is being sought.
+
+ calls cdiv for complex division.
+
+ questions and comments should be directed to burton s. garbow,
+ mathematics and computer science div, argonne national laboratory
+
+ this version dated august 1983.
+*/
+int dhqror2s(int _iLead, int _iSize, int _iLow, int _iHigh,
+ double *_pdblHessUp, double *_pdblEigenReal, double *_pdblEigenImg,
+ double *_pdblTrans, int _iMode)
+{
+ //some loop ...
+ int iIndex1 = 0;
+ int iIndex2 = 0;
+ int iIndex3 = 0;
+ int iIndex4 = 0;
+ int iIndex5 = 0;
+ int iIndex6 = 0;
+ int iIndex7 = 0;
+ int iIndex8 = 0;
+ int iIndex9 = 0;
+ int iIndex10 = 0;
+ int iIndex11 = 0;
+ int iIndex12 = 0;
+ int iIndex13 = 0;
+ int iIndex14 = 0;
+ int iIndex15 = 0;
+ int iIndex16 = 0;
+ int iIndex17 = 0;
+ int iIndex18 = 0;
+ int iIndex19 = 0;
+ int iIndex20 = 0;
+ int iIndex21 = 0;
+ int iIndex22 = 0;
+ int iIndex23 = 0;
+ int iIndex24 = 0;
+ int iIndex25 = 0;
+ int iIndex26 = 0;
+ int iIndex27 = 0;
+ int iIndex28 = 0;
+ int iIndex29 = 0;
+ int iIndex30 = 0;
+ int iIndex31 = 0;
+ int iIndex32 = 0;
+ int iIndex33 = 0;
+
+ int iLoop = 0;
+ int iPow10 = 0;
+ int iModulo = 0;
+ int iOffset = 0;
+ int iMaxLoop = 0;
+
+ int iIts = 0;
+ int iCoord1 = iOffset - 1;
+ int iCoord2 = iCoord1 - 1;
+ int iCoord3 = 0;
+ int iLow = _iLow - 1;
+ int iHigh = _iHigh - 1;
+
+ double dblNorm = 0;
+ double dblEps = F2C(dlamch)("p",1L);
+
+ double dblP = 0;
+ double dblQ = 0;
+ double dblR = 0;
+ double dblS = 0;
+ double dblT = 0;
+ double dblW = 0;
+ double dblX = 0;
+ double dblY = 0;
+ double dblZZ = 0;
+
+ //I keep old source code, just for fun :
+ //jx=job/10
+ //jy=job-10*jx
+ iPow10 = _iMode / 10;
+ iModulo = _iMode % 10;
+
+ //.......... store roots isolated by balanc
+ // and compute matrix norm ..........
+ for(iIndex1 = 0 ; iIndex1 < _iSize ; iIndex1++)
+ {
+ for(iIndex2 = iLoop ; iIndex2 < _iSize ; iIndex2++)
+ dblNorm += dabss(_pdblHessUp[iIndex1 + iIndex2 * _iSize]);
+
+ iLoop = iIndex1;
+ if(iPow10 == 1)
+ continue;
+
+ if(iIndex1 >= iLow && iIndex1 <= iHigh)
+ continue;
+
+ _pdblEigenReal[iIndex1] = _pdblHessUp[iIndex1 + iIndex1 * _iSize];
+ _pdblEigenImg[iIndex1] = 0;
+ }
+
+ iOffset = iHigh;
+ dblT = 0;
+ iMaxLoop = 30 * _iSize;
+
+ //.......... search for next eigenvalues ..........
+L60:
+ if(iOffset <= iLow )
+ goto L340;
+
+ iIts = 0;
+ iCoord1 = iOffset - 1;
+ iCoord2 = iCoord1;
+
+L70:
+ //.......... look for single small sub-diagonal element
+ // for l=en step -1 until low do -- ..........
+ for(iIndex3 = iLow ; iIndex3 < (iOffset + 1); iIndex3++)
+ {
+ double dblTemp1 = 0, dblTemp2 = 0;
+ iIndex4 = iOffset + iLow - iIndex3;
+ if(iIndex4 == iLow)
+ break;
+
+ dblS = dabss(_pdblHessUp[(iIndex4 - 1) + (iIndex4 - 1) * _iSize]) +
+ dabss(_pdblHessUp[iIndex4 + iIndex4 * _iSize]);
+
+ if(dblS == 0)
+ dblS = dblNorm;
+
+ dblTemp1 = dblS;
+ dblTemp2 = dblTemp1 + dabss(_pdblHessUp[iIndex4 + (iIndex4 - 1) * _iSize]);
+ if(dblTemp1 == dblTemp2)
+ break;
+ }
+
+ //.......... form shift ..........
+ dblX = _pdblHessUp[iOffset + iOffset * _iSize];
+ if(iIndex4 == iOffset)
+ goto L270;
+
+ dblY = _pdblHessUp[iCoord1 + iCoord1 * _iSize];
+ dblW = _pdblHessUp[iOffset + iCoord1 * _iSize] * _pdblHessUp[iCoord1 + iOffset * _iSize];
+ if(iIndex4 == iCoord1)
+ goto L280;
+
+ if(iMaxLoop == 0)
+ goto L1000;
+
+ if(iIts == 10 || iIts == 20)
+ {
+ //.......... form exceptional shift ..........
+ dblT += dblX;
+
+ for(iIndex5 = iLow ; iIndex5 < iOffset ; iIndex5++)
+ _pdblHessUp[iIndex5 + iIndex5 * _iSize] -= dblX;
+
+ dblS = dabss(_pdblHessUp[iOffset + iCoord1 * _iSize]) + dabss(_pdblHessUp[iCoord1 + iCoord2 * _iSize]);
+ dblX = 0.75 * dblS;
+ dblY = dblX;
+ dblW = -0.4375 * dblS * dblS;
+ }
+
+
+ iIts++;
+ iMaxLoop--;
+ //..........look for two consecutive small
+ // sub-diagonal elements.
+ // for m=en-2 step -1 until l do -- ..........
+ for(iIndex6 = iIndex4; iIndex6 < iCoord2; iIndex6++)
+ {
+ double dblTemp1 = 0, dblTemp2 = 0;
+
+ iIndex7 = iCoord2 + (iIndex4 - 1) - iIndex6; // +/- 1
+
+ dblZZ = _pdblHessUp[iIndex7 + iIndex7 * _iSize];
+ dblR = dblX -dblZZ;
+ dblS = dblY - dblZZ;
+ dblP = (dblR * dblS - dblW) / _pdblHessUp[(iIndex7 + 1) + iIndex7 * _iSize] + _pdblHessUp[iIndex7 + (iIndex7 + 1) * _iSize];
+ dblQ = _pdblHessUp[(iIndex7 + 1) + (iIndex7 + 1) * _iSize] - dblZZ - dblR - dblS;
+ dblR = _pdblHessUp[(iIndex7 + 2) + (iIndex7 + 1) * _iSize];
+ dblS = dabss(dblP) + dabss(dblQ) + dabss(dblR);
+ dblP /= dblS;
+ dblQ /= dblS;
+ dblR /= dblS;
+
+ if(iIndex7 == iIndex4)
+ break;
+
+ dblTemp1 = dabss(dblP) *
+ (dabss(_pdblHessUp[(iIndex7 - 1) + (iIndex7 - 1) * _iSize]) + dabss(dblZZ)) +
+ dabss(_pdblHessUp[(iIndex7 + 1) + (iIndex7 + 1) * _iSize]);
+
+ dblTemp2 = dblTemp1 +
+ dabss(_pdblHessUp[iIndex7 + (iIndex7 - 1) * _iSize]) * (dabss(dblQ) + dabss(dblR));
+ if(dblTemp1 == dblTemp2)
+ break;
+ }
+ iCoord3 = iIndex7 + 2;
+
+ for(iIndex8 = iCoord3 ; iIndex8 <= iOffset ; iIndex8++)
+ {
+ _pdblHessUp[iIndex8 + (iIndex8 - 2) * _iSize] = 0;
+ if(iIndex8 != iCoord3)
+ _pdblHessUp[iIndex8 + (iIndex8 - 3) * _iSize] = 0;
+ }
+
+ //.......... double qr step involving rows l to en and
+ // columns m to en ..........
+ for(iIndex9 = iIndex7 ; iIndex9 <= iCoord1 ; iIndex9++)
+ {
+ int iNotLast = iIndex9 != iCoord1;
+ if(iIndex9 != iIndex7)
+ {
+ dblP = _pdblHessUp[iIndex9 + (iIndex9 - 1) * _iSize];
+ dblQ = _pdblHessUp[(iIndex9 + 1) + (iIndex9 - 1) * _iSize];
+ dblR = 0;
+ if(iNotLast)
+ dblR = _pdblHessUp[(iIndex9 + 2) + (iIndex9 - 1) * _iSize];
+ dblX = dabss(dblP) + dabss(dblQ) + dabss(dblR);
+ if(dblX == 0)
+ continue;
+
+ dblP /= dblX;
+ dblQ /= dblX;
+ dblR /= dblX;
+ }
+
+ dblS = dsigns(dsqrts(dblP * dblP + dblQ * dblQ + dblR * dblR), dblP);
+
+ if(iIndex9 != iIndex7)
+ _pdblHessUp[iIndex9 + (iIndex9 - 1) * _iSize] = -dblS * dblX;
+ else if(iIndex4 == iIndex7)
+ _pdblHessUp[iIndex9 + (iIndex9 - 1) * _iSize] *= -1;
+
+ dblP += dblS;
+ dblX = dblP / dblS;
+ dblY = dblQ / dblS;
+ dblZZ = dblR / dblS;
+ dblQ /= dblP;
+ dblR /= dblP;
+
+ if(iNotLast == 0)
+ {
+ //.......... row modification ..........
+ for(iIndex10 = iIndex9 ; iIndex10 < _iSize ; iIndex10++)
+ {
+ dblP = _pdblHessUp[iIndex9 + iIndex10 * _iSize] +
+ dblQ * _pdblHessUp[(iIndex9 + 1) + iIndex10 * _iSize];
+
+ _pdblHessUp[iIndex9 + iIndex10 * _iSize] -= dblP * dblX;
+ _pdblHessUp[(iIndex9 + 1) + iIndex10 * _iSize] -= dblP * dblY;
+ }
+
+ iIndex10 = Min(iOffset, iIndex9 + 3);
+
+ //.......... column modification ..........
+ for(iIndex11 = 0 ; iIndex11 <= iIndex10 ; iIndex11++)
+ {
+ dblP = dblX * _pdblHessUp[iIndex11 + iIndex9 * _iSize] +
+ dblY * _pdblHessUp[iIndex11 + (iIndex9 + 1) * _iSize];
+
+ _pdblHessUp[iIndex11 + iIndex9 * _iSize] -= dblP;
+ _pdblHessUp[iIndex11 + (iIndex9 + 1) * _iSize] -= dblP * dblQ;
+ }
+
+ if(iModulo == 1)
+ {//.......... accumulate transformations ..........
+ for(iIndex12 = iLow ; iIndex12 <= iHigh ; iIndex12++)
+ {
+ dblP = dblX * _pdblTrans[iIndex12 + iIndex9 * _iSize] +
+ dblY * _pdblTrans[iIndex12 + (iIndex9 + 1) * _iSize];
+
+ _pdblTrans[iIndex12 + iIndex9 * _iSize] -= dblP;
+ _pdblTrans[iIndex12 + (iIndex9 + 1) * _iSize] -= dblP * dblQ;
+ }
+ }
+ }
+ else
+ {
+ //.......... row modification ..........
+ for(iIndex13 = iIndex9 ; iIndex13 < _iSize ; iIndex13++)
+ {
+ dblP = _pdblHessUp[iIndex9 + iIndex13 * _iSize] +
+ dblQ * _pdblHessUp[(iIndex9 + 1) + iIndex13 * _iSize] +
+ dblR * _pdblHessUp[(iIndex9 + 2) + iIndex13 * _iSize];
+
+ _pdblHessUp[iIndex9 + iIndex13 * _iSize] -= dblP * dblX;
+ _pdblHessUp[(iIndex9 + 1) + iIndex13 * _iSize] -= dblP * dblY;
+ _pdblHessUp[(iIndex9 + 2) + iIndex13 * _iSize] -= dblP * dblZZ;
+
+ }
+
+ iIndex14 = Min(iOffset, iIndex9 + 3);
+
+ //.......... column modification ..........
+ for(iIndex15 = 0 ; iIndex15 <= iIndex14 ; iIndex15++)
+ {
+ dblP = dblX * _pdblHessUp[iIndex15 + iIndex9 * _iSize] +
+ dblY * _pdblHessUp[iIndex15 + (iIndex9 + 1) * _iSize] +
+ dblZZ * _pdblHessUp[iIndex15 + (iIndex9 + 2) * _iSize];
+
+ _pdblHessUp[iIndex15 + iIndex9 * _iSize] -= dblP;
+ _pdblHessUp[iIndex15 + (iIndex9 + 1) * _iSize] -= dblP * dblQ;
+ _pdblHessUp[iIndex15 + (iIndex9 + 2) * _iSize] -= dblP * dblR;
+
+ }
+
+ if(iModulo == 1)
+ {//.......... accumulate transformations ..........
+ for(iIndex16 = iLow ; iIndex16 <= iHigh ; iIndex16++)
+ {
+ dblP = dblX * _pdblTrans[iIndex16 + iIndex9 * _iSize] +
+ dblY * _pdblTrans[iIndex16 + (iIndex9 + 1) * _iSize] +
+ dblZZ * _pdblTrans[iIndex16 + (iIndex9 + 2) * _iSize];
+
+ _pdblTrans[iIndex16 + iIndex9 * _iSize] -= dblP;
+ _pdblTrans[iIndex16 + (iIndex9 + 1) * _iSize] -= dblP * dblQ;
+ _pdblTrans[iIndex16 + (iIndex9 + 2) * _iSize] -= dblP * dblR;
+ }
+ }
+ }
+ }
+
+ goto L70;
+
+ //.......... one root found ..........
+L270:
+ _pdblHessUp[iOffset + iOffset * _iSize] = dblX + dblT;
+ //ADDED TO MARK BLOCK SEPARATION BY HARD ZEROS
+ if(iOffset + 1 < _iSize)
+ _pdblHessUp[(iOffset + 1) + (iOffset + 1) * _iSize] = 0;
+
+ if(iPow10 != 1)
+ {
+ _pdblEigenReal[iOffset] = _pdblHessUp[iOffset + iOffset * _iSize];
+ _pdblEigenImg[iOffset] = 0;
+ }
+ iOffset = iCoord1;
+ goto L60;
+
+ //.......... two roots found ..........
+L280:
+ dblP = (dblY - dblX) / 2.0;
+ dblQ = dblP * dblP + dblW;
+ dblZZ = dsqrts(dabss(dblQ));
+ _pdblHessUp[iOffset + iOffset * _iSize] = dblX + dblT;
+ dblX = _pdblHessUp[iOffset + iOffset * _iSize];
+ _pdblHessUp[iCoord1 + iCoord1 * _iSize] = dblY + dblT;
+
+
+ if(dblQ < 0)
+ goto L320;
+
+ //.......... real pair ..........
+ dblZZ = dblP + dsigns(dblZZ, dblP);
+ if(iPow10 != 1)
+ {
+ _pdblEigenReal[iCoord1] = dblX + dblZZ;
+ _pdblEigenReal[iOffset] = _pdblEigenReal[iCoord1];
+
+ if(dblZZ != 0)
+ _pdblEigenReal[iOffset] = dblX - dblW / dblZZ;
+
+ _pdblEigenImg[iCoord1] = 0;
+ _pdblEigenImg[iOffset] = 0;
+ }
+
+ dblX = _pdblHessUp[iOffset + iCoord1 * _iSize];
+ dblS = dabss(dblX) + dabss(dblZZ);
+ dblP = dblX / dblS;
+ dblQ = dblZZ / dblS;
+ dblR = dsqrts(dblP * dblP + dblQ * dblQ);
+ dblP = dblP / dblR;
+ dblQ = dblQ / dblR;
+
+ //.......... row modification ..........
+ for(iIndex17 = iCoord1 ; iIndex17 < _iSize ; iIndex17++)
+ {
+ &