Worksheet. More...
#include <rworksheet.h>
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
-
name Name of the statistics. colname Name of the first column.
Member Function Documentation
|
protected |
Verify that a given value is initialized.
- Parameters
-
col Column. line Line.
- 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
-
col Column to add. label Label 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
-
line Line to add. label Label to assign if it is a new line.
void InvalidValue | ( | size_t | col, |
size_t | line | ||
) |
Invalid a given value.
- Parameters
-
col Column. line Line.
double GetValue | ( | size_t | col, |
size_t | line | ||
) |
Get a given value.
- Parameters
-
col Column. line Line.
void SetValue | ( | size_t | col, |
size_t | line, | ||
double | val | ||
) |
Set a given value.
- Parameters
-
col Column. line Line. val Value.
void AddValue | ( | size_t | col, |
size_t | line, | ||
double | val | ||
) |
Add a given value.
- Parameters
-
col Column. line Line. val Value.
void SubtractValue | ( | size_t | col, |
size_t | line, | ||
double | val | ||
) |
Subtract a given value.
- Parameters
-
col Column. line Line. val Value.
void MultiplyValue | ( | size_t | col, |
size_t | line, | ||
double | val | ||
) |
Multiply a given value.
- Parameters
-
col Column. line Line. val Value.
void DivideValue | ( | size_t | col, |
size_t | line, | ||
double | val | ||
) |
Divide a given value.
- Parameters
-
col Column. line Line. val Value.
const RNumContainer<double,false>& GetCol | ( | size_t | col | ) | const |
Get the values of a column.
- Parameters
-
col Column.
- Returns
- a reference to the vector.
RNumContainer<double,false>& GetCol | ( | size_t | col | ) |
Get the values of a column.
- Parameters
-
col Column.
- Returns
- a reference to the vector.
Save the statistics in an opened file as CVS file.
- Parameters
-
file File where to store. headers Must the headers be stored. sep Separate character.
Member Data Documentation
|
private |
Name of the statistics.
|
private |
Name of the first column.
|
private |
Labels of the Lines.
|
private |
Labels of the Cols.
|
private |
The values stored as columns of numbers.
|
private |
Number of lines.