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

Functions to create output in columns.

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

int matrix_out ( std::ostream &  os,
mat_t &  A,
size_t  nrows,
size_t  ncols 
) [inline]

A operator for simple matrix output using operator[].

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 310 of file columnify.h.

int matrix_out_paren ( std::ostream &  os,
mat_t &  A,
size_t  nrows,
size_t  ncols 
) [inline]

A operator for simple matrix output using operator().

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 239 of file columnify.h.


Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.

Project hosting provided by SourceForge.net Logo, O2scl Sourceforge Project Page