Skip to content
This repository has been archived by the owner on Sep 18, 2020. It is now read-only.

Commit

Permalink
Merge pull request #16 from spectre-team/develop
Browse files Browse the repository at this point in the history
Release 3.5.1

Introduces:

* skeleton for signal processing through wavelets

Fixes:

* build dependencies problems
  • Loading branch information
gmrukwa authored Jan 23, 2018
2 parents 8108cbb + 612c602 commit 3b3bb46
Show file tree
Hide file tree
Showing 25 changed files with 973 additions and 43 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ environment:
configuration:
- Debug
- Release
version: 3.4.0.{build}
version: 3.5.1.{build}

init:
- cmd: echo Project - %APPVEYOR_PROJECT_NAME%
Expand Down
9 changes: 6 additions & 3 deletions src/PropertySheets/NativeProject.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="Configuration">
<TargetPlatformVersion>8.1</TargetPlatformVersion>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
<TargetPlatformVersion>8.1</TargetPlatformVersion>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup>
<TargetExt>.lib</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(OutputPath);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>Spectre.libDataset.lib;Spectre.libGenetic.lib;Spectre.libFunctional.lib;Spectre.libException.lib;Spectre.libClassifier.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>Spectre.libClassifier.lib;Spectre.libFunctional.lib;Spectre.libException.lib;Spectre.libDataset.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
Expand All @@ -108,7 +108,7 @@
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(OutputPath);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>Spectre.libDataset.lib;Spectre.libGenetic.lib;Spectre.libFunctional.lib;Spectre.libException.lib;Spectre.libClassifier.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>Spectre.libClassifier.lib;Spectre.libFunctional.lib;Spectre.libException.lib;Spectre.libDataset.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand All @@ -127,7 +127,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>$(OutputPath);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>Spectre.libDataset.lib;Spectre.libGenetic.lib;Spectre.libFunctional.lib;Spectre.libException.lib;Spectre.libClassifier.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>Spectre.libClassifier.lib;Spectre.libFunctional.lib;Spectre.libException.lib;Spectre.libDataset.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand All @@ -146,7 +146,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>$(OutputPath);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>Spectre.libDataset.lib;Spectre.libGenetic.lib;Spectre.libFunctional.lib;Spectre.libException.lib;Spectre.libClassifier.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>Spectre.libClassifier.lib;Spectre.libFunctional.lib;Spectre.libException.lib;Spectre.libDataset.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down Expand Up @@ -177,4 +177,4 @@
<Error Condition="!Exists('..\packages\opencv3.3.0.0.1\build\native\opencv3.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\opencv3.3.0.0.1\build\native\opencv3.props'))" />
<Error Condition="!Exists('..\packages\opencv3.3.0.0.1\build\native\opencv3.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\opencv3.3.0.0.1\build\native\opencv3.targets'))" />
</Target>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\native\src\gmock\gmock-all.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="SplittedOpenCVDatasetTest.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<TreatWarningAsError>true</TreatWarningAsError>
<AdditionalOptions>/std:c++latest %(AdditionalOptions)</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)Common;</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>
</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Expand Down Expand Up @@ -134,7 +135,7 @@
<AdditionalOptions>/std:c++latest %(AdditionalOptions)</AdditionalOptions>
<TreatWarningAsError>true</TreatWarningAsError>
<OpenMPSupport>false</OpenMPSupport>
<AdditionalIncludeDirectories>$(SolutionDir)Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Expand Down
4 changes: 2 additions & 2 deletions src/Spectre.libGenetic.Tests/Spectre.libGenetic.Tests.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>Spectre.libStatistics.lib;Spectre.libGenetic.lib;Spectre.libException.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>Spectre.libGenetic.lib;Spectre.libException.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
Expand Down Expand Up @@ -122,7 +122,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>Spectre.libStatistics.lib;Spectre.libGenetic.lib;Spectre.libException.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>Spectre.libGenetic.lib;Spectre.libException.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<AdditionalOptions>/std:c++latest %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>Spectre.libDataset.lib;Spectre.libStatistics.lib;Spectre.libException.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>Spectre.libStatistics.lib;Spectre.libException.lib;Spectre.libDataset.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
Expand All @@ -108,7 +108,7 @@
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>Spectre.libDataset.lib;Spectre.libStatistics.lib;Spectre.libException.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>Spectre.libStatistics.lib;Spectre.libException.lib;Spectre.libDataset.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand Down
46 changes: 46 additions & 0 deletions src/Spectre.libWavelet.Tests/ConvolutionTest.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* ConvolutionTest.cpp
* Tests convolution of the signal with given filter.
*
Copyright 2018 Michal Gallus
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#include <gtest/gtest.h>
#include "Spectre.libWavelet\Convolution.h"

