Container

Containers are concrete data structure that store the data for Mat / Vec. To use exmat effectively, you must familiar with different kinds of container.

Kinds of container are structured as follows:

Dense containers

Container class for matrix:
    exmat::DenseMatCon<T, ROWS_, COLS_>
where T is the element type and ROWS_ and COLS_ are compile time constants

Container classes for vector:
    exmat::DenseRowVecCon<T, SIZE_> // Row vector
    exmat::DenseColVecCon<T, SIZE_> // Column vector
where T is the element type and SIZE_ is a compile time constant

To increase readability, vector of size 2, 3 and 4 have named elements:
v.{x,y,z,w} = v.{s,t,u,v} = v.{r,g,b,a}
v.{x,y,z} = v.{s,t,u} = v.{r,g,b}
v.{x,y} = v.{s,t} = v.{r,g}

See also:
exmat::DenseMatCon

Static size container

The dimension of the matrix / vector is known at compile time.
To use static size container, just pass ROWS_, COLS_ or SIZE_ with a positive non-zero integer constant to DenseMatCon.
Note:
Use this container whenever possible, since it provide more static information so that the compiler can perform more optimization.

Matrix container with static row/column

The dimension of the matrix is partially known at compile time.
This happen when the one of the ROWS_ or COLS_ is set to zero.
For example:
        exmat::DenseMatCon<float, 3, 0>
Will have 3 rows, but unknown columns till run-time.

For dynamic rows, there will be a corresponding resizing function:
        resizeRow(index_type rows)
and the resizing function for dynamic column is:
        resizeCol(index_type cols)
Note:
Resizing of the container may result in data lost

Dynamic containers

The dimension of the matrix / vector is unknown at compile time.
Passing both ROWS_, COLS_ or SIZE_ with zero will result a dynamic container.
Along with the individual resize row / column functions, it also has:
        // For matrix
        resize(index_type rows, index_type cols, bool preserveContent=false)
        // For vector
        resize(index_type s)
Note:
Resizing of the container may result in data lost, unless you have specify preserveContent to true

SIMD containers

Using the SIMD containers enable the library to generate SIMD code. Currently exmat only support Intel's SSE and SSE2 instructions.

Syntax of SIMD container:

        exmat::SSCon<SCon<ROWS, COLS, element_type> >
Note:
element_type can only be float or double

Sparse containers

(not yet implemented)


Example for using dynamic containers: Example: Dimension

Go to the next section : Constructors and initialization


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