Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Examples  

matrices.h File Reference

Vectors and matrices implementation. More...

Go to the source code of this file.

Compounds

class  matrix
 Implementation of a matrix with entries of type T. More...

class  vector
 Implementation of a vector with entries of type T. More...


Constants for matrix_status

const int st_ok = 1
const int st_out_of_memory = -1
const int st_out_of_range = -2
const int st_inconsistent_sizes = -3
const int st_input_error = -4
const int st_output_error = -5
const int st_incorrect_index = -6
const int st_matrix_must_be_square = -7
const int st_matrix_is_singular = -8

Typedefs

typedef int index

Functions

template<class T> ostream & operator<< (ostream &s, const vector< T > &x)
template<class T> istream & operator>> (istream &s, vector< T > &x)
template<class T> ostream & operator<< (ostream &s, const matrix< T > &x)
template<class T> istream & operator>> (istream &s, matrix< T > &x)
template<class T> void print2 (ostr &s, const matrix< T > &A, const matrix< T > &B)
template<class T> void print3 (ostr &s, const matrix< T > &A, const matrix< T > &B, const matrix< T > &C)

Variables

int matrix_status = st_ok
index const n_max_size = 10000
index const m_max_size = 10000


Detailed Description

Vectors and matrices implementation.

This module containes description of two following classes:

These classes support all linear algebraic operations with appropriate mathematical objects.

The number of entries in a vector is bounded above by the constant n_max_size. The number of columns in a matrix is bounded above by the constant n_max_size. The number of rows in a matrix is bounded above by the constant m_max_size. Indices of enties in a vector/matrix begin from 0. The type subscript is specially defined for vector/matrix indices.

For error controlling there is a variable matrix_status which containes the code of a last error.

Definition in file matrices.h.


Typedef Documentation

typedef int index
 

The type for index representation.

Definition at line 57 of file matrices.h.


Function Documentation

template<class T>
ostream & operator<< ostream & s,
const matrix< T > & x
 

Then writes entries

Definition at line 1083 of file matrices.h.

template<class T>
ostream & operator<< ostream & s,
const vector< T > & x
 

First, writes the number of entries. Then writes entries

Definition at line 665 of file matrices.h.

template<class T>
istream & operator>> istream & s,
matrix< T > & x
 

Then reads entries

Definition at line 1098 of file matrices.h.

template<class T>
istream & operator>> istream & s,
vector< T > & x
 

First, writes the number of entries. Then writes entries

Definition at line 677 of file matrices.h.

template<class T>
void print2 ostr & s,
const matrix< T > & A,
const matrix< T > & B
 

Prints matrices in the form:.

A B

Definition at line 1912 of file matrices.h.

template<class T>
void print3 ostr & s,
const matrix< T > & A,
const matrix< T > & B,
const matrix< T > & C
 

Prints matrices in the form:.

A B C

Definition at line 1962 of file matrices.h.


Variable Documentation

index const m_max_size = 10000
 

The maximum number of rows in a matrix.

Definition at line 66 of file matrices.h.

int matrix_status = st_ok
 

The code of the last error.

If an error has occured an error message writes to std err

Definition at line 53 of file matrices.h.

index const n_max_size = 10000
 

The maximum number of column in a matrix, the maximum number of enties in a vector.

Definition at line 63 of file matrices.h.

const int st_inconsistent_sizes = -3
 

Inconsistent sizes of matrices.

Definition at line 41 of file matrices.h.

const int st_incorrect_index = -6
 

Incorrect index.

Definition at line 44 of file matrices.h.

const int st_input_error = -4
 

Input error.

Definition at line 42 of file matrices.h.

const int st_matrix_is_singular = -8
 

Matrix is singular.

Definition at line 46 of file matrices.h.

const int st_matrix_must_be_square = -7
 

Matrix must be square.

Definition at line 45 of file matrices.h.

const int st_ok = 1
 

Ok.

Definition at line 38 of file matrices.h.

const int st_out_of_memory = -1
 

Out of memory.

Definition at line 39 of file matrices.h.

const int st_out_of_range = -2
 

Out of range.

Definition at line 40 of file matrices.h.

const int st_output_error = -5
 

Output error.

Definition at line 43 of file matrices.h.


Generated at Tue Jan 22 20:37:04 2002 for Arageli by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001