Commit a065efdb authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[MERGE]

parents f9cbde3a 44a48363
......@@ -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_________
......
......@@ -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
......
......@@ -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

206 KB | W: | H:

artwork/Splash/splash.png

1.27 MB | W: | H:

artwork/Splash/splash.png
artwork/Splash/splash.png
artwork/Splash/splash.png
artwork/Splash/splash.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -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
......
......@@ -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
......
......@@ -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 */ );
......
......@@ -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 )
{
......
......@@ -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 )
{
}
......
......@@ -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, std::size_t buckets ):
m_minimum( min ),
m_maximum( max ),
m_nbBuckets( buckets )
......@@ -65,3 +65,4 @@ double WHistogram::getMaximum() const
{
return m_maximum;
}
......@@ -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, std::size_t buckets = 1000 );
/**
* Copy constructor. Creates a deep copy of the specified histogram.
......@@ -64,7 +63,7 @@ public:
*
* \return elements in the bucket.
*/
virtual size_t operator[]( size_t index ) const = 0;
virtual std::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 size_t at( size_t index ) const = 0;
virtual std::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 std::size_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( std::size_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( std::size_t index ) const = 0;
protected:
/**
......@@ -136,3 +135,4 @@ private:
};
#endif // WHISTOGRAM_H
......@@ -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, std::size_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[]( std::size_t index ) const
{
return m_bins[ index ];
}
size_t WHistogramBasic::at( size_t index ) const
size_t WHistogramBasic::at( std::size_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( std::size_t /* index */ ) const
{
return m_intervalWidth;
}
std::pair< double, double > WHistogramBasic::getIntervalForIndex( size_t index ) const
std::pair< double, double > WHistogramBasic::getIntervalForIndex( std::size_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
......
......@@ -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, std::size_t buckets = 1000 );
/**
* Copy constructor. Creates a deep copy of the specified histogram.
......@@ -66,7 +67,7 @@ public:
*
* \return elements in the bucket.
*/
virtual size_t operator[]( size_t index ) const;
virtual std::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 size_t at( size_t index ) const;
virtual std::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( std::size_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( std::size_t index ) const;
/**
* Computes the number of inserted values so far.
*
* \return Number of values so far.
*/
size_t valuesSize() const;
std::size_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< std::size_t > m_bins;
/**
* The width of an interval is precomputed to save performance.
......
......@@ -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 +
......
//---------------------------------------------------------------------------
//
// 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