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:
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_>
exmat::DenseColVecCon<T, SIZE_>
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
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.
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
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:
resize(index_type rows, index_type cols, bool preserveContent=false)
resize(index_type s)
- Note:
- Resizing of the container may result in data lost, unless you have specify
preserveContent to true
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
(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
1.4.6-NO