diff --git a/doc/array_adaptor.htm b/doc/array_adaptor.htm new file mode 100644 index 00000000..930b31c9 --- /dev/null +++ b/doc/array_adaptor.htm @@ -0,0 +1,215 @@ + + + + + +Bounded Array; + + +

+Array Storage

+

Array Adaptor

+

Description

+

The templated class carray_adaptor<T> implements a storage array using a pointer to an existing memory buffer (a C array for example). The storage specified array size must never exceed the size of the memory buffer.

+

carray_adaptor defines size_type as size_t and difference_type as std::ptrdiff_t. +

+

Example

+
+#include <boost/numeric/ublas/storage.hpp>
+
+int main () {
+    using namespace boost::numeric::ublas;
+    double aarray[10];
+    carray_adaptor<double> a (aarray, 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

+ + + + + + + + + + + + + +
ParameterDescriptionDefault
TThe type of object stored in the array.
+

Model of

+

Storage but NOT Copy Constructable

+

Type requirements

+

None, except for those imposed by the requirements of Storage.

+

Public base classes

+

None.

+

Members

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MemberWhere definedDescription
value_typeContainer
pointerContainerDefined as value_type*
const_pointerContainerDefined as const value_type*
referenceContainerDefined as value_type&
const_referenceContainerDefined as const value_type&
size_typeContainerDefined as Alloc::size_type
difference_typeContainerDefined as Alloc::difference_type
iteratorContainerDefined as pointer
const_iteratorContainerDefined as const_pointer
revere_iteratorContainerDefined as std::reverse_iterator<iterator>
const_revere_iteratorContainerDefined as std::reverse_iterator<const_iterator>
carray_adaptor ()StorageCreates an carray_adaptor that holds zero elements.
carray_adaptor (size_type size)Storage +The size-constructor is undefined. A carray_adaptor cannot be constructed like this as a memory buffer cannot +be specifed in this context.
carray_adaptor (size_type size, const T& init)Storage +The fill-constructor is undefined. A carray_adaptor cannot be constructed like this as a memory buffer cannot +be specifed in this context.
bounded_array (size_type size, pointer data)StorageCreates a uninitialized bounded_array that holds size elements from the memory buffer data. All the elements are default constructed.
bounded_array (size_type size, pointer data, const T& init)StorageCreates an initialized bounded_array that holds size elements from the memory buffer data. All the elements are constructed from the init value.
carray_adaptor (const carray_adaptor &c)ContainerThe copy constructor is private and undefined. A carray_adaptor cannot be constructed like this as a memory buffer cannot +be specifed in this context.
~carray_adaptor ()ContainerDeallocates the carray_adaptor itself.
void resize (size_type size)Storage +Reallocates a carray_adaptor to hold size elements.
void resize (size_type size, const T& t)Storage +Reallocates a carray_adaptor to hold size elements.
void resize (size_type size pointer data)Storage +Reallocates a carray_adaptor to hold size elements.
void resize (size_type size pointer data, const T& t)Storage +Reallocates a carray_adaptor to hold size elements.
size_type size () constContainerReturns the size of the carray_adaptor.
const_reference operator [] (size_type i) constContainerReturns a const reference of the i -th element.
reference operator [] (size_type i)ContainerReturns a reference of the i-th element.
carray_adaptor &operator = (const carray_adaptor &a)ContainerThe assignment operator.
carray_adaptor &assign_temporary (carray_adaptor &a)Assigns a temporary. May change the array a.
void swap (carray_adaptor &a)ContainerSwaps the contents of the arrays.
const_iterator begin () constContainerReturns a const_iterator pointing to the beginning of the carray_adaptor.
const_iterator end () constContainerReturns a const_iterator pointing to the end of the carray_adaptor.
iterator begin ()ContainerReturns a iterator pointing to the beginning of the carray_adaptor.
iterator end ()ContainerReturns a iterator pointing to the end of the carray_adaptor.
const_reverse_iterator rbegin () constReversible ContainerReturns a const_reverse_iterator pointing to the beginning of the reversed carray_adaptor.
const_reverse_iterator rend () constReversible ContainerReturns a const_reverse_iterator pointing to the end of the reversed carray_adaptor.
reverse_iterator rbegin ()Reversible ContainerReturns a reverse_iterator pointing to the beginning of the reversed carray_adaptor.
reverse_iterator rend ()Reversible ContainerReturns a reverse_iterator pointing to the end of the reversed carray_adaptor.
+ + diff --git a/doc/index.htm b/doc/index.htm index 412b4c48..953e1620 100644 --- a/doc/index.htm +++ b/doc/index.htm @@ -153,6 +153,7 @@ Matrix Operations