Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
OpenWalnut Core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
44
Issues
44
List
Boards
Labels
Service Desk
Milestones
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
a065efdb
Commit
a065efdb
authored
Dec 10, 2014
by
Sebastian Eichelbaum
Browse files
Options
Browse Files
Download
Plain Diff
[MERGE]
parents
f9cbde3a
44a48363
Changes
81
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
81 changed files
with
5756 additions
and
726 deletions
+5756
-726
.hgchurn
.hgchurn
+2
-0
.hgignore
.hgignore
+3
-0
CONTRIBUTORS
CONTRIBUTORS
+3
-0
artwork/Splash/splash.png
artwork/Splash/splash.png
+0
-0
artwork/Splash/splash.xcf
artwork/Splash/splash.xcf
+0
-0
doc/core/doxygenConfig
doc/core/doxygenConfig
+1
-1
doc/developer/doxygenConfig
doc/developer/doxygenConfig
+1
-1
resources/qt5gui/share/openwalnut/qt5gui/splash.png
resources/qt5gui/share/openwalnut/qt5gui/splash.png
+0
-0
src/core/common/WCounter.h
src/core/common/WCounter.h
+14
-0
src/core/common/WHierarchicalTree.cpp
src/core/common/WHierarchicalTree.cpp
+2
-2
src/core/common/WHierarchicalTree.h
src/core/common/WHierarchicalTree.h
+26
-26
src/core/common/WHistogram.cpp
src/core/common/WHistogram.cpp
+2
-1
src/core/common/WHistogram.h
src/core/common/WHistogram.h
+8
-8
src/core/common/WHistogramBasic.cpp
src/core/common/WHistogramBasic.cpp
+13
-11
src/core/common/WHistogramBasic.h
src/core/common/WHistogramBasic.h
+11
-8
src/core/common/math/WPlane.cpp
src/core/common/math/WPlane.cpp
+0
-58
src/core/common/math/principalComponentAnalysis/WCovarianceSolver.cpp
...mon/math/principalComponentAnalysis/WCovarianceSolver.cpp
+87
-0
src/core/common/math/principalComponentAnalysis/WCovarianceSolver.h
...ommon/math/principalComponentAnalysis/WCovarianceSolver.h
+94
-0
src/core/common/math/principalComponentAnalysis/WPrincipalComponentAnalysis.cpp
...rincipalComponentAnalysis/WPrincipalComponentAnalysis.cpp
+106
-0
src/core/common/math/principalComponentAnalysis/WPrincipalComponentAnalysis.h
.../principalComponentAnalysis/WPrincipalComponentAnalysis.h
+137
-0
src/core/dataHandler/WCreateColorArraysThread.cpp
src/core/dataHandler/WCreateColorArraysThread.cpp
+7
-0
src/core/dataHandler/WDataSetFibers.cpp
src/core/dataHandler/WDataSetFibers.cpp
+250
-17
src/core/dataHandler/WDataSetFibers.h
src/core/dataHandler/WDataSetFibers.h
+435
-9
src/core/dataHandler/WDataSetHistogram1D.cpp
src/core/dataHandler/WDataSetHistogram1D.cpp
+92
-0
src/core/dataHandler/WDataSetHistogram1D.h
src/core/dataHandler/WDataSetHistogram1D.h
+138
-0
src/core/dataHandler/WDataSetScalar.h
src/core/dataHandler/WDataSetScalar.h
+2
-2
src/core/dataHandler/WIteratorRange.cpp
src/core/dataHandler/WIteratorRange.cpp
+26
-0
src/core/dataHandler/WIteratorRange.h
src/core/dataHandler/WIteratorRange.h
+220
-0
src/core/dataHandler/io/WWriterFiberVTK.cpp
src/core/dataHandler/io/WWriterFiberVTK.cpp
+4
-0
src/core/graphicsEngine/WGEGeodeUtils.cpp
src/core/graphicsEngine/WGEGeodeUtils.cpp
+4
-1
src/core/graphicsEngine/geodes/WDendrogramGeode.cpp
src/core/graphicsEngine/geodes/WDendrogramGeode.cpp
+7
-0
src/core/graphicsEngine/geodes/WDendrogramGeode.h
src/core/graphicsEngine/geodes/WDendrogramGeode.h
+7
-0
src/core/kernel/WModuleConnector.cpp
src/core/kernel/WModuleConnector.cpp
+19
-5
src/core/kernel/WModuleConnector.h
src/core/kernel/WModuleConnector.h
+12
-1
src/core/kernel/WModuleInputConnector.cpp
src/core/kernel/WModuleInputConnector.cpp
+10
-0
src/core/kernel/WModuleInputConnector.h
src/core/kernel/WModuleInputConnector.h
+9
-0
src/core/kernel/WModuleOutputConnector.cpp
src/core/kernel/WModuleOutputConnector.cpp
+11
-0
src/core/kernel/WModuleOutputConnector.h
src/core/kernel/WModuleOutputConnector.h
+9
-0
src/core/kernel/combiner/WModuleProjectFileCombiner.cpp
src/core/kernel/combiner/WModuleProjectFileCombiner.cpp
+2
-1
src/modules/calculateHistogram/WMCalculateHistogram.cpp
src/modules/calculateHistogram/WMCalculateHistogram.cpp
+136
-0
src/modules/calculateHistogram/WMCalculateHistogram.h
src/modules/calculateHistogram/WMCalculateHistogram.h
+125
-0
src/modules/clusterDisplay/WMClusterDisplay.cpp
src/modules/clusterDisplay/WMClusterDisplay.cpp
+30
-11
src/modules/clusterDisplay/WMClusterDisplay.h
src/modules/clusterDisplay/WMClusterDisplay.h
+37
-5
src/modules/dataCreator/WDataCreatorTuring.cpp
src/modules/dataCreator/WDataCreatorTuring.cpp
+66
-0
src/modules/dataCreator/WDataCreatorTuring.h
src/modules/dataCreator/WDataCreatorTuring.h
+77
-0
src/modules/dataCreator/WMDataCreatorScalar.cpp
src/modules/dataCreator/WMDataCreatorScalar.cpp
+2
-0
src/modules/dataCreator/WTuringPatternCreator.cpp
src/modules/dataCreator/WTuringPatternCreator.cpp
+310
-0
src/modules/dataCreator/WTuringPatternCreator.h
src/modules/dataCreator/WTuringPatternCreator.h
+236
-0
src/modules/fiberDisplay/resources/META
src/modules/fiberDisplay/resources/META
+0
-2
src/modules/fiberFilterROI/resources/META
src/modules/fiberFilterROI/resources/META
+0
-2
src/modules/histogramView/WMHistogramView.cpp
src/modules/histogramView/WMHistogramView.cpp
+275
-495
src/modules/histogramView/WMHistogramView.h
src/modules/histogramView/WMHistogramView.h
+18
-31
src/modules/histogramView/WMMultiHistogramView.cpp
src/modules/histogramView/WMMultiHistogramView.cpp
+1221
-0
src/modules/histogramView/WMMultiHistogramView.h
src/modules/histogramView/WMMultiHistogramView.h
+344
-0
src/modules/histogramView/WToolkit.cpp
src/modules/histogramView/WToolkit.cpp
+67
-0
src/modules/histogramView/WToolkit.h
src/modules/histogramView/WToolkit.h
+31
-0
src/modules/imageSpaceLIC/resources/META
src/modules/imageSpaceLIC/resources/META
+0
-2
src/modules/mergeComponentsToVector/resources/META
src/modules/mergeComponentsToVector/resources/META
+0
-2
src/modules/modules-base.toolbox
src/modules/modules-base.toolbox
+1
-0
src/modules/modules-others.toolbox
src/modules/modules-others.toolbox
+1
-0
src/modules/navigationSlices/WMNavigationSlices.h
src/modules/navigationSlices/WMNavigationSlices.h
+0
-1
src/modules/projectionsAsContext/WMProjectionsAsContext.cpp
src/modules/projectionsAsContext/WMProjectionsAsContext.cpp
+418
-0
src/modules/projectionsAsContext/WMProjectionsAsContext.h
src/modules/projectionsAsContext/WMProjectionsAsContext.h
+207
-0
src/modules/projectionsAsContext/resources/META
src/modules/projectionsAsContext/resources/META
+63
-0
src/modules/projectionsAsContext/resources/WMProjectionsAsContext.png
...projectionsAsContext/resources/WMProjectionsAsContext.png
+0
-0
src/modules/projectionsAsContext/shaders/WMProjectionsAsContext-fragment.glsl
...onsAsContext/shaders/WMProjectionsAsContext-fragment.glsl
+239
-0
src/modules/projectionsAsContext/shaders/WMProjectionsAsContext-vertex.glsl
...tionsAsContext/shaders/WMProjectionsAsContext-vertex.glsl
+37
-0
src/modules/readVIM/resources/META
src/modules/readVIM/resources/META
+0
-2
src/modules/sampleOnFibers/resources/META
src/modules/sampleOnFibers/resources/META
+0
-2
src/modules/template/WMTemplateUI.cpp
src/modules/template/WMTemplateUI.cpp
+2
-2
src/modules/triangleMeshRenderer/WMTriangleMeshRenderer.cpp
src/modules/triangleMeshRenderer/WMTriangleMeshRenderer.cpp
+2
-1
src/modules/vectorNormalize/resources/META
src/modules/vectorNormalize/resources/META
+0
-2
src/modules/vectorScale/resources/META
src/modules/vectorScale/resources/META
+0
-2
src/modules/writeTransferFunction/resources/META
src/modules/writeTransferFunction/resources/META
+0
-2
src/qt5gui/CMakeLists.txt
src/qt5gui/CMakeLists.txt
+18
-0
src/qt5gui/OpenWalnut.cpp
src/qt5gui/OpenWalnut.cpp
+9
-3
src/scriptUI/OpenWalnutScript.cpp
src/scriptUI/OpenWalnutScript.cpp
+5
-2
tools/generateCode.py
tools/generateCode.py
+1
-1
tools/generateModuleTemplate.pl
tools/generateModuleTemplate.pl
+1
-1
tools/release/owbuildchroot
tools/release/owbuildchroot
+2
-2
tools/release/owpack
tools/release/owpack
+1
-1
No files found.
.hgchurn
View file @
a065efdb
...
...
@@ -43,6 +43,8 @@ pieloth@labp.htwk-leipzig.de = Christof_Pieloth
skiunke = Sebastian_Kiunke
a_berres@informatik.uni-kl.de = Anne_Berres
andreas.schwarzkopf@student.openwalnut.org = Andreas_Schwarzkopf_(Coburg)
aschwarzkopf@openwalnut.org = Andreas_Schwarzkopf_(Coburg)
schwarzkopf@vclabor.awmw.org = Andreas_Schwarzkopf_(Coburg)
gsommer_by@gmx.de = Gerald_Sommer
Patrick Oesterling = Patrick_Osterling
root@openwalnut.com = Unknown_________
...
...
.hgignore
View file @
a065efdb
...
...
@@ -8,9 +8,12 @@ syntax: glob
syntax: regexp
^doc/core/html
^doc/core/core.tag
^doc/developer/html
^doc/developer/man
^doc/developer/doxyerror.log
^doc/developer/doxygen_sqlite3.db
^doc/developer/developer.tag
^doc/developer/designDocuments/openWalnutDesign.aux
^doc/developer/designDocuments/openWalnutDesign.bbl
^doc/developer/designDocuments/openWalnutDesign.blg
...
...
CONTRIBUTORS
View file @
a065efdb
...
...
@@ -2,6 +2,7 @@ Alois Schloegl
Andreas Schwarzkopf
André Reichenbach
Anne Berres
Alexander Otte
Christian Heine
Christof Pieloth
Cornelius Müller
...
...
@@ -11,8 +12,10 @@ Gerald Sommer
Jan Forberg
Marcus Stuber
Mario Hlawitschka
Markus Jankowski
Matthias Berndt
Matthias Klose
Michael Hamburger
Patrick Oesterling
Robert Frohl
Robin Ledig
...
...
artwork/Splash/splash.png
View replaced file @
f9cbde3a
View file @
a065efdb
206 KB
|
W:
|
H:
1.27 MB
|
W:
|
H:
2-up
Swipe
Onion skin
artwork/Splash/splash.xcf
View file @
a065efdb
No preview for this file type
doc/core/doxygenConfig
View file @
a065efdb
...
...
@@ -1320,7 +1320,7 @@ TAGFILES =
# When a file name is specified after GENERATE_TAGFILE, doxygen will create
# a tag file that is based on the input files it reads.
GENERATE_TAGFILE =
GENERATE_TAGFILE =
doc/core/core.tag
# If the ALLEXTERNALS tag is set to YES all external classes will be listed
# in the class index. If set to NO only the inherited external classes
...
...
doc/developer/doxygenConfig
View file @
a065efdb
...
...
@@ -1322,7 +1322,7 @@ TAGFILES =
# When a file name is specified after GENERATE_TAGFILE, doxygen will create
# a tag file that is based on the input files it reads.
GENERATE_TAGFILE =
GENERATE_TAGFILE =
doc/developer/developer.tag
# If the ALLEXTERNALS tag is set to YES all external classes will be listed
# in the class index. If set to NO only the inherited external classes
...
...
resources/qt5gui/share/openwalnut/qt5gui/splash.png
View replaced file @
f9cbde3a
View file @
a065efdb
206 KB
|
W:
|
H:
209 KB
|
W:
|
H:
2-up
Swipe
Onion skin
src/core/common/WCounter.h
View file @
a065efdb
...
...
@@ -75,6 +75,20 @@ public:
boost
::
shared_lock
<
boost
::
shared_mutex
>
lock
(
m_counterMutex
);
return
m_counter
;
}
/**
* Reset the counter to 0.
*
* \return The value the counter had before the reset.
*/
int
reset
()
{
boost
::
unique_lock
<
boost
::
shared_mutex
>
lock
(
m_counterMutex
);
int
tmp
=
m_counter
;
m_counter
=
0
;
return
tmp
;
}
private:
//! No copy construction.
WCounter
(
WCounter
&
/* count */
);
...
...
src/core/common/WHierarchicalTree.cpp
View file @
a065efdb
...
...
@@ -39,7 +39,7 @@ WHierarchicalTree::~WHierarchicalTree()
{
}
std
::
vector
<
size_t
>
WHierarchicalTree
::
findXBiggestClusters
(
size_t
cluster
,
size_t
number
)
std
::
vector
<
size_t
>
WHierarchicalTree
::
findXBiggestClusters
(
size_t
cluster
,
size_t
number
)
const
{
//std::cout << number << " largest clusters for cluster: " << cluster << std::endl;
...
...
@@ -122,7 +122,7 @@ std::vector< size_t > WHierarchicalTree::findXBiggestClusters( size_t cluster, s
return
returnVector
;
}
std
::
vector
<
size_t
>
WHierarchicalTree
::
downXLevelsFromTop
(
size_t
level
,
bool
hideOutliers
)
std
::
vector
<
size_t
>
WHierarchicalTree
::
downXLevelsFromTop
(
size_t
level
,
bool
hideOutliers
)
const
{
if
(
level
>
m_maxLevel
)
{
...
...
src/core/common/WHierarchicalTree.h
View file @
a065efdb
...
...
@@ -61,40 +61,40 @@ public:
* getter
* \return the number of leafes
*/
size_t
getLeafCount
();
size_t
getLeafCount
()
const
;
/**
* getter
* \return the number of clusters
*/
size_t
getClusterCount
();
size_t
getClusterCount
()
const
;
/**
* getter
* \return maxlevel, i.e. the level of the root cluster
*/
size_t
getMaxLevel
();
size_t
getMaxLevel
()
const
;
/**
* getter
* \param cluster
* \return the level of the selected cluster
*/
size_t
getLevel
(
size_t
cluster
);
size_t
getLevel
(
size_t
cluster
)
const
;
/**
* getter
* \param cluster the cluster in question
* \return the parent for the selected cluster
*/
size_t
getParent
(
size_t
cluster
);
size_t
getParent
(
size_t
cluster
)
const
;
/**
* getter
* \param cluster
* \return the custom data for the selected cluster
*/
float
getCustomData
(
size_t
cluster
);
float
getCustomData
(
size_t
cluster
)
const
;
/**
* setter sets the color for a single cluster
...
...
@@ -108,35 +108,35 @@ public:
* \param cluster
* \return the color for the selected cluster
*/
WColor
getColor
(
size_t
cluster
);
WColor
getColor
(
size_t
cluster
)
const
;
/**
* getter
* \param cluster
* \return children for the selected cluster
*/
std
::
pair
<
size_t
,
size_t
>
getChildren
(
size_t
cluster
);
std
::
pair
<
size_t
,
size_t
>
getChildren
(
size_t
cluster
)
const
;
/**
* getter
* \param cluster
* \return the leafes contained in the selected cluster
*/
std
::
vector
<
size_t
>
getLeafesForCluster
(
size_t
cluster
);
std
::
vector
<
size_t
>
getLeafesForCluster
(
size_t
cluster
)
const
;
/**
* getter
* \param cluster
* \return number of leafes for the selected cluster
*/
size_t
size
(
size_t
cluster
);
size_t
size
(
size_t
cluster
)
const
;
/**
* checks if a cluster is a leaf or a cluster
* \param cluster
* \return true if it is a leaf
*/
bool
isLeaf
(
size_t
cluster
);
bool
isLeaf
(
size_t
cluster
)
const
;
/**
* returns a number of clusters at a certain level down from top cluster
...
...
@@ -144,7 +144,7 @@ public:
* \param hideOutliers true if clusters of size 1 should be ignored
* \return vector containing the cluster id's
*/
std
::
vector
<
size_t
>
downXLevelsFromTop
(
size_t
level
,
bool
hideOutliers
=
false
);
std
::
vector
<
size_t
>
downXLevelsFromTop
(
size_t
level
,
bool
hideOutliers
=
false
)
const
;
/**
* finds the X biggest clusters for a given cluster
...
...
@@ -153,7 +153,7 @@ public:
*
* \return the biggest clusters
*/
std
::
vector
<
size_t
>
findXBiggestClusters
(
size_t
cluster
,
size_t
number
=
10
);
std
::
vector
<
size_t
>
findXBiggestClusters
(
size_t
cluster
,
size_t
number
=
10
)
const
;
/**
* sets the color for a selected cluster and all sub clusters
...
...
@@ -220,27 +220,27 @@ protected:
private:
};
inline
size_t
WHierarchicalTree
::
getLeafCount
()
inline
size_t
WHierarchicalTree
::
getLeafCount
()
const
{
return
m_leafCount
;
}
inline
size_t
WHierarchicalTree
::
getClusterCount
()
inline
size_t
WHierarchicalTree
::
getClusterCount
()
const
{
return
m_clusterCount
;
}
inline
size_t
WHierarchicalTree
::
getMaxLevel
()
inline
size_t
WHierarchicalTree
::
getMaxLevel
()
const
{
return
m_maxLevel
;
}
inline
size_t
WHierarchicalTree
::
getLevel
(
size_t
cluster
)
inline
size_t
WHierarchicalTree
::
getLevel
(
size_t
cluster
)
const
{
return
m_level
[
cluster
];
}
inline
size_t
WHierarchicalTree
::
getParent
(
size_t
cluster
)
inline
size_t
WHierarchicalTree
::
getParent
(
size_t
cluster
)
const
{
if
(
m_level
[
cluster
]
<
m_maxLevel
)
{
...
...
@@ -253,7 +253,7 @@ inline size_t WHierarchicalTree::getParent( size_t cluster )
}
}
inline
std
::
pair
<
size_t
,
size_t
>
WHierarchicalTree
::
getChildren
(
size_t
cluster
)
inline
std
::
pair
<
size_t
,
size_t
>
WHierarchicalTree
::
getChildren
(
size_t
cluster
)
const
{
if
(
m_level
[
cluster
]
>
0
)
{
...
...
@@ -266,12 +266,12 @@ inline std::pair<size_t, size_t>WHierarchicalTree::getChildren( size_t cluster )
}
}
inline
float
WHierarchicalTree
::
getCustomData
(
size_t
cluster
)
inline
float
WHierarchicalTree
::
getCustomData
(
size_t
cluster
)
const
{
return
m_customData
[
cluster
];
}
inline
size_t
WHierarchicalTree
::
size
(
size_t
cluster
)
inline
size_t
WHierarchicalTree
::
size
(
size_t
cluster
)
const
{
return
getLeafesForCluster
(
cluster
).
size
();
}
...
...
@@ -281,17 +281,17 @@ inline void WHierarchicalTree::setColor( WColor color, size_t cluster )
m_colors
[
cluster
]
=
color
;
}
inline
WColor
WHierarchicalTree
::
getColor
(
size_t
cluster
)
inline
WColor
WHierarchicalTree
::
getColor
(
size_t
cluster
)
const
{
return
m_colors
[
cluster
];
}
inline
bool
WHierarchicalTree
::
isLeaf
(
size_t
cluster
)
inline
bool
WHierarchicalTree
::
isLeaf
(
size_t
cluster
)
const
{
return
(
cluster
<
m_leafCount
)
?
true
:
false
;
}
inline
std
::
vector
<
size_t
>
WHierarchicalTree
::
getLeafesForCluster
(
size_t
cluster
)
inline
std
::
vector
<
size_t
>
WHierarchicalTree
::
getLeafesForCluster
(
size_t
cluster
)
const
{
return
m_containsLeafes
[
cluster
];
}
...
...
@@ -300,13 +300,13 @@ inline std::vector<size_t>WHierarchicalTree::getLeafesForCluster( size_t cluster
*/
struct
compSize
{
WHierarchicalTree
*
m_tree
;
//!< stores pointer to tree we work on
const
WHierarchicalTree
*
m_tree
;
//!< stores pointer to tree we work on
/**
* constructor
* \param tree
*/
explicit
compSize
(
WHierarchicalTree
*
tree
)
:
explicit
compSize
(
const
WHierarchicalTree
*
tree
)
:
m_tree
(
tree
)
{
}
...
...
src/core/common/WHistogram.cpp
View file @
a065efdb
...
...
@@ -27,7 +27,7 @@
#include "WAssert.h"
#include "WHistogram.h"
WHistogram
::
WHistogram
(
double
min
,
double
max
,
size_t
buckets
)
:
WHistogram
::
WHistogram
(
double
min
,
double
max
,
s
td
::
s
ize_t
buckets
)
:
m_minimum
(
min
),
m_maximum
(
max
),
m_nbBuckets
(
buckets
)
...
...
@@ -65,3 +65,4 @@ double WHistogram::getMaximum() const
{
return
m_maximum
;
}
src/core/common/WHistogram.h
View file @
a065efdb
...
...
@@ -25,10 +25,9 @@
#ifndef WHISTOGRAM_H
#define WHISTOGRAM_H
#include <cstddef> // for std::size_t
#include <utility>
/**
* Container which associate values with (uniform width) bins (aka intervals or buckets). This class implements the abstract interface and
* therefore builds the base class for all histogram classes. The interface also allows programming histogram of different bucket sizes.
...
...
@@ -43,7 +42,7 @@ public:
* \param max the largest value
* \param buckets the number of buckets
*/
WHistogram
(
double
min
,
double
max
,
size_t
buckets
=
1000
);
WHistogram
(
double
min
,
double
max
,
s
td
::
s
ize_t
buckets
=
1000
);
/**
* Copy constructor. Creates a deep copy of the specified histogram.
...
...
@@ -64,7 +63,7 @@ public:
*
* \return elements in the bucket.
*/
virtual
s
ize_t
operator
[](
size_t
index
)
const
=
0
;
virtual
s
td
::
size_t
operator
[](
std
::
size_t
index
)
const
=
0
;
/**
* Get the count of the specified bucket. Testing if the position is valid.
...
...
@@ -73,14 +72,14 @@ public:
*
* \return elements in the bucket
*/
virtual
s
ize_t
at
(
size_t
index
)
const
=
0
;
virtual
s
td
::
size_t
at
(
std
::
size_t
index
)
const
=
0
;
/**
* Returns the number of buckets in the histogram with the actual mapping.
*
* \return number of buckets
*/
virtual
size_t
size
()
const
;
virtual
s
td
::
s
ize_t
size
()
const
;
/**
* Returns the minimum value.
...
...
@@ -103,7 +102,7 @@ public:
*
* \return the size of a bucket.
*/
virtual
double
getBucketSize
(
size_t
index
=
0
)
const
=
0
;
virtual
double
getBucketSize
(
s
td
::
s
ize_t
index
=
0
)
const
=
0
;
/**
* Returns the actual interval associated with the given index. The interval is open, meaning that
...
...
@@ -114,7 +113,7 @@ public:
*
* \return the open interval.
*/
virtual
std
::
pair
<
double
,
double
>
getIntervalForIndex
(
size_t
index
)
const
=
0
;
virtual
std
::
pair
<
double
,
double
>
getIntervalForIndex
(
s
td
::
s
ize_t
index
)
const
=
0
;
protected:
/**
...
...
@@ -136,3 +135,4 @@ private:
};
#endif // WHISTOGRAM_H
src/core/common/WHistogramBasic.cpp
View file @
a065efdb
...
...
@@ -32,7 +32,7 @@
#include "WLimits.h"
#include "WLogger.h"
WHistogramBasic
::
WHistogramBasic
(
double
min
,
double
max
,
size_t
buckets
)
:
WHistogramBasic
::
WHistogramBasic
(
double
min
,
double
max
,
s
td
::
s
ize_t
buckets
)
:
WHistogram
(
min
,
max
,
buckets
),
m_bins
(
buckets
,
0
),
m_intervalWidth
(
std
::
abs
(
m_maximum
-
m_minimum
)
/
static_cast
<
double
>
(
m_nbBuckets
)
)
...
...
@@ -51,12 +51,12 @@ WHistogramBasic::~WHistogramBasic()
{
}
size_t
WHistogramBasic
::
operator
[](
size_t
index
)
const
size_t
WHistogramBasic
::
operator
[](
s
td
::
s
ize_t
index
)
const
{
return
m_bins
[
index
];
}
size_t
WHistogramBasic
::
at
(
size_t
index
)
const
size_t
WHistogramBasic
::
at
(
s
td
::
s
ize_t
index
)
const
{
if
(
index
>=
m_bins
.
size
()
)
{
...
...
@@ -66,39 +66,41 @@ size_t WHistogramBasic::at( size_t index ) const
return
m_bins
[
index
];
}
double
WHistogramBasic
::
getBucketSize
(
size_t
/* index */
)
const
double
WHistogramBasic
::
getBucketSize
(
s
td
::
s
ize_t
/* index */
)
const
{
return
m_intervalWidth
;
}
std
::
pair
<
double
,
double
>
WHistogramBasic
::
getIntervalForIndex
(
size_t
index
)
const
std
::
pair
<
double
,
double
>
WHistogramBasic
::
getIntervalForIndex
(
s
td
::
s
ize_t
index
)
const
{
double
first
=
m_minimum
+
m_intervalWidth
*
index
;
double
second
=
m_minimum
+
m_intervalWidth
*
(
index
+
1
);
return
std
::
make_pair
(
first
,
second
);
}
void
WHistogramBasic
::
insert
(
double
value
)
std
::
size_t
WHistogramBasic
::
insert
(
double
value
)
{
if
(
value
>
m_maximum
||
value
<
m_minimum
)
{
wlog
::
warn
(
"WHistogramBasic"
)
<<
std
::
scientific
<<
std
::
setprecision
(
16
)
<<
"Inserted value out of bounds, thread: "
<<
value
<<
" as min, resp. max: "
<<
m_minimum
<<
","
<<
m_maximum
;
return
;
// value = ( value > m_maximum ? m_maximum : m_minimum )
;
return
0u
-
1u
;
}
if
(
std
::
abs
(
m_minimum
-
m_maximum
)
<=
2.0
*
wlimits
::
DBL_EPS
)
{
m_bins
.
at
(
m_nbBuckets
-
1
)
++
;
return
m_nbBuckets
-
1
;
}
else
if
(
value
>=
(
m_maximum
-
m_intervalWidth
)
&&
value
<=
m_maximum
)
// last bin deserves extra treatment due to possbl out of bounds index
{
m_bins
.
at
(
m_nbBuckets
-
1
)
++
;
return
m_nbBuckets
-
1
;
}
else
{
m_bins
.
at
(
static_cast
<
size_t
>
(
(
value
-
m_minimum
)
/
std
::
abs
(
m_maximum
-
m_minimum
)
*
(
m_nbBuckets
)
)
)
++
;
}
std
::
size_t
bin
=
static_cast
<
std
::
size_t
>
(
(
value
-
m_minimum
)
/
std
::
abs
(
m_maximum
-
m_minimum
)
*
(
m_nbBuckets
)
);
m_bins
.
at
(
bin
)
++
;
return
bin
;
}
size_t
WHistogramBasic
::
valuesSize
()
const
...
...
src/core/common/WHistogramBasic.h
View file @
a065efdb
...
...
@@ -25,6 +25,7 @@
#ifndef WHISTOGRAMBASIC_H
#define WHISTOGRAMBASIC_H
#include <cstddef> // for std::size_t
#include <utility>
#include <vector>
...
...
@@ -45,7 +46,7 @@ public:
* \param max the largest value
* \param buckets the number of buckets
*/
WHistogramBasic
(
double
min
,
double
max
,
size_t
buckets
=
1000
);
WHistogramBasic
(
double
min
,
double
max
,
s
td
::
s
ize_t
buckets
=
1000
);
/**
* Copy constructor. Creates a deep copy of the specified histogram.
...
...
@@ -66,7 +67,7 @@ public:
*
* \return elements in the bucket.
*/
virtual
s
ize_t
operator
[](
size_t
index
)
const
;
virtual
s
td
::
size_t
operator
[](
std
::
size_t
index
)
const
;
/**
* Get the count of the specified bucket. Testing if the position is valid.
...
...
@@ -75,7 +76,7 @@ public:
*
* \return elements in the bucket
*/
virtual
s
ize_t
at
(
size_t
index
)
const
;
virtual
s
td
::
size_t
at
(
std
::
size_t
index
)
const
;
/**
* Return the size of one specific bucket.
...
...
@@ -84,7 +85,7 @@ public:
*
* \return the size of a bucket.
*/
virtual
double
getBucketSize
(
size_t
index
=
0
)
const
;
virtual
double
getBucketSize
(
s
td
::
s
ize_t
index
=
0
)
const
;
/**
* Returns the actual interval associated with the given index. The interval is open, meaning that
...
...
@@ -95,28 +96,30 @@ public:
*
* \return the open interval.
*/
virtual
std
::
pair
<
double
,
double
>
getIntervalForIndex
(
size_t
index
)
const
;
virtual
std
::
pair
<
double
,
double
>
getIntervalForIndex
(
s
td
::
s
ize_t
index
)
const
;
/**
* Computes the number of inserted values so far.
*
* \return Number of values so far.
*/
size_t
valuesSize
()
const
;
s
td
::
s
ize_t
valuesSize
()
const
;
/**
* Inserts a given value within the given range (min, max) into exactly one bin and increment its size.
*
* \param value Value to insert.
*
* \return The index of the bin the value was inserted into or the maximum size_t if it was out of range.
*/
virtual
void
insert
(
double
value
);
virtual
std
::
size_t
insert
(
double
value
);
protected:
private:
/**
* Bins to associate with the values. Each bin has the width of m_intervalWidth;
*/
std
::
vector
<
size_t
>
m_bins
;
std
::
vector
<
s
td
::
s
ize_t
>
m_bins
;
/**
* The width of an interval is precomputed to save performance.
...
...
src/core/common/math/WPlane.cpp
View file @
a065efdb
...
...
@@ -92,64 +92,6 @@ boost::shared_ptr< std::set< WPosition > > WPlane::samplePoints( double stepWidt
return
result
;
}
// boost::shared_ptr< std::set< WPosition > > WPlane::samplePoints( const WGridRegular3D& grid, double stepWidth )
// {
// // idea: start from m_pos in m_first direction until boundary reached, increment in m_second direction from m_pos and start again
// boost::shared_ptr< std::set< WPosition > > result( new std::set< WPosition >() );
//
// // the plane has two directions m_first and m_second
// const WVector3d ycrement = stepWidth * m_second;
// const WVector3d xcrement = stepWidth * m_first;
// WPosition y_offset_up = m_pos;
// WPosition y_offset_down = m_pos;
// WPosition x_offset_right = m_pos;
// WPosition x_offset_left = m_pos;
// // TODO(math): assert( grid.encloses( m_pos ) );
// while( grid.encloses( y_offset_up ) || grid.encloses( y_offset_down ) )
// {
// if( grid.encloses( y_offset_up ) ) // walk up
// {
// x_offset_right = y_offset_up;
// x_offset_left = y_offset_up;
// while( grid.encloses( x_offset_right ) || grid.encloses( x_offset_left ) )
// {
// if( grid.encloses( x_offset_right ) )
// {
// result->insert( x_offset_right );
// x_offset_right += xcrement;
// }
// if( grid.encloses( x_offset_left ) )
// {
// result->insert( x_offset_left );
// x_offset_left -= xcrement;
// }
// }
// y_offset_up += ycrement;
// }
// if( grid.encloses( y_offset_down ) ) // walk down
// {
// x_offset_right = y_offset_down;
// x_offset_left = y_offset_down;
// while( grid.encloses( x_offset_right ) || grid.encloses( x_offset_left ) )
// {
// if( grid.encloses( x_offset_right ) )
// {
// result->insert( x_offset_right );
// x_offset_right += xcrement;
// }
// if( grid.encloses( x_offset_left ) )
// {
// result->insert( x_offset_left );
// x_offset_left -= xcrement;
// }
// }
// y_offset_down -= ycrement;
// }
// }
//
// return result;
// }
WPosition
WPlane
::
getPointInPlane
(
double
x
,
double
y
)
const
{
WVector3d
sd
=
m_pos
+
...
...
src/core/common/math/principalComponentAnalysis/WCovarianceSolver.cpp
0 → 100644
View file @
a065efdb
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV-Leipzig and CNCF-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut 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 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut 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