Next: 5.4.1 VIMask operations Up: 5. The VMask class Previous: 5.3 Assignment Contents

# 5.4 Computing with `VMask`

You can use `[]` to get at matrix elements, numbered left-to-right, top-to-bottom. Alternatively, use `()` to address elements by position. For example:

    VIMask fred( "mask" );

    for( int i = 0; i < fred.xsize(); i++ )
        fred[i] = 12;

will set the first line of the matrix to 12, and:

    VDMask fred( "mask" );

    for( int x = 0; x < fred.xsize(); x++ )
        fred(x, x) = 12.0;

will set the leading diagonal to 12.

See the member functions below for other operations on `VMask`.

Subsections

- 5.4.1 `VIMask` operations
- 5.4.2 `VDMask` operations