Operators

Unary Operators

exmat support the following unary operators for both matrix and vector:
    X = -A;     // change sign of elements

Binary Operators

exmat support the following binary operators for both matrix and vector:
    X = A + B;          // Addition
    A += B;             // A = A + B;
    X = A + s;          // Scalar addition
    X = s + A;          //
    A += s;             //

    X = A - B;          // Subtraction
    A -= B;             // A = A - B;
    X = A - s;          // Scalar subtraction
    X = s - A;          //
    A -= s;             //

    X = A * s;          // Scalar multiplication
    X = s * A;          //
    X *= s;             //

    X = A * B;          // Matrix multiplication
    A *= B;             // A = A * B;
    v = A * u;          // Matrix / column vector multiplication
    v = u * A;          // Row vector / matrix multiplication

    X = s / A;          // Scalar division
    X /= s;             // X = s / X;

    bool b = (A == B);  // Test whether A and B are equal
    bool b = (A != B);  // !(A == B)
    <, >, <=, >=        // 

Note:
The dimension of operands and the operator must be matched, otherwise exmat::compatibility_error will be thrown. Also, a column vector cannot be assigned to a row vector, and vise versa. You must apply a exmat::trans function to transform one of the vectors.
Go to the next section : Vector functions
Generated on Sat May 6 23:12:04 2006 for Exmat by  doxygen 1.4.6-NO