Commit d0e51620 authored by Alexander Wiebel's avatar Alexander Wiebel

[MERGE]

parents 890f3ab9 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
......@@ -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 );
WMatrixSymDBL t( 3 );
TS_ASSERT_EQUALS( t.m_data.size(), 3 );
}
......@@ -54,7 +54,7 @@ public:
*/
void testAccessOn3x3Matrix( void )
{
WMatrixSym t( 3 );
WMatrixSymDBL 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 );
WMatrixSymDBL 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 );
WMatrixSymDBL 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() ),
......
......@@ -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 WMatrixSymDBL( 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 WMatrixSymDBL( 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< WMatrixSymDBL > dLtTable,
boost::shared_ptr< WDataSetFiberVector > tracts,
double proxSquare,
const WBoolFlag& shutdownFlag )
......
......@@ -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< WMatrixSymDBL > 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< WMatrixSymDBL > 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< WMatrixSymDBL > m_table;
/**
* Reference to the dataset of the tracts.
......
......@@ -254,7 +254,7 @@ void WMDetTractClusteringGP::computeDistanceMatrix( boost::shared_ptr< const WDa
++*progress;
}
m_similarities = WMatrixSym( dataSet->size() );
m_similarities = WMatrixSymFLT( dataSet->size() );
for( size_t i = 0; i < dataSet->size(); ++i )
{
for( size_t j = i + 1; j < dataSet->size(); ++j )
......
......@@ -156,7 +156,7 @@ protected:
/**
* Distant matrix of all pairs of gaussian processes.
*/
WMatrixSym m_similarities;
WMatrixSymFLT m_similarities;
private:
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment