Commit b46f4c5c authored by Stefan Philips's avatar Stefan Philips

[FIX] Remove some compiler warning and fix coding style

parent 0c51deba
......@@ -322,8 +322,10 @@ WMatrix_2 pseudoInverse( const WMatrix_2& input )
// create diagonal matrix S
WMatrix_2 S( input.cols(), input.cols() );
S.setZero();
for ( size_t i = 0; i < Svec.size() && i < S.rows() && i < S.cols(); i++ )
S( i, i ) = ( Svec[ i ] == 0.0 ) ? 0.0 : 1.0 / Svec[ i ];
for ( int i = 0; i < Svec.size() && i < S.rows() && i < S.cols(); i++ )
{
S( i, i ) = ( Svec[ i ] == 0.0 ) ? 0.0 : 1.0 / Svec[ i ];
}
return WMatrix_2( V*S*U.transpose() );
}
......@@ -452,7 +452,7 @@ void WSymmetricSphericalHarmonic::normalize()
double scale = 0.0;
if ( m_SHCoefficients.size() > 0 )
scale = std::sqrt( 4.0 * piDouble ) * m_SHCoefficients[0];
for ( size_t i = 0; i < m_SHCoefficients.size(); i++ )
for ( int i = 0; i < m_SHCoefficients.size(); i++ )
{
m_SHCoefficients[ i ] /= scale;
}
......
......@@ -339,7 +339,7 @@ public:
*/
WVector_2 toWVector()
{
WVector_2 result ( m_components.size() );
WVector_2 result( m_components.size() );
for ( size_t i = 0; i < m_components.size(); ++i )
{
result( i ) = static_cast<double>( m_components[ i ] );
......
......@@ -142,21 +142,21 @@ public:
WVector3D( osg::Vec3d::value_type x, osg::Vec3d::value_type y, osg::Vec3d::value_type z );
// NOTE: osg::Vec3d members made deprecated.
OW_API_DEPRECATED double length() const { return osg::Vec3d::length(); }
OW_API_DEPRECATED double length2() const { return osg::Vec3d::length2(); }
OW_API_DEPRECATED double normalize() { return osg::Vec3d::normalize(); }
OW_API_DEPRECATED void set (double x, double y, double z) { osg::Vec3d::set( x, y, z ); }
OW_API_DEPRECATED void set (const Vec3d &rhs) { osg::Vec3d::set( rhs ); }
OW_API_DEPRECATED double & operator[] (int i) { return osg::Vec3d::operator[]( i ); }
OW_API_DEPRECATED double operator[] (int i) const { return osg::Vec3d::operator[]( i ); }
OW_API_DEPRECATED double & x () { return osg::Vec3d::x(); }
OW_API_DEPRECATED double & y () { return osg::Vec3d::y(); }
OW_API_DEPRECATED double & z () { return osg::Vec3d::z(); }
OW_API_DEPRECATED double x () const { return osg::Vec3d::x(); }
OW_API_DEPRECATED double y () const { return osg::Vec3d::y(); }
OW_API_DEPRECATED double z () const { return osg::Vec3d::z(); }
OW_API_DEPRECATED bool valid() const { return osg::Vec3d::valid(); }
OW_API_DEPRECATED bool isNaN() const { return osg::Vec3d::isNaN(); }
OW_API_DEPRECATED double length() const { return osg::Vec3d::length(); } // NOLINT
OW_API_DEPRECATED double length2() const { return osg::Vec3d::length2(); } // NOLINT
OW_API_DEPRECATED double normalize() { return osg::Vec3d::normalize(); } // NOLINT
OW_API_DEPRECATED void set (double x, double y, double z) { osg::Vec3d::set( x, y, z ); } // NOLINT
OW_API_DEPRECATED void set (const Vec3d &rhs) { osg::Vec3d::set( rhs ); } // NOLINT
OW_API_DEPRECATED double & operator[] (int i) { return osg::Vec3d::operator[]( i ); } // NOLINT
OW_API_DEPRECATED double operator[] (int i) const { return osg::Vec3d::operator[]( i ); } // NOLINT
OW_API_DEPRECATED double & x () { return osg::Vec3d::x(); } // NOLINT
OW_API_DEPRECATED double & y () { return osg::Vec3d::y(); } // NOLINT
OW_API_DEPRECATED double & z () { return osg::Vec3d::z(); } // NOLINT
OW_API_DEPRECATED double x () const { return osg::Vec3d::x(); } // NOLINT
OW_API_DEPRECATED double y () const { return osg::Vec3d::y(); } // NOLINT
OW_API_DEPRECATED double z () const { return osg::Vec3d::z(); } // NOLINT
OW_API_DEPRECATED bool valid() const { return osg::Vec3d::valid(); } // NOLINT
OW_API_DEPRECATED bool isNaN() const { return osg::Vec3d::isNaN(); } // NOLINT
/**
* Calculate Euclidean square distance between this Position and another one.
......
......@@ -200,16 +200,16 @@ public:
computeSVD( A, U, V, Svec );
WMatrix_2 S( Svec.size(), Svec.size() );
S.setZero();
for ( size_t i = 0; i < Svec.size(); ++i )
for ( int i = 0; i < Svec.size(); ++i )
{
S( i, i ) = Svec( i );
}
WMatrix_2 A2( U*S*V.transpose() );
for ( size_t row = 0; row < A.rows(); ++row )
for ( int row = 0; row < A.rows(); ++row )
{
for ( size_t col = 0; col < A.cols(); ++col )
for ( int col = 0; col < A.cols(); ++col )
{
TS_ASSERT_DELTA( A( row, col ), A2( row, col ), 0.0001 );
}
......
......@@ -168,7 +168,7 @@ public:
WVectorComplex_2 values2 = sh.getCoefficientsComplex();
WMatrixComplex_2 complexBaseMatrix = WSymmetricSphericalHarmonic::calcComplexBaseMatrix( orientations, 4 );
WVectorComplex_2 res = complexBaseMatrix * values2;
for( std::size_t k = 0; k < orientations.size(); ++k )
......
......@@ -392,8 +392,8 @@ WSymmetricSphericalHarmonic WMBermanTracking::createRandomODF( std::size_t i )
{
WSymmetricSphericalHarmonic h = m_dataSet->getSphericalHarmonicAt( i );
WAssert( h.getOrder() >= 4, "" );
WAssert( m_HMat.rows() == m_dataSetResidual->getNumberOfMeasurements(), "" );
WAssert( m_HMat.cols() == m_dataSetResidual->getNumberOfMeasurements(), "" );
WAssert( m_HMat.rows() == static_cast< int >( m_dataSetResidual->getNumberOfMeasurements() ), "" );
WAssert( m_HMat.cols() == static_cast< int >( m_dataSetResidual->getNumberOfMeasurements() ), "" );
WAssert( m_frtMat.rows() == 15, "" );
WAssert( m_frtMat.cols() == 15, "" );
......@@ -409,7 +409,7 @@ WSymmetricSphericalHarmonic WMBermanTracking::createRandomODF( std::size_t i )
// calc hardi data from sh + residual
WMatrix_2 v = m_BMat * m;
WAssert( v.rows() == m_dataSetResidual->getNumberOfMeasurements(), "" );
WAssert( v.rows() == static_cast< int >( m_dataSetResidual->getNumberOfMeasurements() ), "" );
WMatrix_2 q( v.rows(), 1 );
q.setZero();
......
......@@ -154,7 +154,7 @@ void WMTeemGlyphs::connectors()
void WMTeemGlyphs::properties()
{
m_exceptionCondition = boost::shared_ptr< WCondition >( new WCondition() );
m_sliceOrientations = boost::shared_ptr< WItemSelection >( new WItemSelection() );
m_sliceOrientations->addItem( "x", "x-slice" );
m_sliceOrientations->addItem( "y", "y-slice" );
......
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