linbox
Public Member Functions
PlotData Class Reference

The raw data to plot. More...

#include <benchmark.h>

Public Member Functions

const DataSeriesgetSeries (const index_t &i) const
 Returns the ith series of measurements. More...
 
const DataSeriesselectSeries (const index_t &i)
 Returns the ith series of measurements. More...
 
const DataSeriesselectSeries (const std::string &name)
 Returns the series of measurements after its name. More...
 
const DataSeriesgetCurrentSeries () const
 Returns the current series of measurements.
 
DataSeriesrefSeries (const index_t &i)
 Returns the ith series of measurements. More...
 
DataSeriesrefSeries (const std::string &nom)
 Returns the ith series of measurements. More...
 
DataSeriesrefCurrentSeries ()
 Returns the current series of measurements.
 
 PlotData ()
 Inits a plot with series of data. More...
 
 ~PlotData ()
 destructor.
 
 PlotData (const PlotData &PD)
 copy constructor. More...
 
void clear ()
 initialize to empty
 
void merge (const PlotData &PD)
 merges another plot data to the current one. More...
 
index_t size () const
 get the number of series. More...
 
index_t getCurrentSerieNumber () const
 gets the current series number.
 
void setSerieName (const index_t &i, const std::string &nom)
 Sets the name of a serie. More...
 
const std::string & getSerieName (const index_t &i) const
 Gets the name of a serie. More...
 
const std::string & getCurrentSerieName () const
 Gets the name of the current serie.
 
void setCurrentSerieName (const std::string &nom)
 Sets the name of the current serie. More...
 
void initWatch (const index_t &i)
 Inits the watch on a series. More...
 
void initCurrentSeriesWatch ()
 Inits the watch to current series.
 
void newSerie (const std::string &nom="")
 Creates a new series. More...
 
void finishSerie ()
 Finish a serie of measurements. More...
 
index_t getSerieSize (const index_t &i) const
 size of a series. More...
 
index_t getCurrentSerieSize () const
 size of the current series.
 
bool selectNextSeries ()
 goes to the next series of points
 
void selectFirstSeries ()
 selects the first series
 
template<class T >
void setSeriesPointLabel (const index_t &i, const index_t &j, const T &nom)
 Sets the name of a point. More...
 
void setCurrentSeriesPointLabel (const index_t &j, const std::string &nom)
 Sets the name of a point. More...
 
std::string getSerieLabel (const index_t &i) const
 gets the name of a serie. More...
 
std::string getCurrentSerieLabel () const
 gets the name of a serie. More...
 
const svector_t & getSerieLabels () const
 gets all the names in the series. More...
 
void setSeriesEntry (const index_t &i, const std::string &nam, const double &val, const double &xval=NAN, const double &yval=NAN)
 sets a new entry. More...
 
void setSeriesEntry (const std::string &nom, const std::string &nam, const double &val, const double &xval=NAN, const double &yval=NAN)
 sets a new entry. More...
 
template<class T >
void setCurrentSeriesEntry (const T &nam, const double &val, const double &xval=NAN, const double &yval=NAN)
 sets a new entry. More...
 
const std::vector< DataSeries > & getTable () const
 gets a reference to the array of data. More...
 
std::vector< DataSeries > & refTable ()
 gets a reference to the array of data. More...
 
bool keepon (index_t &repet, double tim, bool usePrediction=false)
 Continue for another time measure ? More...
 
void save (const std::string &filename, const std::string &title="", const std::string &xtitle="", const std::string &ytitle="")
 saves the data in XML format. More...
 
const std::string & getCurrentEntryId () const
 returns the unique ID of the current series last entry
 
const std::string & getCurrentSeriesId (const index_t &j) const
 returns the unique ID of the current series j'th entry. More...
 
const std::string & getId (const index_t &i, const index_t &j)
 returns the unique ID of the i'th series j'th entry. More...
 
const std::string & getId (const std::string &name, const index_t &j)
 returns the unique ID of the i'th series j'th entry. More...
 

Detailed Description

The raw data to plot.

Represents the labels for the points (X axis) and the values for each series of measures (Y axis).

Members that set/get are named as follows :

Members are also named as follows :

Constructor & Destructor Documentation

PlotData ( )

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 PD)

copy constructor.

Parameters
PDa PlotData to copy.

Member Function Documentation

const DataSeries & getSeries ( const index_t &  i) const

Returns the ith series of measurements.

Parameters
iith series to be returned
const DataSeries & selectSeries ( const index_t &  i)

Returns the ith series of measurements.

Parameters
iith series to be returned
const DataSeries & selectSeries ( const std::string &  name)

Returns the series of measurements after its name.

