Inserts an element at v (i) with value t.
The storage requirement of the Vector may be increased.

v (i) is equal to t.

Erase

v.erase_element (i)

0 <= i < v.size ()

Destroys the element as v (i) and replaces it with the default
value_type ().
The storage requirement of the Vector may be decreased.

v (i) is equal to value_type ().

Clear

v.clear ()

Equivalent tofor (i = 0; i < v.size (); ++ i)v.erase_element (i);

Resize

v.resize (n)
v.resize (n, p)

Reallocates the vector so that it can hold n
elements.
Erases or appends elements in order to bring the vector to the prescribed size. Appended elements copies of value_type().
When p == false then existing elements are not preserved and elements will not appended as normal. Instead the vector is in the same state as that after an equivalent sizing constructor.

v.size () == n.

Storage

v.data()

Returns a reference to the underlying dense storage.

Complexity guarantees

The run-time complexity of the sizing constructor is linear in
the vector's size.

The run-time complexity of insert_element and erase_element is specific for the
Vector model and it depends on increases/decreases in storage requirements.

The run-time complexity of resize is linear in the vector's
size.

Invariants

Models

vector, bounded_vector, c_vector

unit_vector, zero_vector, scalar_vector

mapped_vector;, compressed_vector, coordinate_vector

Notes

[1]
As a user you need not care about Vector being a refinement of the VectorExpression. Being a refinement of the VectorExpression is only important for the template-expression engine but not the user.

[2]
The operator[] is added purely for convenience
and compatibility with the std::vector. In uBLAS however,
generally operator() is used for indexing because this can be
used for both vectors and matrices.

Matrix

Description

A Matrix describes common aspects of dense, packed and sparse
matrices.

Reallocate the matrix so that it can hold n1 rows
and n2 columns.
Erases or appends elements in order to bring the matrix to the
prescribed size. Appended elements are value_type()
copies.
When p == false then existing elements are not preserved and elements will not appended as normal. Instead the matrix is in the same state as that after an equivalent sizing constructor.

m.size1 () == n1 and m.size2 () == n2.

Storage

m.data()

Returns a reference to the underlying dense storage.

Complexity guarantees

The run-time complexity of the sizing constructor is quadratic
in the matrix's size.

The run-time complexity of insert_element and erase_element is specific for the
Matrix model and it depends on increases/decreases in storage requirements.

The run-time complexity of resize is quadratic in the matrix's
size.

Invariants

Models

matrix, bounded_matrix, c_matrix

identity_matrix , zero_matrix , scalar_matrix

triangular_matrix , symmetric_matrix , banded_matrix

mapped_matrix , compressed_matrix , coordinate_matrix

Notes

[1]
As a user you need not care about Matrix being a refinement of the MatrixExpression. Being a refinement of the MatrixExpression is only important for the template-expression engine but not the user.