diff --git a/doc/dense_vector_concept.htm~ b/doc/dense_vector_concept.htm~ deleted file mode 100644 index 3597bf32..00000000 --- a/doc/dense_vector_concept.htm~ +++ /dev/null @@ -1,224 +0,0 @@ - - -
- - - -
-DenseVector ConceptA dense-vector is a, exactly as the name says, a dense vector that is intended to behave well for linear algebra operations
--In addition to the types defined int - Vector Expression -
-| Storage | -array_type | -The type of underlying storage used to store the elements | -
V |
-A type that is a model of Vector | -
v |
-Objects of type V |
-
n, i |
-Objects of a type convertible to size_type |
-
t |
-Object of a type convertible to value_type |
-
p |
-Object of a type convertible to bool |
-
In addition to the expressions defined in Vector Expression the -following expressions must be valid.
-| Name | -Expression | -Type requirements | -Return type | -
|---|---|---|---|
| Sizing constructor | -V v (n) |
-- | V |
-
| Element access [1] | -v[n] |
-n is convertible to size_type |
-reference if v is mutable, const_reference otherwise |
-
| Insert | -v.insert_element (i, t) |
-v is mutable. |
-void |
-
| Erase | -v.erase_element (i) |
-v is mutable. |
-void |
-
| Clear | -v.clear () |
-v is mutable. |
-void |
-
| Resize | -v.resize (n)- v.resize (n, p) |
-v is mutable. |
-void |
-
| Storage | -data() const |
-- | const array_type& |
-
| Storage | -data() |
-v is mutable |
-array_type& |
-
Semantics of an expression is defined only where it differs -from, or is not defined in Vector Expression .
-| Name | -Expression | -Precondition | -Semantics | -Postcondition | -
|---|---|---|---|---|
| Sizing constructor | -V v (n) |
-n >= 0 |
-Allocates a vector ofn elements. |
-v.size () == n. |
-
| Element access [1] | -v[n] |
-0<n>v.size() |
-returns the n-th element in v | -- |
| Insert | -v.insert_element (i, t) |
-0 <= i < v.size () and- v (i) is equal to value_type (0). |
-A copy of t is inserted in v. |
-v (i) is a copy of t. |
-
| Erase | -v.erase_element (i) |
-0 <= i < v.size () |
-Destroys the element v (i) and replaces it with
-value_type (). |
-v (i) is a copy of value_type
-(). |
-
| Clear | -v.clear () |
-- | Equivalent to - for (i = 0; i < v.size (); ++ i)- v.erase (i); |
-- |
| Resize | -v.resize (n)
- |
-- | 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() |
-v is const |
-Returns a reference to the underlying storage | -- |
| Storage | -v.data() |
-v is mutable |
-Returns a reference to the underlying storage | -- |
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.
-The run-time complexity of resize is linear in the vector's -size.
-vector<T> , bounded_vector<T, N>unit_vector<T> , zero_vector<T> , scalar_vector<T>mapped_vector<T> , compressed_vector , coordinate_vector[1]
-As a user you should not care about DenseVector being a refinement of the VectorExpression. Being a refinement of the VectorExpression is only important for the template-expression engine but not the user.
-[1]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.
-
-
diff --git a/doc/index.htm b/doc/index.htm
index f348aa08..e429f43e 100644
--- a/doc/index.htm
+++ b/doc/index.htm
@@ -86,7 +86,7 @@ Access Column/Row Iterator
-Sparse MatrixThe templated class sparse_matrix<T, F, A> is
-the base container adaptor for sparse matrices. For a (m x
-n)-dimensional sparse matrix and 0 <= i < m,
+
The templated class mapped_matrix<T, F, A> is
+the base container adaptor for sparse matricies using element maps.
+For a (m xn)-dimensional sparse matrix and 0 <= i < m,
0 <= j < n the non-zero elements
mi, j are mapped via (i x n +
j) for row major orientation or via (i + j x m) for
@@ -46,7 +44,7 @@ orientation.
TFrow_majorAmap_std<std::size_t, T>None, except for those imposed by the requirements of Matrix .
[1] Supported
+ [1] Supported
parameters for the storage organization are [1] Supported
+ [2] Supported
parameters for the adapted array are
The templated class The templated class None, except for those imposed by the requirements of Vector . [1] Supported
+ [1] Supported
parameters for the adapted array are
matrix_expression<sparse_matrix<T, F, A>
+matrix_expression<mapped_matrix<T, F, A>
>Members
@@ -98,30 +96,30 @@ int main () {
Description
-
-sparse_matrix ()Allocates a sparse_matrix that holds at most zero
+
+mapped_matrix ()Allocates a
mapped_matrix that holds at most zero
rows of zero elements.
-
-sparse_matrix (size_type size1, size_type2, size_type non_zeros = 0)Allocates a sparse_matrix that holds at most
+
+mapped_matrix (size_type size1, size_type2, size_type non_zeros = 0)Allocates a
mapped_matrix that holds at most
size1 rows of size2 elements.
-
+sparse_matrix (const sparse_matrix &m)mapped_matrix (const mapped_matrix &m)The copy constructor.
template<class AE>
-sparse_matrix (size_type non_zeros, const
+mapped_matrix (size_type non_zeros, const
matrix_expression<AE> &ae)The extended copy constructor.
-void resize (size_type size1, size_type size2, bool preserve = true)Reallocates a sparse_matrix to hold at most
+Reallocates a
mapped_matrix to hold at most
size1 rows of size2 elements. The
-existing elements of the sparse_matrix are preseved
+existing elements of the mapped_matrix are preseved
when specified.
@@ -145,72 +143,72 @@ j)
i-th row.
-
sparse_matrix &operator = (const sparse_matrix
+mapped_matrix &operator = (const mapped_matrix
&m)The assignment operator.
-
sparse_matrix &assign_temporary (sparse_matrix
+
-mapped_matrix &assign_temporary (mapped_matrix
&m)Assigns a temporary. May change the sparse matrix
+ Assigns a temporary. May change the mapped matrix
m .
template<class AE>
-sparse_matrix &operator = (const matrix_expression<AE>
+mapped_matrix &operator = (const matrix_expression<AE>
&ae)The extended assignment operator.
-template<class AE>
-sparse_matrix &assign (const matrix_expression<AE>
+mapped_matrix &assign (const matrix_expression<AE>
&ae)Assigns a matrix expression to the sparse matrix. Left and
+ Assigns a matrix expression to the mapped matrix. Left and
right hand side of the assignment should be independent.
template<class AE>
-sparse_matrix &operator += (const matrix_expression<AE>
+mapped_matrix &operator += (const matrix_expression<AE>
&ae)A computed assignment operator. Adds the matrix expression to
-the sparse matrix.
+the mapped matrix.
-template<class AE>
-sparse_matrix &plus_assign (const matrix_expression<AE>
+mapped_matrix &plus_assign (const matrix_expression<AE>
&ae)Adds a matrix expression to the sparse matrix. Left and right
+ Adds a matrix expression to the mapped matrix. Left and right
hand side of the assignment should be independent.
template<class AE>
-sparse_matrix &operator -= (const matrix_expression<AE>
+mapped_matrix &operator -= (const matrix_expression<AE>
&ae)A computed assignment operator. Subtracts the matrix expression
-from the sparse matrix.
+from the mapped matrix.
-template<class AE>
-sparse_matrix &minus_assign (const matrix_expression<AE>
+mapped_matrix &minus_assign (const matrix_expression<AE>
&ae)Subtracts a matrix expression from the sparse matrix. Left and
+ Subtracts a matrix expression from the mapped matrix. Left and
right hand side of the assignment should be independent.
-template<class AT>
-sparse_matrix &operator *= (const AT &at)A computed assignment operator. Multiplies the sparse matrix
+mapped_matrix &operator *= (const AT &at)
+A computed assignment operator. Multiplies the mapped matrix
with a scalar.
-template<class AT>
-sparse_matrix &operator /= (const AT &at)A computed assignment operator. Divides the sparse matrix
+mapped_matrix &operator /= (const AT &at)
+A computed assignment operator. Divides the mapped matrix
through a scalar.
-
-void swap (sparse_matrix &m)Swaps the contents of the sparse matrices.
+
+void swap (mapped_matrix &m)Swaps the contents of the mapped matrices.
true_refrence insert_element (size_type i, size_type j, const_reference
@@ -225,95 +223,95 @@ element of the i-th row. Duplicates elements are not allowed.
-void clear ()Clears the sparse matrix.
+Clears the mapped matrix.
const_iterator1 begin1 () constReturns a
+beginning of the const_iterator1 pointing to the
-beginning of the sparse_matrix.mapped_matrix.
const_iterator1 end1 () constReturns a
+the const_iterator1 pointing to the end of
-the sparse_matrix.mapped_matrix.
iterator1 begin1 ()Returns a
+the iterator1 pointing to the beginning of
-the sparse_matrix.mapped_matrix.
iterator1 end1 ()Returns a
+iterator1 pointing to the end of the
-sparse_matrix.mapped_matrix.
const_iterator2 begin2 () constReturns a
+beginning of the const_iterator2 pointing to the
-beginning of the sparse_matrix.mapped_matrix.
const_iterator2 end2 () constReturns a
+the const_iterator2 pointing to the end of
-the sparse_matrix.mapped_matrix.
iterator2 begin2 ()Returns a
+the iterator2 pointing to the beginning of
-the sparse_matrix.mapped_matrix.
iterator2 end2 ()Returns a
+iterator2 pointing to the end of the
-sparse_matrix.mapped_matrix.
const_reverse_iterator1 rbegin1 () constReturns a
+beginning of the reversed const_reverse_iterator1 pointing to the
-beginning of the reversed sparse_matrix.mapped_matrix.
const_reverse_iterator1 rend1 () constReturns a
+end of the reversed const_reverse_iterator1 pointing to the
-end of the reversed sparse_matrix.mapped_matrix.
reverse_iterator1 rbegin1 ()Returns a
+beginning of the reversed reverse_iterator1 pointing to the
-beginning of the reversed sparse_matrix.mapped_matrix.
reverse_iterator1 rend1 ()Returns a
+the reversed reverse_iterator1 pointing to the end of
-the reversed sparse_matrix.mapped_matrix.
const_reverse_iterator2 rbegin2 () constReturns a
+beginning of the reversed const_reverse_iterator2 pointing to the
-beginning of the reversed sparse_matrix.mapped_matrix.
const_reverse_iterator2 rend2 () constReturns a
+end of the reversed const_reverse_iterator2 pointing to the
-end of the reversed sparse_matrix.mapped_matrix.
reverse_iterator2 rbegin2 ()Returns a
+beginning of the reversed reverse_iterator2 pointing to the
-beginning of the reversed sparse_matrix.mapped_matrix.
reverse_iterator2 rend2 ()Returns a
+the reversed reverse_iterator2 pointing to the end of
-the reversed sparse_matrix.mapped_matrix.
Notes
-row_major
and column_major.map_array<std::size_t, T> and
map_std<std::size_t, T>. The latter is
diff --git a/doc/samples/sparse_matrix.cpp b/doc/samples/mapped_matrix.cpp
similarity index 100%
rename from doc/samples/sparse_matrix.cpp
rename to doc/samples/mapped_matrix.cpp
diff --git a/doc/samples/sparse_vector.cpp b/doc/samples/mapped_vector.cpp
similarity index 100%
rename from doc/samples/sparse_vector.cpp
rename to doc/samples/mapped_vector.cpp
diff --git a/doc/types_overview.htm b/doc/types_overview.htm
index 2ad64866..d070ecc5 100644
--- a/doc/types_overview.htm
+++ b/doc/types_overview.htm
@@ -93,7 +93,7 @@ vector is zero other then a single specified element.
index should be less than size.
-
+sparse_vector<T [, S]>
v(size);mapped_vector<T [, S]>
v(size);a sparse vector of values of type
@@ -242,7 +242,7 @@ variable size. Only the given triangular matrix is stored using
the order T of variable
size. The sparse storage type S can be std::map<size_t,
T> or map_array<size_t, T>.F.
-
sparse_matrix<T, [F, S]>
m(size1, size2 [,
+mapped_matrix<T, [F, S]>
m(size1, size2 [,
non_zeros]);a sparse matrix of values of type
T of variable
size. The sparse storage type S can be either std::map<size_t,
@@ -369,14 +369,14 @@ array.
The storage layout usually is BLAS compliant.
-
sparse_vector<T,
+mapped_vector<T,
std::map<std::size_t, T> >
v (size, non_zeros)a sparse vector, storage is provided by a standard
map.
-
sparse_vector<T,
+mapped_vector<T,
map_array<std::size_t, T> >
v (size, non_zeros)a sparse vector, storage is provided by a map
@@ -494,7 +494,7 @@ major.
The storage layout usually is BLAS compliant.
-
is provided by a standard map.
sparse_matrix<T,
+
@@ -502,7 +502,7 @@ The storage layout usually is BLAS compliant.mapped_matrix<T,
row_major,
std::map<std::size_t, T> >
m (size1, size2, non_zeros)
-
storage is provided by a standard map.
sparse_matrix<T,
+
@@ -510,7 +510,7 @@ is provided by a standard map.mapped_matrix<T,
column_major,
std::map<std::size_t, T> >
m (size1, size2, non_zeros)
-
is provided by a map array.
sparse_matrix<T,
+
@@ -518,7 +518,7 @@ storage is provided by a standard map.mapped_matrix<T,
row_major,
map_array<std::size_t, T> >
m (size1, size2, non_zeros)
-
sparse_matrix<T,
+
diff --git a/doc/vector_sparse.htm b/doc/vector_sparse.htm
index 98d4d464..7aa0d028 100644
--- a/doc/vector_sparse.htm
+++ b/doc/vector_sparse.htm
@@ -12,12 +12,10 @@
mapped_matrix<T,
column_major,
map_array<std::size_t, T> >
m (size1, size2, non_zeros)
-
Sparse Vector Sparse
-Vector
+Mapped Vector
Description
-
-sparse_vector<T, A> is
-the base container adaptor for sparse vectors. For a
+mapped_vector<T, A> is
+the base container adaptor for sparse vectors using element maps. For a
n-dimensional sparse vector and 0 <= i < n
the non-zero elements vi are mapped to
consecutive elements of the associative container, i.e. for
@@ -34,7 +32,7 @@ i2.
-TThe type of object stored in the sparse vector.
+The type of object stored in the mapped vector.
@@ -69,7 +67,7 @@ int main () {
AThe type of the adapted array. [1]
+"#mapped_vector_1">[1]
map_std<std::size_t, T>Public base classes
-vector_expression<sparse_vector<T, A>
+vector_expression<mapped_vector<T, A>
>Members
@@ -79,36 +77,36 @@ int main () {
Description
-
-sparse_vector ()Allocates a sparse_vector that holds zero
+
+mapped_vector ()Allocates a
mapped_vector that holds zero
elements.
-
sparse_vector (size_type size, size_type
+
-mapped_vector (size_type size, size_type
non_zeros = 0)Allocates a sparse_vector that holds at most
+Allocates a
mapped_vector that holds at most
size elements.
-
+sparse_vector (const sparse_vector &v)mapped_vector (const mapped_vector &v)The copy constructor.
template<class AE>
-sparse_vector (size_type non_zeros, const
+mapped_vector (size_type non_zeros, const
vector_expression<AE> &ae)The extended copy constructor.
-void resize (size_type size, bool
preserve = true)Reallocates a sparse_vector to hold at most
+Reallocates a
+mapped_vector to hold at most
size elements. The existing elements of the
-sparse_vector are preseved when specified.mapped_vector are preseved when specified.
-size_type size () constReturns the size of the
+sparse_vector.Returns the size of the
mapped_vector.
const_reference operator () (size_type i)
@@ -129,72 +127,72 @@ constReturns a reference of the
i-th element.
-
sparse_vector &operator = (const sparse_vector
+mapped_vector &operator = (const mapped_vector
&v)The assignment operator.
-
sparse_vector &assign_temporary (sparse_vector
+
-mapped_vector &assign_temporary (mapped_vector
&v)Assigns a temporary. May change the sparse vector
+ Assigns a temporary. May change the mapped vector
v .
template<class AE>
-sparse_vector &operator = (const vector_expression<AE>
+mapped_vector &operator = (const vector_expression<AE>
&ae)The extended assignment operator.
-template<class AE>
-sparse_vector &assign (const vector_expression<AE>
+mapped_vector &assign (const vector_expression<AE>
&ae)Assigns a vector expression to the sparse vector. Left and
+ Assigns a vector expression to the mapped vector. Left and
right hand side of the assignment should be independent.
template<class AE>
-sparse_vector &operator += (const vector_expression<AE>
+mapped_vector &operator += (const vector_expression<AE>
&ae)A computed assignment operator. Adds the vector expression to
-the sparse vector.
+the mapped vector.
-template<class AE>
-sparse_vector &plus_assign (const vector_expression<AE>
+mapped_vector &plus_assign (const vector_expression<AE>
&ae)Adds a vector expression to the sparse vector. Left and right
+ Adds a vector expression to the mapped vector. Left and right
hand side of the assignment should be independent.
template<class AE>
-sparse_vector &operator -= (const vector_expression<AE>
+mapped_vector &operator -= (const vector_expression<AE>
&ae)A computed assignment operator. Subtracts the vector expression
-from the sparse vector.
+from the mapped vector.
-template<class AE>
-sparse_vector &minus_assign (const vector_expression<AE>
+mapped_vector &minus_assign (const vector_expression<AE>
&ae)Subtracts a vector expression from the sparse vector. Left and
+ Subtracts a vector expression from the mapped vector. Left and
right hand side of the assignment should be independent.
-template<class AT>
-sparse_vector &operator *= (const AT &at)A computed assignment operator. Multiplies the sparse vector
+mapped_vector &operator *= (const AT &at)
+A computed assignment operator. Multiplies the mapped vector
with a scalar.
-template<class AT>
-sparse_vector &operator /= (const AT &at)A computed assignment operator. Divides the sparse vector
+mapped_vector &operator /= (const AT &at)
+A computed assignment operator. Divides the mapped vector
through a scalar.
-
-void swap (sparse_vector &v)Swaps the contents of the sparse vectors.
+
+void swap (mapped_vector &v)Swaps the contents of the mapped vectors.
@@ -207,52 +205,52 @@ element. Duplicates elements are not allowed.
true_reference insert_element (size_type i, const_reference t)
-void clear ()Clears the sparse vector.
+Clears the mapped vector.
const_iterator begin () constReturns a
+of the const_iterator pointing to the beginning
-of the sparse_vector.mapped_vector.
const_iterator end () constReturns a
+the const_iterator pointing to the end of
-the sparse_vector.mapped_vector.
iterator begin ()Returns a
+the iterator pointing to the beginning of
-the sparse_vector.mapped_vector.
iterator end ()Returns a
+iterator pointing to the end of the
-sparse_vector.mapped_vector.
const_reverse_iterator rbegin () constReturns a
+beginning of the reversed const_reverse_iterator pointing to the
-beginning of the reversed sparse_vector.mapped_vector.
const_reverse_iterator rend () constReturns a
+end of the reversed const_reverse_iterator pointing to the
-end of the reversed sparse_vector.mapped_vector.
reverse_iterator rbegin ()Returns a
+beginning of the reversed reverse_iterator pointing to the
-beginning of the reversed sparse_vector.mapped_vector.
reverse_iterator rend ()Returns a
+the reversed reverse_iterator pointing to the end of
-the reversed sparse_vector.mapped_vector.
Notes
-map_array<std::size_t, T> and
map_std<std::size_t, T>. The latter is