Worksheet. More...

#include <rworksheet.h>

Collaboration diagram for RWorksheet:
[legend]

Public Member Functions

void AddCol (size_t col, const RString &label)
 
void AddLine (size_t line, const RString &label)
 
void AddValue (size_t col, size_t line, double val)
 
void DivideValue (size_t col, size_t line, double val)
 
const RNumContainer< double,
false > & 
GetCol (size_t col) const
 
RNumContainer< double, false > & GetCol (size_t col)
 
size_t GetNbLines (void)
 
double GetValue (size_t col, size_t line)
 
void InvalidValue (size_t col, size_t line)
 
void MultiplyValue (size_t col, size_t line, double val)
 
 RWorksheet (const RString &name, const RString &colname=RString::Null)
 
void Save (RTextFile &file, bool headers=true, RChar sep=';')
 
void SetValue (size_t col, size_t line, double val)
 
void SubtractValue (size_t col, size_t line, double val)
 

Protected Member Functions

RNumContainer< double, false > & Verify (size_t col, size_t line)
 

Private Attributes

RContainer< RString, true, false > ColLabels
 
RString ColName
 
RContainer< RString, true, false > LineLabels
 
RString Name
 
size_t NbLines
 
RContainer< RNumContainer
< double, false >, true, false > 
Values
 

Detailed Description

Worksheet.

The RWorksheet class provides a representation for a worksheet, i.a. a two-dimensional array of data.

In practice, it is represented by a set of lines representing different items for which different measures (columns) are computed.

Constructor & Destructor Documentation

RWorksheet ( const RString name,
const RString colname = RString::Null 
)

Constructor.

Parameters
nameName of the statistics.
colnameName of the first column.

Member Function Documentation

RNumContainer<double,false>& Verify ( size_t  col,
size_t  line 
)
protected

Verify that a given value is initialized.

Parameters
colColumn.
lineLine.
Returns
Reference to the vector corresponding to the column.
size_t GetNbLines ( void  )
Returns
number of lines added.
void AddCol ( size_t  col,
const RString label 
)

Add a column to the statistics.

Parameters
colColumn to add.
labelLabel to assign.
Warning
The column 0 corresponds to the first values and not the labels of the lines.
void AddLine ( size_t  line,
const RString label 
)

Add a line to the statistics.

Parameters
lineLine to add.
labelLabel to assign if it is a new line.
void InvalidValue ( size_t  col,
size_t  line 
)

Invalid a given value.

Parameters
colColumn.
lineLine.
double GetValue ( size_t  col,
size_t  line 
)

Get a given value.

Parameters
colColumn.
lineLine.
void SetValue ( size_t  col,
size_t  line,
double  val 
)

Set a given value.

Parameters
colColumn.
lineLine.
valValue.
void AddValue ( size_t  col,
size_t  line,
double  val 
)

Add a given value.

Parameters
colColumn.
lineLine.
valValue.
void SubtractValue ( size_t  col,
size_t  line,
double  val 
)

Subtract a given value.

Parameters
colColumn.
lineLine.
valValue.
void MultiplyValue ( size_t  col,
size_t  line,
double  val 
)

Multiply a given value.

Parameters
colColumn.
lineLine.
valValue.
void DivideValue ( size_t  col,
size_t  line,
double  val 
)

Divide a given value.

Parameters
colColumn.
lineLine.
valValue.
const RNumContainer<double,false>& GetCol ( size_t  col) const

Get the values of a column.

Parameters
colColumn.
Returns
a reference to the vector.
RNumContainer<double,false>& GetCol ( size_t  col)

Get the values of a column.

Parameters
colColumn.
Returns
a reference to the vector.
void Save ( RTextFile file,
bool  headers = true,
RChar  sep = ';' 
)

Save the statistics in an opened file as CVS file.

Parameters
fileFile where to store.
headersMust the headers be stored.
sepSeparate character.

Member Data Documentation

RString Name
private

Name of the statistics.

RString ColName
private

Name of the first column.

RContainer<RString,true,false> LineLabels
private

Labels of the Lines.

RContainer<RString,true,false> ColLabels
private

Labels of the Cols.

RContainer<RNumContainer<double,false>,true,false> Values
private

The values stored as columns of numbers.

size_t NbLines
private

Number of lines.