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
b62516d7
Commit
b62516d7
authored
Dec 08, 2010
by
Mathias Goldau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CHANGE #461] Now float is used for the similarity matrix to save more space
parent
79a3fea8
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
14 deletions
+15
-14
src/common/math/WMatrixSym.h
src/common/math/WMatrixSym.h
+2
-1
src/common/math/test/WMatrixSym_test.h
src/common/math/test/WMatrixSym_test.h
+5
-5
src/modules/detTractClustering/WMDetTractClustering.cpp
src/modules/detTractClustering/WMDetTractClustering.cpp
+3
-3
src/modules/detTractClustering/WMDetTractClustering.h
src/modules/detTractClustering/WMDetTractClustering.h
+3
-3
src/modules/gaussProcesses/detTractClusteringGP/WMDetTractClusteringGP.cpp
...Processes/detTractClusteringGP/WMDetTractClusteringGP.cpp
+1
-1
src/modules/gaussProcesses/detTractClusteringGP/WMDetTractClusteringGP.h
...ssProcesses/detTractClusteringGP/WMDetTractClusteringGP.h
+1
-1
No files found.
src/common/math/WMatrixSym.h
View file @
b62516d7
...
...
@@ -167,6 +167,7 @@ inline void WMatrixSymImpl< T >::setData( const std::vector< T > &data ) throw(
m_data
=
std
::
vector
<
T
>
(
data
);
// copy content
}
typedef
WMatrixSymImpl
<
double
>
WMatrixSym
;
typedef
WMatrixSymImpl
<
double
>
WMatrixSymDBL
;
typedef
WMatrixSymImpl
<
float
>
WMatrixSymFLT
;
#endif // WMATRIXSYM_H
src/common/math/test/WMatrixSym_test.h
View file @
b62516d7
...
...
@@ -34,7 +34,7 @@
#include "../WMatrixSym.h"
/**
* Unit test this LookUp table class
* Unit test this LookUp table class
. All test performed on matrices with double as element type.
*/
class
WMatrixSymTest
:
public
CxxTest
::
TestSuite
{
...
...
@@ -44,7 +44,7 @@ public:
*/
void
testOperatorOn3x3Matrix
(
void
)
{
WMatrixSym
t
(
3
);
WMatrixSym
DBL
t
(
3
);
TS_ASSERT_EQUALS
(
t
.
m_data
.
size
(),
3
);
}
...
...
@@ -54,7 +54,7 @@ public:
*/
void
testAccessOn3x3Matrix
(
void
)
{
WMatrixSym
t
(
3
);
WMatrixSym
DBL
t
(
3
);
double
mydata
[]
=
{
1.6
,
0.2
,
7.7
};
// NOLINT
std
::
vector
<
double
>
data
(
mydata
,
mydata
+
sizeof
(
mydata
)
/
sizeof
(
double
)
);
t
.
setData
(
data
);
...
...
@@ -69,7 +69,7 @@ public:
*/
void
testSetDataWithInvalidLengthForDimension
(
void
)
{
WMatrixSym
t
(
4
);
WMatrixSym
DBL
t
(
4
);
double
mydata
[]
=
{
1.6
,
0.2
,
7.7
};
// NOLINT
std
::
vector
<
double
>
data
(
mydata
,
mydata
+
sizeof
(
mydata
)
/
sizeof
(
double
)
);
TS_ASSERT_THROWS_EQUALS
(
t
.
setData
(
data
),
WOutOfBounds
&
e
,
std
::
string
(
e
.
what
()
),
"Data vector length: 3 doesn't fit to number of rows and cols: 4"
);
// NOLINT line length
...
...
@@ -80,7 +80,7 @@ public:
*/
void
testInvalidAccessOnMainDiagonal
(
void
)
{
WMatrixSym
t
(
4
);
WMatrixSym
DBL
t
(
4
);
double
mydata
[]
=
{
1.6
,
0.2
,
7.7
};
// NOLINT
std
::
vector
<
double
>
data
(
mydata
,
mydata
+
sizeof
(
mydata
)
/
sizeof
(
double
)
);
TS_ASSERT_THROWS_EQUALS
(
t
(
0
,
0
),
WOutOfBounds
&
e
,
std
::
string
(
e
.
what
()
),
...
...
src/modules/detTractClustering/WMDetTractClustering.cpp
View file @
b62516d7
...
...
@@ -182,7 +182,7 @@ void WMDetTractClustering::update()
if
(
!
(
m_dLtTableExists
=
dLtTableExists
()
)
)
{
debugLog
()
<<
"Consider old table as invalid."
;
m_dLtTable
.
reset
(
new
WMatrixSym
(
m_tracts
->
size
()
)
);
m_dLtTable
.
reset
(
new
WMatrixSym
DBL
(
m_tracts
->
size
()
)
);
}
cluster
();
...
...
@@ -236,7 +236,7 @@ bool WMDetTractClustering::dLtTableExists()
WReaderMatrixSymVTK
r
(
dLtFileName
);
boost
::
shared_ptr
<
std
::
vector
<
double
>
>
data
(
new
std
::
vector
<
double
>
()
);
r
.
readTable
(
data
);
m_dLtTable
.
reset
(
new
WMatrixSym
(
static_cast
<
size_t
>
(
data
->
back
()
)
)
);
m_dLtTable
.
reset
(
new
WMatrixSym
DBL
(
static_cast
<
size_t
>
(
data
->
back
()
)
)
);
m_lastTractsSize
=
static_cast
<
size_t
>
(
data
->
back
()
);
// remove the dimension from data array since it's not representing any distance
...
...
@@ -452,7 +452,7 @@ bool WMDetTractClustering::OutputIDBound::accept( boost::shared_ptr< WPropertyVa
}
WMDetTractClustering
::
SimilarityMatrixComputation
::
SimilarityMatrixComputation
(
boost
::
shared_ptr
<
WMatrixSym
>
dLtTable
,
boost
::
shared_ptr
<
WMatrixSym
DBL
>
dLtTable
,
boost
::
shared_ptr
<
WDataSetFiberVector
>
tracts
,
double
proxSquare
,
const
WBoolFlag
&
shutdownFlag
)
...
...
src/modules/detTractClustering/WMDetTractClustering.h
View file @
b62516d7
...
...
@@ -187,7 +187,7 @@ private:
boost
::
shared_ptr
<
WDataSetFibers
>
m_rawTracts
;
//!< Reference to the WDataSetFibers object
boost
::
shared_ptr
<
WModuleInputData
<
WDataSetFibers
>
>
m_tractInput
;
//!< Input connector for a tract dataset.
boost
::
shared_ptr
<
WModuleOutputData
<
WFiberCluster
>
>
m_output
;
//!< Output connector for the first cluster.
boost
::
shared_ptr
<
WMatrixSym
>
m_dLtTable
;
//!< Distance matrix lookUpTable
boost
::
shared_ptr
<
WMatrixSym
DBL
>
m_dLtTable
;
//!< Distance matrix lookUpTable
boost
::
shared_ptr
<
WCondition
>
m_update
;
//!< Used for register properties indicating a rerun of the moduleMain loop
...
...
@@ -240,7 +240,7 @@ private:
* the boost::function instance
* \param shutdownFlag a bool flag indicating an abort.
*/
SimilarityMatrixComputation
(
const
boost
::
shared_ptr
<
WMatrixSym
>
dLtTable
,
SimilarityMatrixComputation
(
const
boost
::
shared_ptr
<
WMatrixSym
DBL
>
dLtTable
,
boost
::
shared_ptr
<
WDataSetFiberVector
>
tracts
,
double
proxSquare
,
const
WBoolFlag
&
shutdownFlag
);
...
...
@@ -259,7 +259,7 @@ private:
/**
* The table where the similarity computation results should be saved.
*/
boost
::
shared_ptr
<
WMatrixSym
>
m_table
;
boost
::
shared_ptr
<
WMatrixSym
DBL
>
m_table
;
/**
* Reference to the dataset of the tracts.
...
...
src/modules/gaussProcesses/detTractClusteringGP/WMDetTractClusteringGP.cpp
View file @
b62516d7
...
...
@@ -254,7 +254,7 @@ void WMDetTractClusteringGP::computeDistanceMatrix( boost::shared_ptr< const WDa
++*
progress
;
}
m_similarities
=
WMatrixSym
(
dataSet
->
size
()
);
m_similarities
=
WMatrixSym
FLT
(
dataSet
->
size
()
);
for
(
size_t
i
=
0
;
i
<
dataSet
->
size
();
++
i
)
{
for
(
size_t
j
=
i
+
1
;
j
<
dataSet
->
size
();
++
j
)
...
...
src/modules/gaussProcesses/detTractClusteringGP/WMDetTractClusteringGP.h
View file @
b62516d7
...
...
@@ -156,7 +156,7 @@ protected:
/**
* Distant matrix of all pairs of gaussian processes.
*/
WMatrixSym
m_similarities
;
WMatrixSym
FLT
m_similarities
;
private:
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment