Allow maximum number of particles to be configured.

This commit is contained in:
2018-04-09 16:43:40 +02:00
parent 1c942a7de7
commit 0145391450
4 changed files with 29 additions and 2 deletions

View File

@@ -3,6 +3,7 @@
#include <boost/program_options.hpp>
#include <glog/logging.h>
#include "Options.hpp"
#include "visualisations.hpp"
using namespace fmri;
@@ -92,6 +93,7 @@ Options::Options(int argc, char * const argv[]):
("layer-opacity", value_for(layerTransparancy_), "Opacity for layers")
("interaction-opacity", value_for(interactionTransparancy_), "Opacity for interactions")
("layer-distance", value_for(LAYER_X_OFFSET), "Distance between layers")
("interaction-limit", value_for(INTERACTION_LIMIT), "Maximum number of interactions per layer")
("dump,d", value<std::string>(&dumpPath), "dump convolutional images in this directory");
options_description composed = desc;

View File

@@ -14,8 +14,7 @@
using namespace fmri;
using namespace std;
// Maximum number of interactions shown
static constexpr size_t INTERACTION_LIMIT = 10000;
std::size_t fmri::INTERACTION_LIMIT = 10000;
typedef vector<pair<float, pair<size_t, size_t>>> EntryList;

View File

@@ -6,6 +6,20 @@
#include "LayerInfo.hpp"
namespace fmri {
/**
* Maximum number of interactions per layer.
*
* Controls the number of interactions per layer for performance
* reasons. Only the top INTERACTION_LIMIT interactions are shown
* to limit the amount of computations needed for animation.
*
* Note that this number currently applies only to InnerProduct
* type layers.
*
* This value is set from the options parser.
*/
extern std::size_t INTERACTION_LIMIT;
/**
* Generate a static visualisation of a layer state.
*