Biomedical Image Analysis Library
The Biomedical Image Analysis Library is a poweful tool for developers, physicians, researchers, engineers, and so on.
Bial::Table Class Reference

#include <Table.hpp>

Collaboration diagram for Bial::Table:
Collaboration graph

Public Member Functions

 Table ()
 Basic Constructor. More...
 
 Table (const Matrix< int > &mtx, bool col_name=false, bool row_name=false)
 Constructor from matrix. Each columns is converted to the table with appropriated type. More...
 
 Table (const Matrix< float > &mtx, bool col_name=false, bool row_name=false)
 Constructor from matrix. Each columns is converted to the table with appropriated type. More...
 
 Table (const Matrix< std::string > &mtx, bool col_name=false, bool row_name=false)
 Constructor from matrix. Each columns is converted to the table with appropriated type. More...
 
void PushBack (const Vector< int > &vct)
 Pushes back a vector to the end of the list. More...
 
void PushBack (const Vector< float > &vct)
 Pushes back a vector to the end of the list. More...
 
void PushBack (const Vector< std::string > &vct)
 Pushes back a vector to the end of the list. More...
 
void PushBack (const TableColumn &vct)
 Pushes back a vector to the end of the list. More...
 
const TableColumnoperator[] (size_t p) const
 Returns a constant reference of data pointed by index p. It has the same effect as operator data( p ). More...
 
TableColumnoperator[] (size_t p)
 Returns the reference for data pointed by index p. It has the same effect as operator data( p ). More...
 
const TableColumnoperator() (size_t p) const
 Returns a constant reference of data pointed by index p. It has the same effect as operator data( p ). More...
 
TableColumnoperator() (size_t p)
 Returns the reference for data pointed by index p. It has the same effect as operator data( p ). More...
 
const TableCelloperator() (size_t col, size_t row) const
 Returns a constant reference of data pointed by indexes col, row. More...
 
TableCelloperator() (size_t col, size_t row)
 Returns the reference for data pointed by indexes col, row. More...
 
size_t Rows () const
 Returns the number of rows in table. More...
 
size_t Columns () const
 Returns the number of columns in table. More...
 
void Write (std::string filename) const
 Writes table containts into a file. More...
 
template<class O >
O & Print (O &os, bool transpose=false) const
 Prints table containts to output stream os. More...
 
template<class O >
O & PrintDimensions (O &os) const
 Prints table dimensions to output stream os. More...
 

Protected Attributes

Vector< TableColumn_data
 

Detailed Description

Definition at line 216 of file Table.hpp.

Constructor & Destructor Documentation

Bial::Table::Table ( )

Basic Constructor.

Date
2015/May/22
Parameters
none.
Returns
none.
Warning
null table.
Bial::Table::Table ( const Matrix< int > &  mtx,
bool  col_name = false,
bool  row_name = false 
)

Constructor from matrix. Each columns is converted to the table with appropriated type.

Date
2015/May/22
Parameters
mtxSource maitrix to be copied.
col_nameset first column as name.
row_nameset first row as name.
Returns
none.
Warning
Must be a matrix of numbers integers or floating points.
Bial::Table::Table ( const Matrix< float > &  mtx,
bool  col_name = false,
bool  row_name = false 
)

Constructor from matrix. Each columns is converted to the table with appropriated type.

Date
2015/May/22
Parameters
mtxSource maitrix to be copied.
col_nameset first column as name.
row_nameset first row as name.
Returns
none.
Warning
Must be a matrix of numbers integers or floating points.
Bial::Table::Table ( const Matrix< std::string > &  mtx,
bool  col_name = false,
bool  row_name = false 
)

Constructor from matrix. Each columns is converted to the table with appropriated type.

Date
2015/May/22
Parameters
mtxSource maitrix to be copied.
col_nameset first column as name.
row_nameset first row as name.
Returns
none.
Warning
Must be a matrix of numbers integers or floating points.

Member Function Documentation

size_t Bial::Table::Columns ( ) const

Returns the number of columns in table.

