HyperPlot
v1
Bin and visualise multidimensional datasets
|
HyperPlot, Author: Sam Harnew, sam.h , Date: Dec 2015 arne w@gma il.c om
Holds a vector of weights that is associtated to a HyperPoint via inheritance (sometimes useful to have more than one for systematic studies)
#include <Weights.h>
Public Member Functions | |
Weights () | |
Weights (double weight) | |
int | numWeights () const |
const std::vector< double > & | getWeightsVector () |
void | printWeight (std::ostream &os=std::cout, int endline=1) const |
double | getWeight (int i=0) const |
void | setWeight (int i, double w) |
void | setWeight (double w) |
void | addWeight (const double &weight) |
Protected Attributes | |
std::vector< double > | _weights |
Weights::Weights | ( | ) |
Empty constructor
Definition at line 5 of file Weights.cpp.
Weights::Weights | ( | double | weight | ) |
Construct instance with a single weight (probably the most used scenario)
Definition at line 12 of file Weights.cpp.
void Weights::addWeight | ( | const double & | weight | ) |
Add weight to the end of the weight vector
Definition at line 71 of file Weights.cpp.
double Weights::getWeight | ( | int | i = 0 | ) | const |
Get weight i. If no weights exist just return 1.0.
Definition at line 40 of file Weights.cpp.
|
inline |
int Weights::numWeights | ( | ) | const |
How many weights have been stored
Definition at line 20 of file Weights.cpp.
void Weights::printWeight | ( | std::ostream & | os = std::cout , |
int | endline = 1 |
||
) | const |
print weights to specified ostream (default is cout)
Definition at line 26 of file Weights.cpp.
void Weights::setWeight | ( | int | i, |
double | w | ||
) |
Set weight i to specified value - if this weight doesn't yet exist, keep adding weights of 1.0 until it does
Definition at line 52 of file Weights.cpp.
void Weights::setWeight | ( | double | w | ) |
Set weight i=0 to desired value
Definition at line 65 of file Weights.cpp.
|
protected |