namespace
{
using namespace spectre::algorithm::wavelet;

TEST(ConvolutionInitialization, initializes)
{
EXPECT_NO_THROW(Convolution());
}

class ConvolutionTest : public ::testing::Test
{
protected:
Convolution convolution;
};

TEST_F(ConvolutionTest, properly_convolves_the_kernel_over_a_signal)
{
Signal signal = { 1.0, 2.0, 3.0, 4.0 };
Signal kernel = { -0.5, 1.0 };
Signal result = convolution.Convolve(kernel, signal);
Signal correctResult = { -0.5, 0.0, 0.5, 1.0 };
ASSERT_EQ(correctResult, result);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* MeanAbsoluteDeviationNoiseEstimatorTest.cpp
* Tests Mean Absolute Deviation noise estimator.
*
Copyright 2018 Michal Gallus
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#include <gtest/gtest.h>
#include "Spectre.libWavelet\MeanAbsoluteDeviationNoiseEstimator.h"

namespace
{
using namespace spectre::algorithm::wavelet;

TEST(MeanAbsoluteDeviationNoiseEstimatorInitialization, initializes)
{
EXPECT_NO_THROW(MeanAbsoluteDeviationNoiseEstimator(5.0));
EXPECT_NO_THROW(MeanAbsoluteDeviationNoiseEstimator());
}

class MeanAbsoluteDeviationNoiseEstimatorTest : public ::testing::Test
{
protected:
MeanAbsoluteDeviationNoiseEstimator estimator;
};

TEST_F(MeanAbsoluteDeviationNoiseEstimatorTest, estimates_noise_for_regular_input)
{
Signal signal = { 1.0f, 2.0f, 3.0f };
DataType maxAbsoluteError = 0.0001;
constexpr DataType result = static_cast<DataType>(1.4650890114825907);

DataType estimate = estimator.Estimate(signal);
ASSERT_NEAR(estimate, result, maxAbsoluteError);
}
}
49 changes: 49 additions & 0 deletions src/Spectre.libWavelet.Tests/SoftThresholderTest.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* SoftThresholderTest.cpp
* Testing of the soft tresholding.
*
Copyright 2018 Michal Gallus
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#include <gtest/gtest.h>
#include "Spectre.libWavelet\SoftThresholder.h"

namespace
{
using namespace spectre::algorithm::wavelet;

TEST(SoftThresholderInitialization, initializes)
{
EXPECT_NO_THROW(SoftThresholder(0.0));
EXPECT_NO_THROW(SoftThresholder(9.0));
EXPECT_NO_THROW(SoftThresholder(-11.0));
}

class SoftThresholderTest : public ::testing::Test
{
public:
SoftThresholderTest() : tresholder(1.0) {}
protected:
SoftThresholder tresholder;
};

TEST_F(SoftThresholderTest, properly_tresholds_signal)
{
Signal input = { -1.0f, 2.0f, -3.0f, 4.0f };
Signal output = tresholder(input);
Signal correctOutput = { -0.0f, 1.0f, -2.0f, 3.0f };
ASSERT_EQ(correctOutput, output);
}
}
Loading

0 comments on commit 3b3bb46

Please sign in to comment.