name: MMatrix

synopsis:

g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_math_matrix.a

#include <MMatrix.h>

MMatrix();
MMatrix(const MMatrix& arg);
MMatrix(long nrows, long ncols = DEF_SIZE,
        Integral::MTYPE type = Integral::DEF_MTYPE);
boolean assign(TIntegral value);
boolean assign(long num_rows, long num_cols, long* arg, 
               Integral::MTYPE type = Integral::DEF_MTYPE);
boolean setCapacity(const MMatrix& prototype_matrix,
                    boolean preserve_values = true,
                    Integral::MTYPE type = Integral::UNCHANGED);
boolean setDimensions(const MMatrix& prototype_matrix,
                      boolean preserve_values = true,
                      Integral::MTYPE type = Integral::UNCHANGED);
boolean mult(MMatrix& m1, MMatrix& m2);
boolean multv(TVector& output_vector, const TVector& input_vector);
boolean vmult(TVector& output_vector, const TVector& input_vector);
double determinant() const;
boolean inverse();
boolean transpose();
quick start:

MMatrix<Double, double> mat0(3, 3, Integral::FULL);
MMatrix<Double, double> mat2;

double det;

mat0.assign(3, 3, L"2.1, 8.3, 4.5, 4.6, 0, 8.1, 5.5, 3.2, 1.7");
MMatrix<Double, double> mat1(4, 4, Integral::SYMMETRIC);

MVector<Double, double> vec_in;
MVector<Double, double> vec_out1;
MVector<Double, double> vec_out2;

mat1.assign(4, 4, L"1.1, 4.5, 6.5, 3.6, 0.3, 6.7, 8.1, 2.3, 5.5, 9.2",
            Integral::SYMMETRIC);

vec_in.assign(L"2.2, 4.3, 6.5");
mat1.setDimensions(3, 3); 

mat0.multv(vec_out1, vec_in);
mat1.vmult(vec_out2, vec_in);

mat0.transpose();
mat2.mult(mat0, mat1);

det = mat2.determinant();
mat2.inverse();
mat0.setCapacity(0);
description:

The MMatrix class is a matrix template class which abstracts the storage format of the matrix from the user. This allows memory space for special types of matrices such as a diagonal matrix to be minimized. Details of the storage format are hidden from the user. Most operations can be performed on the any type of matrix transparently to the user. The storage formats, which are defined in
Integral.h through the enumeration Integral::MTYPE, include FULL, DIAGONAL, SYMMETRIC, LOWER_TRIANGULAR, UPPER_TRIANGULAR, and SPARSE.

The commonly used mathematical, logical and linear algebra methods for matrices are available for all these types, and implemented in this class as part of the template. All the other matrix classes are derived from this template. A matrix object can read itself from (or write itself to) an Sof file. The MMatrix methods are not supposed to be used by the user directly.

dependencies:

public constants:

error codes:

protected data:

required public methods:

class-specific public methods:

private methods:


examples:

notes: