Bsoft  1.9
Bernard's software package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
rwmatrix.cpp File Reference

Functions for reading (and writing) matrices. More...

#include "rwmatrix.h"
#include "linked_list.h"
#include "utilities.h"
#include <fstream>

Go to the source code of this file.

Functions

Bmatrix read_matrix (Bstring &filename)
 Reads a matrix file. More...
 
int write_matrix (Bstring &filename, Bmatrix matrix)
 Writes a matrix file. More...
 

Variables

int verbose
 

Detailed Description

Functions for reading (and writing) matrices.

Author
Bernard Heymann
Date
Created: 20010723
Modified: 20120211

Definition in file rwmatrix.cpp.

Function Documentation

Bmatrix read_matrix ( Bstring &  filename)

Reads a matrix file.

The matrix file contains the keyword "matrix_", following by a line with column labels and multiple lines for the matrix contents. All elements are delimited by whitespace. The matrix is packed into a data array row by row. Requirements: Only square matrices are supported, i.e., there must be as many content lines as there are column labels.

Parameters
Bstring&filename matrix file name.
Returns
Bmatrix a pointer to the matrix.

Definition at line 31 of file rwmatrix.cpp.

int write_matrix ( Bstring &  filename,
Bmatrix  matrix 
)

Writes a matrix file.

The matrix file contains the keyword "matrix_", following by a line with column labels and multiple lines for the matrix contents. All elements are delimited by whitespace.

Parameters
Bstring&filename matrix file name.
Bmatrixmatrix a pointer to the matrix.
Returns
int 0.

Definition at line 132 of file rwmatrix.cpp.

Variable Documentation

int verbose