Constructors

next - skip - up - start

To construct an m x n matrix, A, (m and n are integers) use

    Matrix A(m,n);
The UpperTriangularMatrix, LowerTriangularMatrix, SymmetricMatrix and DiagonalMatrix types are square. To construct an n x n matrix use, for example
    UpperTriangularMatrix UT(n);
    LowerTriangularMatrix LT(n);
    SymmetricMatrix S(n);
    DiagonalMatrix D(n);
Band matrices need to include bandwidth information in their constructors.
    BandMatrix BM(n, lower, upper);
    UpperBandMatrix UB(n, upper);
    LowerBandMatrix LB(n, lower);
    SymmetrixBandMatrix SB(n, lower);
The integers upper and lower are the number of non-zero diagonals above and below the diagonal (excluding the diagonal) respectively.

The RowVector and ColumnVector types take just one argument in their constructors:

    RowVector RV(n);
    ColumnVector CV(n);
You can also construct vectors and matrices without specifying the dimension. For example
    Matrix A;
In this case the dimension must be set by an assignment statement or a re-dimension statement.

You can also use a constructor to set a matrix equal to another matrix or matrix expression.

    Matrix A = UT;
    Matrix A = UT * LT;
Only conversions that don't lose information are supported - eg you cannot convert an upper triangular matrix into a diagonal matrix using =.