Date
2015/May/22
Parameters
none.
Returns
the number of columns in table.
Warning
none.
const TableColumn& Bial::Table::operator() ( size_t  p) const

Returns a constant reference of data pointed by index p. It has the same effect as operator data( p ).

Date
2015/May/22
Parameters
pa global index to be acessed.
Returns
Constant reference of data pointed by index p.
Warning
Table bounds are not verified.
TableColumn& Bial::Table::operator() ( size_t  p)

Returns the reference for data pointed by index p. It has the same effect as operator data( p ).

Date
2015/May/22
Parameters
pa global index to be acessed.
Returns
Reference of data pointed by index p.
Warning
Table bounds are not verified.
const TableCell& Bial::Table::operator() ( size_t  col,
size_t  row 
) const

Returns a constant reference of data pointed by indexes col, row.

Date
2015/May/22
Parameters
colcolumn to be acessed.
rowrow to be acessed.
Returns
Constant reference of data pointed by indexes col, row.
Warning
Table bounds are not verified.
TableCell& Bial::Table::operator() ( size_t  col,
size_t  row 
)

Returns the reference for data pointed by indexes col, row.

Date
2015/May/22
Parameters
colcolumn to be acessed.
rowrow to be acessed.
Returns
Reference of data pointed by indexes col, row.
Warning
Table bounds are not verified.
const TableColumn& Bial::Table::operator[] ( size_t  p) const

Returns a constant reference of data pointed by index p. It has the same effect as operator data( p ).

Date
2015/May/22
Parameters
pa global index to be acessed.
Returns
Constant reference of data pointed by index p.
Warning
Table bounds are not verified.
TableColumn& Bial::Table::operator[] ( size_t  p)

Returns the reference for data pointed by index p. It has the same effect as operator data( p ).

Date
2015/May/22
Parameters
pa global index to be acessed.
Returns
Reference of data pointed by index p.
Warning
Table bounds are not verified.
template<class O >
O& Bial::Table::Print ( O &  os,
bool  transpose = false 
) const

Prints table containts to output stream os.

Date
2015/May/22
Parameters
osan output stream.
transposeif the table should be printed transposed or not.
Returns
The output stream.
Warning
'this' table must be 1D, 2D, or 3D.
template<class O >
O& Bial::Table::PrintDimensions ( O &  os) const

Prints table dimensions to output stream os.

Date
2015/May/22
Parameters
none.
Returns
The dimensions of the table.
Warning
none.
void Bial::Table::PushBack ( const Vector< int > &  vct)

Pushes back a vector to the end of the list.

Date
2015/May/22
Parameters
vctVector to be inserted into the end of the table.
Returns
none.
Warning
If there is already any column in table, the new one must have the same length.
void Bial::Table::PushBack ( const Vector< float > &  vct)

Pushes back a vector to the end of the list.

Date
2015/May/22
Parameters
vctVector to be inserted into the end of the table.
Returns
none.
Warning
If there is already any column in table, the new one must have the same length.
void Bial::Table::PushBack ( const Vector< std::string > &  vct)

Pushes back a vector to the end of the list.

Date
2015/May/22
Parameters
vctVector to be inserted into the end of the table.
Returns
none.
Warning
If there is already any column in table, the new one must have the same length.
void Bial::Table::PushBack ( const TableColumn vct)

Pushes back a vector to the end of the list.

Date
2015/May/22
Parameters
vctVector to be inserted into the end of the table.
Returns
none.
Warning
If there is already any column in table, the new one must have the same length.
size_t Bial::Table::Rows ( ) const

Returns the number of rows in table.

Date
2015/May/22
Parameters
none.
Returns
the number of rows in table.
Warning
none.
void Bial::Table::Write ( std::string  filename) const

Writes table containts into a file.

Date
2015/May/28
Parameters
filenameName of the file to write table in.
Returns
none.
Warning
none.

Member Data Documentation

Vector< TableColumn > Bial::Table::_data
protected

Definition at line 224 of file Table.hpp.


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