Unbounded Array Storage
Unbounded Array
Description
The templated class unbounded_array<T, ALLOC>
implements a unbounded
storage array using an allocator. The unbounded array is similar to a
std::vector
in that in can grow in size beyond any fixed bound.
However unbounded_array
is aimed at optimal performance. Therefore
unbounded_array
does not model a Sequence
like std::vector
does.
When resized unbounded_array
will reallocate it’s storage even if the
new size requirement is smaller. It is therefore inefficient to resize a
unbounded_array
Example
#include <boost/numeric/ublas/storage.hpp>
int main () {
using namespace boost::numeric::ublas;
unbounded_array<double> a (3);
for (unsigned i = 0; i < a.size (); ++ i) {
a [i] = i;
std::cout << a [i] << std::endl;
}
}
Definition
Defined in the header storage.hpp.
Template parameters
Parameter |
Description |
Default |
|
The type of object stored in the array. |
|
|
An STL Allocator |
std::allocator |
Model of
Type requirements
None, except for those imposed by the requirements of Storage.
Public base classes
None.
Members
-
The description does not describe what the member actually does, this can be looked up in the corresponding concept documentation, but instead contains a remark on the implementation of the member inside this model of the concept.
-
Typography:
-
Members that are not part of the implemented concepts are in blue.
-
Member | Where defined | Description |
---|---|---|
|
||
|
Defined as |
|
|
Defined as |
|
|
Defined as |
|
|
Defined as |
|
|
Defined as |
|
|
Defined as |
|
|
Defined as |
|
|
Defined as |
|
|
Defined as |
|
|
Defined as |
|
allocator_type |
Defined as ALLOC |
|
|
Creates an |
|
|
Creates a uninitialized |
|
|
Creates an initialized |
|
|
The copy constructor. |
|
|
Deallocates the |
|
|
Reallocates an |
|
|
Reallocates an |
|
|
Returns the size of the |
|
|
Returns a |
|
|
Returns a reference of the |
|
|
The assignment operator. |
|
|
Assigns a temporary. May change the array |
|
|
Swaps the contents of the arrays. |
|
|
Returns a |
|
|
Returns a |
|
|
Returns a |
|
|
Returns a |
|
|
Returns a |
|
|
Returns a |
|
|
Returns a |
|
|
Returns a |
Copyright (©) 2000-2002 Joerg Walter, Mathias Koch
Copyright (©) 2021 Shikhar Vashistha
Use, modification and distribution are subject to the Boost Software
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt ).