The basic

To start programming using exmat, you must work with the 2 classes, the Mat and Vec class.

Mat and Vec are template class which takes 2 template parameters, defined in Mat.h.

    template<class Rep, class ErrChecker> class Mat;
    template<class Rep, class ErrChecker> class Vec;
The parameter Rep is the concrete data structure for Mat / Vec, it can be a Container or an expression.
The parameter ErrChecker can be one of the 3 error checker provided (see Error handling).

To define a matrix, you can do something like this:
First include the header file needed

    #include <exmat.h>
Bring the namespace exmat into scope
    using namespace exmat;
Define three 4 by 4 matrix A, B and C
    Mat<DenseMatCon<float,4,4>, FullErrorChecker> A, B, C;
You can use typedef to shorten the matrix type name
    typedef Mat<DenseMatCon<float,4,4>, FullErrorChecker> Mat4x4f;
    Mat4x4f A, B, C;
Vector are defined similarly, but Vec have to use vector containers. The following code define two column vector of length 3, u and v
    Vec<DenseColVecCon<float, 3> > u, v;

At this point, you may want to have a look on some examples:
Examples
Example: A very simple example


The Mat / Vec will be inherited from it's representation, Rep, which means you can directly call the container's member functions, for example:
Defines a dynamic vector

    Vec<DenseColVecCon<float, 0> > v;
Resize the vector to 10, the DenseColVecCon::resize is called
    v.resize(10);


Go to the next section : Container


Generated on Sat May 6 23:12:04 2006 for Exmat by  doxygen 1.4.6-NO