linbox
Public Member Functions
PlotData< NAM > Class Template Reference

The raw data to plot. More...

#include <benchmark.h>

Public Member Functions

 PlotData (index_t nb_pts, index_t nb_srs=1)
 Inits a plot with series of data. More...
 
 ~PlotData ()
 destructor.
 
 PlotData (const PlotData< NAM > &PD)
 copy constructor. More...
 
index_t getSeriesDim ()
 get the number of series. More...
 
index_t getPointsDim ()
 get the common number of points in each serie. More...
 
void setSerieName (index_t i, std::string nom)
 Sets the name of a serie. More...
 
void setAbsciName (index_t j, NAM nom)
 Sets the name of a point. More...
 
std::string getSerieName (index_t i)
 gets the name of a serie. More...
 
NAM getAbsciName (index_t j)
 gets the name of a point. More...
 
std::vector< std::string > getSerieNames ()
 gets all the names in the series. More...
 
std::vector< NAM > getAbsciNames ()
 gets all the names in the points. More...
 
void resizeSeries (index_t &n)
 modifies the number of series. More...
 
void resizePoints (index_t &n)
 modifies the number of points. More...
 
void setEntry (index_t i, index_t j, double val)
 sets a new entry. More...
 
double getEntry (index_t i, index_t j)
 gets a value for an entry. More...
 
std::vector< std::vector< float > > & getTable ()
 gets a reference to the array of data. More...
 

Detailed Description

template<class NAM>
class LinBox::PlotData< NAM >

The raw data to plot.

Represents the series of points and the labels for the points (X) axis and the series (Y) axis. The internal representation is a vector of vector, each series of point being a vector of double.

Template Parameters
NAMthe X axis is parametered by NAM (string, int, double...)
Todo:
write members that permute, add, scale,... data.

Constructor & Destructor Documentation

PlotData ( index_t  nb_pts,
index_t  nb_srs = 1 
)
inline

Inits a plot with series of data.

Parameters
nb_ptsnumber of points in each serie.
nb_srsnumber of series of points. Default is 1.
PlotData ( const PlotData< NAM > &  PD)
inline

copy constructor.

Parameters
PDa PlotData to copy.

Member Function Documentation

index_t getSeriesDim ( )
inline

get the number of series.

Returns
number of series.
index_t getPointsDim ( )
inline

get the common number of points in each serie.

Returns
number of points.
void setSerieName ( index_t  i,
std::string  nom 
)
inline

Sets the name of a serie.

Parameters
iindex of the serie
nomname of the serie
void setAbsciName ( index_t  j,
NAM  nom 
)
inline

Sets the name of a point.

Parameters
jindex for the the point
nomname of the point
std::string getSerieName ( index_t  i)
inline

gets the name of a serie.

Defaults to "serie.i"

Parameters
iits index.
Returns
its name.
NAM getAbsciName ( index_t  j)
inline

gets the name of a point.

Parameters
jits index.
Returns
its name.
Warning
no default. setAbsciName has to be used beforehands.
std::vector<std::string > getSerieNames ( )
inline

gets all the names in the series.

Returns
a vector of names.
std::vector<NAM > getAbsciNames ( )
inline

gets all the names in the points.

Returns
a vector of names.
void resizeSeries ( index_t &  n)
inline

modifies the number of series.

Parameters
nthe new number of series. Some data will be lost if n is smaller than the current size.
void resizePoints ( index_t &  n)
inline

modifies the number of points.

Parameters
nthe new number of points in every series. Some data will be lost if n is smaller than the current size.
void setEntry ( index_t  i,
index_t  j,
double  val 
)
inline

sets a new entry.

Parameters
iindex of the serie
jindex of the point
valvalue to be inserted.
double getEntry ( index_t  i,
index_t  j 
)
inline

gets a value for an entry.

Parameters
iindex of the serie
jindex of the point
Returns
val value of point j in serie j.
std::vector<std::vector< float > >& getTable ( )
inline

gets a reference to the array of data.

Returns
a reference to the member tableau representing the data.

The documentation for this class was generated from the following file: