Skip to content

Commit

Permalink
fix #385 statistics module
Browse files Browse the repository at this point in the history
  • Loading branch information
Nelson-numerical-software committed Jan 1, 2021
1 parent 4b0665b commit 8bd25b1
Show file tree
Hide file tree
Showing 35 changed files with 1,211 additions and 28 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# 0.5.XX (2021-01-XX)

## Bug Fixes:

- [#385](http://github.com/Nelson-numerical-software/nelson/issues/385): `corrcoef`, `mean` moved in statistics module.

## Compilation:

- 0.5 family (CHANGELOG)
Expand Down
22 changes: 22 additions & 0 deletions NelSon.sln
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NelSon-cli", "modules\main\
{964FF907-D58A-48B6-A03B-3F6CF48CBE41} = {964FF907-D58A-48B6-A03B-3F6CF48CBE41}
{17135B09-BC25-448E-9750-C09A87FDE6F8} = {17135B09-BC25-448E-9750-C09A87FDE6F8}
{31EFFD09-DC10-4163-BC2F-4F285F96A7D6} = {31EFFD09-DC10-4163-BC2F-4F285F96A7D6}
{9AC8560A-9E4C-4430-9938-63D6377890EB} = {9AC8560A-9E4C-4430-9938-63D6377890EB}
{A52B940C-3987-4DB4-9785-45CBBE5D0B23} = {A52B940C-3987-4DB4-9785-45CBBE5D0B23}
{7EAA9510-D91B-41A7-B27D-B4994B6EF069} = {7EAA9510-D91B-41A7-B27D-B4994B6EF069}
{636D4715-9889-4A8E-9404-3B05CB7734D1} = {636D4715-9889-4A8E-9404-3B05CB7734D1}
Expand Down Expand Up @@ -91,6 +92,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NelSon-cli", "modules\main\
{1BF47B95-0985-4267-9644-A50C7E186C47} = {1BF47B95-0985-4267-9644-A50C7E186C47}
{2391A997-6A1F-49EF-8A7A-92769F13B1F7} = {2391A997-6A1F-49EF-8A7A-92769F13B1F7}
{AB85E897-56B7-4792-8A8E-F3797BE2B7CC} = {AB85E897-56B7-4792-8A8E-F3797BE2B7CC}
{0C41339D-F889-4C5F-9D0C-689605FC43C2} = {0C41339D-F889-4C5F-9D0C-689605FC43C2}
{DDCCE99F-2EB8-4692-9E79-84F5FE42B7DE} = {DDCCE99F-2EB8-4692-9E79-84F5FE42B7DE}
{9067DFA1-CE20-4CAA-97E2-34D3C6A2AD7D} = {9067DFA1-CE20-4CAA-97E2-34D3C6A2AD7D}
{B1129CA6-B4DE-43D1-84C9-C1C7F0787E5E} = {B1129CA6-B4DE-43D1-84C9-C1C7F0787E5E}
Expand Down Expand Up @@ -418,6 +420,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nlsIpc", "modules\ipc\src\c
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nlsIpc_builtin", "modules\ipc\builtin\c\nlsIpc_builtin.vcxproj", "{20244504-06DA-42F2-9DF1-21740C2054F3}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nlsStatistics", "modules\statistics\src\c\nlsStatistics.vcxproj", "{9AC8560A-9E4C-4430-9938-63D6377890EB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nlsStatistics_builtin", "modules\statistics\builtin\c\nlsStatistics_builtin.vcxproj", "{0C41339D-F889-4C5F-9D0C-689605FC43C2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Expand Down Expand Up @@ -1438,6 +1444,22 @@ Global
{20244504-06DA-42F2-9DF1-21740C2054F3}.Release|Win32.Build.0 = Release|Win32
{20244504-06DA-42F2-9DF1-21740C2054F3}.Release|x64.ActiveCfg = Release|x64
{20244504-06DA-42F2-9DF1-21740C2054F3}.Release|x64.Build.0 = Release|x64
{9AC8560A-9E4C-4430-9938-63D6377890EB}.Debug|Win32.ActiveCfg = Debug|Win32
{9AC8560A-9E4C-4430-9938-63D6377890EB}.Debug|Win32.Build.0 = Debug|Win32
{9AC8560A-9E4C-4430-9938-63D6377890EB}.Debug|x64.ActiveCfg = Debug|x64
{9AC8560A-9E4C-4430-9938-63D6377890EB}.Debug|x64.Build.0 = Debug|x64
{9AC8560A-9E4C-4430-9938-63D6377890EB}.Release|Win32.ActiveCfg = Release|Win32
{9AC8560A-9E4C-4430-9938-63D6377890EB}.Release|Win32.Build.0 = Release|Win32
{9AC8560A-9E4C-4430-9938-63D6377890EB}.Release|x64.ActiveCfg = Release|x64
{9AC8560A-9E4C-4430-9938-63D6377890EB}.Release|x64.Build.0 = Release|x64
{0C41339D-F889-4C5F-9D0C-689605FC43C2}.Debug|Win32.ActiveCfg = Debug|Win32
{0C41339D-F889-4C5F-9D0C-689605FC43C2}.Debug|Win32.Build.0 = Debug|Win32
{0C41339D-F889-4C5F-9D0C-689605FC43C2}.Debug|x64.ActiveCfg = Debug|x64
{0C41339D-F889-4C5F-9D0C-689605FC43C2}.Debug|x64.Build.0 = Debug|x64
{0C41339D-F889-4C5F-9D0C-689605FC43C2}.Release|Win32.ActiveCfg = Release|Win32
{0C41339D-F889-4C5F-9D0C-689605FC43C2}.Release|Win32.Build.0 = Release|Win32
{0C41339D-F889-4C5F-9D0C-689605FC43C2}.Release|x64.ActiveCfg = Release|x64
{0C41339D-F889-4C5F-9D0C-689605FC43C2}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
3 changes: 2 additions & 1 deletion modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ list(
webtools
graphics
mex
ipc)
ipc
statistics)
list(APPEND moduleslist main)
# ==============================================================================
if(NOT WITHOUT_FFTW AND NOT LGPL21_ONLY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@
<ClCompile Include="..\cpp\colonBuiltin.cpp" />
<ClCompile Include="..\cpp\complexBuiltin.cpp" />
<ClCompile Include="..\cpp\conjBuiltin.cpp" />
<ClCompile Include="..\cpp\corrcoefBuiltin.cpp" />
<ClCompile Include="..\cpp\ctransposeBuiltin.cpp" />
<ClCompile Include="..\cpp\dec2baseBuiltin.cpp" />
<ClCompile Include="..\cpp\dispBuiltin.cpp" />
Expand Down Expand Up @@ -293,7 +292,6 @@
<ClInclude Include="..\include\colonBuiltin.hpp" />
<ClInclude Include="..\include\complexBuiltin.hpp" />
<ClInclude Include="..\include\conjBuiltin.hpp" />
<ClInclude Include="..\include\corrcoefBuiltin.hpp" />
<ClInclude Include="..\include\ctransposeBuiltin.hpp" />
<ClInclude Include="..\include\dec2baseBuiltin.hpp" />
<ClInclude Include="..\include\dispBuiltin.hpp" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,6 @@
<ClCompile Include="..\cpp\isscalarBuiltin.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\cpp\corrcoefBuiltin.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Text Include="..\..\CMakeLists.txt" />
Expand Down Expand Up @@ -541,8 +538,5 @@
<ClInclude Include="..\include\isscalarBuiltin.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\corrcoefBuiltin.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
3 changes: 0 additions & 3 deletions modules/elementary_functions/builtin/cpp/Gateway.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@
#include "findBuiltin.hpp"
#include "isvectorBuiltin.hpp"
#include "isscalarBuiltin.hpp"
#include "corrcoefBuiltin.hpp"
//=============================================================================
using namespace Nelson;
//=============================================================================
Expand Down Expand Up @@ -288,8 +287,6 @@ static const nlsGateway gateway[] = {
CPP_BUILTIN_WITH_EVALUATOR },
{ "isvector", (void*)Nelson::ElementaryFunctionsGateway::isvectorBuiltin, 1, 1, CPP_BUILTIN },
{ "isscalar", (void*)Nelson::ElementaryFunctionsGateway::isscalarBuiltin, 1, 1, CPP_BUILTIN },
{ "corrcoef", (void*)Nelson::ElementaryFunctionsGateway::corrcoefBuiltin, 1, 1,
CPP_BUILTIN_WITH_EVALUATOR },
};
//=============================================================================
NLSGATEWAYFUNC(gateway)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@
<ClCompile Include="..\cpp\ComplexConstructor.cpp" />
<ClCompile Include="..\cpp\ComplexTranspose.cpp" />
<ClCompile Include="..\cpp\ConcatenateNdArray.cpp" />
<ClCompile Include="..\cpp\CorrelationCoefficients.cpp" />
<ClCompile Include="..\cpp\DecimalToBase.cpp" />
<ClCompile Include="..\cpp\DotLeftDivide.cpp" />
<ClCompile Include="..\cpp\DotPower.cpp" />
Expand Down Expand Up @@ -290,7 +289,6 @@
<ClInclude Include="..\include\ComplexConstructor.hpp" />
<ClInclude Include="..\include\ComplexTranspose.hpp" />
<ClInclude Include="..\include\ConcatenateNdArray.hpp" />
<ClInclude Include="..\include\CorrelationCoefficients.hpp" />
<ClInclude Include="..\include\DecimalToBase.hpp" />
<ClInclude Include="..\include\DotLeftDivide.hpp" />
<ClInclude Include="..\include\DotPower.hpp" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,6 @@
<ClCompile Include="..\cpp\Find.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\cpp\CorrelationCoefficients.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\AbsoluteValue.hpp">
Expand Down Expand Up @@ -515,9 +512,6 @@
<ClInclude Include="..\include\Find.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\CorrelationCoefficients.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Text Include="..\..\CMakeLists.txt" />
Expand Down
1 change: 1 addition & 0 deletions modules/modules.iss
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,5 @@ Source: {#RootPath}modules\modules.nls; DestDir: {app}\modules\; AfterInstall: A
#include "graphics/module.iss"
#include "mex/module.iss"
#include "ipc/module.iss"
#include "statistics/module.iss"
;==============================================================================
6 changes: 4 additions & 2 deletions modules/modules.nls.in
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ modules_list = [
"webtools";
"graphics";
"mex";
"ipc"
"ipc";
"statistics";
];
// ============================================================================
// optional modules
Expand Down Expand Up @@ -148,6 +149,7 @@ modules_help_list = [
"webtools";
"mex";
"graphics";
"ipc"
"ipc";
"statistics";
];
// ============================================================================
6 changes: 4 additions & 2 deletions modules/modules.nls.vc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ modules_list = [
"webtools";
"graphics";
"mex";
"ipc"
"ipc";
"statistics";
];
// ============================================================================
// optional modules
Expand Down Expand Up @@ -149,6 +150,7 @@ modules_help_list = [
"webtools";
"mex";
"graphics";
"ipc"
"ipc";
"statistics";
];
// ============================================================================
120 changes: 120 additions & 0 deletions modules/statistics/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# ==============================================================================
# Copyright (c) 2016-present Allan CORNET (Nelson)
# ==============================================================================
# This file is part of the Nelson.
# =============================================================================
# LICENCE_BLOCK_BEGIN
# This program is free software; you can redistribute it
# and/or modify it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of the License,
# or (at your option) any later version.
#
# Alternatively, you can redistribute it and/or modify it under the terms of the
# GNU General Public License as published by the Free Software Foundation;
# either version 2 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
# LICENCE_BLOCK_END
# ==============================================================================
set(module_name statistics)
set(module_library_name nlsStatistics)
set(module_library_builtin_name ${module_library_name}_builtin)
# ==============================================================================
include_directories(
${EIGEN3_INCLUDE_DIR}
${Boost_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}/src/include
${CMAKE_CURRENT_SOURCE_DIR}/../linear_algebra/src/include
${CMAKE_CURRENT_SOURCE_DIR}/../characters_encoding/src/include
${CMAKE_CURRENT_SOURCE_DIR}/../types/src/include
${CMAKE_CURRENT_SOURCE_DIR}/../error_manager/src/include
${CMAKE_CURRENT_SOURCE_DIR}/../stream_manager/src/include
${CMAKE_CURRENT_SOURCE_DIR}/../elementary_functions/src/include
${CMAKE_CURRENT_SOURCE_DIR}/../i18n/src/include)
# ==============================================================================
file(GLOB STATISTICS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/cpp/*.cpp")
# ==============================================================================
add_library(${module_library_name} SHARED ${STATISTICS_SRC})
# ==============================================================================
target_link_libraries(
${module_library_name}
nlsError_manager
nlsApi_nelson
nlsTypes
nlsI18n
nlsElementary_functions
${BLAS_LIBRARIES}
${LAPACK_LIBRARIES}
${LAPACKE_LIBRARIES}
${MAC_LAPACKE_LIBRARY})
# ==============================================================================
set_target_properties(
${module_library_name}
PROPERTIES
VERSION
${Nelson_VERSION_MAJOR}.${Nelson_VERSION_MINOR}.${Nelson_VERSION_MAINTENANCE}
SOVERSION ${Nelson_VERSION_MAJOR})
# ==============================================================================
file(GLOB STATISTICS_BUILTIN
"${CMAKE_CURRENT_SOURCE_DIR}/builtin/cpp/*.cpp")
# ==============================================================================
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/builtin/include
${CMAKE_CURRENT_SOURCE_DIR}/src/include
${CMAKE_CURRENT_SOURCE_DIR}/../interpreter/src/include
${CMAKE_CURRENT_SOURCE_DIR}/../overload/src/include
${CMAKE_CURRENT_SOURCE_DIR}/../api_nelson/src/include
${CMAKE_CURRENT_SOURCE_DIR}/../i18n/src/include)
# ==============================================================================
add_library(${module_library_builtin_name} SHARED ${STATISTICS_BUILTIN})
# ==============================================================================
target_link_libraries(
${module_library_builtin_name}
${module_library_name}
nlsApi_nelson
nlsError_manager
nlsInterpreter
nlsOverload
nlsTypes
nlsI18n)
# ==============================================================================
set_target_properties(
${module_library_builtin_name}
PROPERTIES
VERSION
${Nelson_VERSION_MAJOR}.${Nelson_VERSION_MINOR}.${Nelson_VERSION_MAINTENANCE}
SOVERSION ${Nelson_VERSION_MAJOR})
# ==============================================================================
install(TARGETS ${module_library_name} LIBRARY DESTINATION ${LIBRARY_OUTPUT})
install(TARGETS ${module_library_builtin_name}
LIBRARY DESTINATION ${LIBRARY_OUTPUT})
install(FILES ${CMAKE_SOURCE_DIR}/modules/${module_name}/etc/startup.nls
DESTINATION ${ROOT_OUTPUT}/modules/${module_name}/etc)
install(FILES ${CMAKE_SOURCE_DIR}/modules/${module_name}/etc/finish.nls
DESTINATION ${ROOT_OUTPUT}/modules/${module_name}/etc)
install(FILES ${CMAKE_SOURCE_DIR}/modules/${module_name}/loader.nls
DESTINATION ${ROOT_OUTPUT}/modules/${module_name})
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/modules/${module_name}/functions
DESTINATION ${ROOT_OUTPUT}/modules/${module_name}
FILES_MATCHING
PATTERN "*.nlf")
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/modules/${module_name}/help
DESTINATION ${ROOT_OUTPUT}/modules/${module_name}
FILES_MATCHING
PATTERN "*.qch"
PATTERN "xml" EXCLUDE
PATTERN "md" EXCLUDE)
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/modules/${module_name}/tests
DESTINATION ${ROOT_OUTPUT}/modules/${module_name}
FILES_MATCHING
PATTERN "*.nls")
# ==============================================================================
47 changes: 47 additions & 0 deletions modules/statistics/builtin/c/dllMain.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
//=============================================================================
// Copyright (c) 2016-present Allan CORNET (Nelson)
//=============================================================================
// This file is part of the Nelson.
//=============================================================================
// LICENCE_BLOCK_BEGIN
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// Alternatively, you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of
// the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this program. If not, see <http://www.gnu.org/licenses/>.
// LICENCE_BLOCK_END
//=============================================================================
#include "nlsConfig.h"
#include <Windows.h>
//=============================================================================
#pragma comment(lib, CAT_3_STRINGS("boost_system-", BOOST_TARGET, ".lib"))
#pragma comment(lib, CAT_3_STRINGS("boost_filesystem-", BOOST_TARGET, ".lib"))
//=============================================================================
int WINAPI
DllMain(HINSTANCE hInstance, DWORD reason, PVOID pvReserved)
{
switch (reason) {
case DLL_PROCESS_ATTACH:
break;
case DLL_PROCESS_DETACH:
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
}
return 1;
}
//=============================================================================

0 comments on commit 8bd25b1

Please sign in to comment.