Object-oriented Scientific Computing Library: Version 0.910
Data Structures | Functions
columnify.h File Reference

Functions to create output in columns. More...

#include <iostream>
#include <string>
#include <vector>
#include <o2scl/misc.h>
#include <o2scl/array.h>

Go to the source code of this file.


Detailed Description

Definition in file columnify.h.

Data Structures

class  columnify
 Create nicely formatted columns from a table of strings. More...

Functions

template<class mat_t >
int matrix_out_paren (std::ostream &os, mat_t &A, size_t nrows, size_t ncols)
 A operator for simple matrix output using operator()
template<class mat_t >
int matrix_cx_out_paren (std::ostream &os, mat_t &A, size_t nrows, size_t ncols)
 A operator for simple complex matrix output using operator()
template<class mat_t >
int matrix_out (std::ostream &os, mat_t &A, size_t nrows, size_t ncols)
 A operator for simple matrix output using operator[].

Function Documentation

template<class mat_t >
int matrix_out_paren ( std::ostream &  os,
mat_t &  A,
size_t  nrows,
size_t  ncols 
)

The type mat_t can be any matrix type which allows individual element access using operator()(size_t,size_t).

This outputs all of the matrix elements using output settings specified by os. The alignment performed by columnify using columnify::align_dp, i.e. the numbers are aligned by their decimal points. If the numbers have no decimal points, then the decimal point is assumed to be to the right of the last character in the string represetation of the number.

Definition at line 245 of file columnify.h.

template<class mat_t >
int matrix_cx_out_paren ( std::ostream &  os,
mat_t &  A,
size_t  nrows,
size_t  ncols 
)
Todo:
Doesn't this only work for GSL matrices? Compare this to the corresponding vector functions

Definition at line 278 of file columnify.h.

template<class mat_t >
int matrix_out ( std::ostream &  os,
mat_t &  A,
size_t  nrows,
size_t  ncols 
)

The type mat_t can be any 2d-array type which allows individual element access using [size_t][size_t]

This outputs all of the matrix elements using output settings specified by os. The alignment performed by columnify using columnify::align_dp, i.e. the numbers are aligned by their decimal points. If the numbers have no decimal points, then the decimal point is assumed to be to the right of the last character in the string represetation of the number.

Idea for Future:
If all of the matrix elements are positive integers and scientific mode is not set, then we can avoid printing the extra spaces.

Definition at line 323 of file columnify.h.

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).

Get Object-oriented Scientific Computing
Lib at SourceForge.net. Fast, secure and Free Open Source software
downloads.