Parameters
nomname of series to be returned
DataSeries & refSeries ( const index_t &  i)

Returns the ith series of measurements.

Parameters
iith series to be returned
DataSeries & refSeries ( const std::string &  nom)

Returns the ith series of measurements.

Parameters
iith series to be returned
void merge ( const PlotData PD)

merges another plot data to the current one.

(just adds to the end, does not merge series by name yet)

index_t size ( ) const

get the number of series.

Returns
number of series.
void setSerieName ( const index_t &  i,
const std::string &  nom 
)

Sets the name of a serie.

Parameters
iindex of the serie
nomname of the serie
const std::string & getSerieName ( const index_t &  i) const

Gets the name of a serie.

Parameters
iindex of the serie
void setCurrentSerieName ( const std::string &  nom)

Sets the name of the current serie.

Parameters
nomname of the serie
void initWatch ( const index_t &  i)

Inits the watch on a series.

Parameters
iindex of a series
void newSerie ( const std::string &  nom = "")

Creates a new series.

It is created after the last series. getCurrentSeries() points to it.

Parameters
nomname of the new series
void finishSerie ( )

Finish a serie of measurements.

Nothing is done for the moment.

index_t getSerieSize ( const index_t &  i) const

size of a series.

Parameters
iindex of the series
void setSeriesPointLabel ( const index_t &  i,
const index_t &  j,
const T &  nom 
)
inline

Sets the name of a point.

Parameters
iseries number
jindex for the the point
nomname of the point
void setCurrentSeriesPointLabel ( const index_t &  j,
const std::string &  nom 
)

Sets the name of a point.

Parameters
jindex for the the point
nomname of the point
std::string getSerieLabel ( const index_t &  i) const

gets the name of a serie.

Defaults to "serie.i"

Parameters
iits index.
Returns
its name.
std::string getCurrentSerieLabel ( ) const

gets the name of a serie.

Defaults to "serie.i"

Parameters
iits index.
Returns
its name.
const svector_t & getSerieLabels ( ) const

gets all the names in the series.

Returns
a vector of names.
void setSeriesEntry ( const index_t &  i,
const std::string &  nam,
const double &  val,
const double &  xval = NAN,
const double &  yval = NAN 
)

sets a new entry.

Parameters
iindex of the series
jindex of the point
namname of the point (eg size of the matrix, name of a sparse matrix,...)
valvalue to be inserted (eg mflops, sec,...).
xvalx value of the point (eg size of the matrix, of a sparse matrix,...)
yvaltime for this computation (seconds)
void setSeriesEntry ( const std::string &  nom,
const std::string &  nam,
const double &  val,
const double &  xval = NAN,
const double &  yval = NAN 
)

sets a new entry.

Parameters
namename of the series
jindex of the point
namname of the point (eg size of the matrix, name of a sparse matrix,...)
valvalue to be inserted (eg mflops, sec,...).
xvalx value of the point (eg size of the matrix, of a sparse matrix,...)
yvaltime for this computation (seconds)
void setCurrentSeriesEntry ( const T &  nam,
const double &  val,
const double &  xval = NAN,
const double &  yval = NAN 
)
inline

sets a new entry.

Parameters
jindex of the point
namname of the point (eg size of the matrix, name of a sparse matrix,...)
valvalue to be inserted (eg mflops, sec,...).
const std::vector< DataSeries > & getTable ( ) const

gets a reference to the array of data.

Returns
a reference to the member tableau representing the data.
std::vector< DataSeries > & refTable ( )

gets a reference to the array of data.

Returns
a reference to the member tableau representing the data.
bool keepon ( index_t &  repet,
double  tim,
bool  usePrediction = false 
)

Continue for another time measure ?

See Also
TimeWatcher::keepon
Parameters
repetcurrent number of repetitions for this new measure
timtime previously spent on the measures.
Returns
true if one more measure can be done
void save ( const std::string &  filename,
const std::string &  title = "",
const std::string &  xtitle = "",
const std::string &  ytitle = "" 
)

saves the data in XML format.

Parameters
filenamefile name
titletitles of the data
xtitlelegend of the X axis
ytitlelegend of the Y axis.
const std::string& getCurrentSeriesId ( const index_t &  j) const
inline

returns the unique ID of the current series j'th entry.

Parameters
jindex of the entry.
const std::string& getId ( const index_t &  i,
const index_t &  j 
)
inline

returns the unique ID of the i'th series j'th entry.

Parameters
iindex of the series.
jindex of the entry.
const std::string& getId ( const std::string &  name,
const index_t &  j 
)
inline

returns the unique ID of the i'th series j'th entry.

Parameters
iindex of the series.
jindex of the entry.

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