#include <MatSimple_Type.h>
Inheritance diagram for MatSimple(Type)::

Public Methods | |
| MatSimple(Type) () | |
| MatSimple(Type) (int nrows, int ncolumns) | |
| MatSimple(Type) (const MatSimple(Type) &X) | |
| ~MatSimple(Type) () | |
| void | getColumn (int column_no, VecSimple(Type) &column) const |
| void | getRow (int row_no, VecSimple(Type) &row) const |
| void | swapRows (int row1, int row2) |
| void | fill (Type value) |
| MatSimple(Type)& | operator= (const Type &value) |
| MatSimple(Type)& | operator= (const MatSimple(Type) &X) |
| void | transpose () |
| void | print (Os os, const char *header=NULL, int nentries_per_line=3) const |
| void | scan (Is is) |
| void | printAscii (Os os, const char *header=NULL) const |
Friends | |
| Os& | operator<< (Os &os, const MatSimple(Type) &x) |
| Is& | operator>> (Is &is, MatSimple(Type) &x) |
NAME: MatSimple(Type) - simple dense matrix, base=1, no arithmetic operations
DESCRIPTION:
The class implements a standard matrix type derived from "MatSimplest(Type)". The public interface consists of various operations such as fill functions, row and column extraction, print and scan functions etc.
No arithmetic operations are used in any of the member functions. Hence this class is suited as a general matrix class for various objects. The only requirement is that the object has a constructor with no arguments so that an array of the class objects can be allocated by "new". In addition, the class must define "operator=", "operator<<" and "operator>>". Macros for generating default versions of these operators are collected in the file "default_op.h".
|
|
Several constructors are available. The constructor without parameters allocates no memory. To allocate the proper amount of memory at a later stage, the "redim" function inherited from MatSimplest can be used. Another constructor takes the number of rows and columns in the matrix as parameters and allocates memory for the corresponding matrix representation. Finally, a copy-constructor is available. To initialize the matrix entries one can use the member functions "fill" or "operator()". |
|
|
See documentation of one of the overloaded constructor. |
|
|
See documentation of one of the overloaded constructor. |
|
|
|
|
|
Reimplemented in Mat(Type). |
|
|
extracts a column in the matrix. |
|
|
extracts a row in the matrix. |
|
|
See documentation of one of the overloaded functions. |
|
|
the version of this function that takes another "MatSimple" as argument redimensions the matrix and sets all the entries equal to each other. The overloaded version of this function, taking a value as argument, sets all the entries in the matrix equal to this value. |
|
|
writes the content of the matrix in a format that can be read by "scan". See the documentation for "VecSimple scan" and "VecSimple print". Reimplemented in Mat(Type). |
|
|
Reimplemented in Mat(Type). |
|
|
reads the matrix from an "Is". The format is documented in "VecSimple scan". A few additional examples on matrix formats are given here. First the most comprehensive form:
[3x2] Example of a data file with much additional information such as
indices for each matrix entry. This file is in ascii format.
(1,1)=1.2
(2,1)=3.4
(3,1)=1.8
(1,2)=11.2
(2,2)=13.4
(3,2)=11.8
Here is an ascii format file with as little information as possible:
1.2 3.4 1.8 11.2 13.4 11.8
1.2 3.4
1.8
11.2 13.4 11.8
[2x3]b my matrix $@[B3][B4][B1.2][B3.4][B1.8][B11.2][B13.4][B11.8]
Reimplemented in Mat(Type). |
|
|
swaps "row1" and "row" in the matrix. |
|
|
transposes the matrix. Reimplemented in Mat(Type). |
|
|
defined in terms of the "print" function. |
|
|
defined in terms of the "scan" function. |