From b9564a6faaabab4a2bedd16debb29033ff31d89d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Walter?= Date: Fri, 28 Nov 2003 07:58:57 +0000 Subject: [PATCH] Fewer warnings with gcc -W, bugfix for sparse_matrix. svn path=/trunk/boost/boost/numeric/ublas/; revision=20982 --- include/boost/numeric/ublas/banded.hpp | 8 ++ include/boost/numeric/ublas/functional.hpp | 90 +++++++++---------- include/boost/numeric/ublas/hermitian.hpp | 19 ++-- include/boost/numeric/ublas/matrix.hpp | 32 +++++-- include/boost/numeric/ublas/matrix_assign.hpp | 62 ++++++------- .../boost/numeric/ublas/matrix_expression.hpp | 4 +- include/boost/numeric/ublas/matrix_proxy.hpp | 16 ++-- include/boost/numeric/ublas/matrix_sparse.hpp | 26 ++++-- include/boost/numeric/ublas/noalias.hpp | 4 +- include/boost/numeric/ublas/operation.hpp | 42 +++++---- include/boost/numeric/ublas/storage.hpp | 10 +-- .../boost/numeric/ublas/storage_sparse.hpp | 4 +- include/boost/numeric/ublas/symmetric.hpp | 13 ++- include/boost/numeric/ublas/traits.hpp | 10 +-- include/boost/numeric/ublas/triangular.hpp | 8 ++ include/boost/numeric/ublas/vector.hpp | 18 +++- include/boost/numeric/ublas/vector_assign.hpp | 34 +++---- include/boost/numeric/ublas/vector_sparse.hpp | 12 +++ 18 files changed, 257 insertions(+), 155 deletions(-) diff --git a/include/boost/numeric/ublas/banded.hpp b/include/boost/numeric/ublas/banded.hpp index 4c801e3b..ed537c7a 100644 --- a/include/boost/numeric/ublas/banded.hpp +++ b/include/boost/numeric/ublas/banded.hpp @@ -58,25 +58,30 @@ namespace boost { namespace numeric { namespace ublas { // Construction and destruction BOOST_UBLAS_INLINE banded_matrix (): + matrix_expression (), size1_ (0), size2_ (0), lower_ (0), upper_ (0), data_ (0) {} BOOST_UBLAS_INLINE banded_matrix (size_type size1, size_type size2, size_type lower = 0, size_type upper = 0): + matrix_expression (), size1_ (size1), size2_ (size2), lower_ (lower), upper_ (upper), data_ (0) { resize (size1, size2, lower, upper); } BOOST_UBLAS_INLINE banded_matrix (size_type size1, size_type size2, size_type lower, size_type upper, const array_type &data): + matrix_expression (), size1_ (size1), size2_ (size2), lower_ (lower), upper_ (upper), data_ (data) {} BOOST_UBLAS_INLINE banded_matrix (const banded_matrix &m): + matrix_expression (), size1_ (m.size1_), size2_ (m.size2_), lower_ (m.lower_), upper_ (m.upper_), data_ (m.data_) {} template BOOST_UBLAS_INLINE banded_matrix (const matrix_expression &ae, size_type lower = 0, size_type upper = 0): + matrix_expression (), size1_ (ae ().size1 ()), size2_ (ae ().size2 ()), lower_ (lower), upper_ (upper), data_ (0) { #ifndef BOOST_UBLAS_TYPE_CHECK @@ -1122,12 +1127,15 @@ namespace boost { namespace numeric { namespace ublas { // Construction and destruction BOOST_UBLAS_INLINE banded_adaptor (): + matrix_expression (), data_ (nil_), lower_ (0), upper_ (0) {} BOOST_UBLAS_INLINE banded_adaptor (matrix_type &data, size_type lower = 0, size_type upper = 0): + matrix_expression (), data_ (data), lower_ (lower), upper_ (upper) {} BOOST_UBLAS_INLINE banded_adaptor (const banded_adaptor &m): + matrix_expression (), data_ (m.data_), lower_ (m.lower_), upper_ (m.upper_) {} // Accessors diff --git a/include/boost/numeric/ublas/functional.hpp b/include/boost/numeric/ublas/functional.hpp index 97ec0336..0da4d056 100644 --- a/include/boost/numeric/ublas/functional.hpp +++ b/include/boost/numeric/ublas/functional.hpp @@ -906,7 +906,7 @@ namespace boost { namespace numeric { namespace ublas { // Sparse packed case template BOOST_UBLAS_INLINE - result_type operator () (I1 it1, const I1 &it1_end, I2 it2, const I2 &it2_end, + result_type operator () (I1 it1, const I1 &it1_end, I2 it2, const I2 &/* it2_end */, sparse_bidirectional_iterator_tag, packed_random_access_iterator_tag) const { result_type t = result_type (); while (it1 != it1_end) { @@ -918,7 +918,7 @@ namespace boost { namespace numeric { namespace ublas { // Packed sparse case template BOOST_UBLAS_INLINE - result_type operator () (I1 it1, const I1 &it1_end, I2 it2, const I2 &it2_end, + result_type operator () (I1 it1, const I1 &/* it1_end */, I2 it2, const I2 &it2_end, packed_random_access_iterator_tag, sparse_bidirectional_iterator_tag) const { result_type t = result_type (); while (it2 != it2_end) { @@ -1070,7 +1070,7 @@ namespace boost { namespace numeric { namespace ublas { // Packed sparse case template BOOST_UBLAS_INLINE - result_type operator () (I1 it1, const I1 &it1_end, I2 it2, const I2 &it2_end, + result_type operator () (I1 it1, const I1 &/* it1_end */, I2 it2, const I2 &it2_end, packed_random_access_iterator_tag, sparse_bidirectional_iterator_tag) const { result_type t = result_type (); while (it2 != it2_end) { @@ -1082,7 +1082,7 @@ namespace boost { namespace numeric { namespace ublas { // Sparse packed case template BOOST_UBLAS_INLINE - result_type operator () (I1 it1, const I1 &it1_end, I2 it2, const I2 &it2_end, + result_type operator () (I1 it1, const I1 &it1_end, I2 it2, const I2 &/* it2_end */, sparse_bidirectional_iterator_tag, packed_random_access_iterator_tag) const { result_type t = result_type (); while (it1 != it1_end) { @@ -1358,22 +1358,22 @@ namespace boost { namespace numeric { namespace ublas { } static BOOST_UBLAS_INLINE - difference_type distance1 (difference_type k, size_type size1, size_type size2) { + difference_type distance1 (difference_type k, size_type /* size1 */, size_type size2) { return size2 != 0 ? k / size2 : 0; } static BOOST_UBLAS_INLINE - difference_type distance2 (difference_type k, size_type size1, size_type size2) { + difference_type distance2 (difference_type k, size_type /* size1 */, size_type /* size2 */) { return k; } static BOOST_UBLAS_INLINE - size_type index1 (difference_type k, size_type size1, size_type size2) { + size_type index1 (difference_type k, size_type /* size1 */, size_type size2) { return size2 != 0 ? k / size2 : 0; } static BOOST_UBLAS_INLINE - size_type index2 (difference_type k, size_type size1, size_type size2) { + size_type index2 (difference_type k, size_type /* size1 */, size_type size2) { return size2 != 0 ? k % size2 : 0; } static @@ -1383,7 +1383,7 @@ namespace boost { namespace numeric { namespace ublas { } static BOOST_UBLAS_INLINE - size_type one1 (size_type size1, size_type size2) { + size_type one1 (size_type /* size1 */, size_type size2) { return size2; } static @@ -1393,7 +1393,7 @@ namespace boost { namespace numeric { namespace ublas { } static BOOST_UBLAS_INLINE - size_type one2 (size_type size1, size_type size2) { + size_type one2 (size_type /* size1 */, size_type /* size2 */) { return 1; } @@ -1420,46 +1420,46 @@ namespace boost { namespace numeric { namespace ublas { static BOOST_UBLAS_INLINE - size_type element1 (size_type i, size_type size1, size_type j, size_type size2) { + size_type element1 (size_type i, size_type size1, size_type /* j */, size_type /* size2 */) { BOOST_UBLAS_CHECK (i < size1, bad_index ()); return i; } static BOOST_UBLAS_INLINE - size_type element2 (size_type i, size_type size1, size_type j, size_type size2) { + size_type element2 (size_type /* i */, size_type /* size1 */, size_type j, size_type size2) { BOOST_UBLAS_CHECK (j < size2, bad_index ()); return j; } static BOOST_UBLAS_INLINE - size_type address1 (size_type i, size_type size1, size_type j, size_type size2) { + size_type address1 (size_type i, size_type size1, size_type /* j */, size_type /* size2 */) { BOOST_UBLAS_CHECK (i <= size1, bad_index ()); return i; } static BOOST_UBLAS_INLINE - size_type address2 (size_type i, size_type size1, size_type j, size_type size2) { + size_type address2 (size_type /* i */, size_type /* size1 */, size_type j, size_type size2) { BOOST_UBLAS_CHECK (j <= size2, bad_index ()); return j; } static BOOST_UBLAS_INLINE - size_type index1 (size_type index1, size_type index2) { + size_type index1 (size_type index1, size_type /* index2 */) { return index1; } static BOOST_UBLAS_INLINE - size_type index2 (size_type index1, size_type index2) { + size_type index2 (size_type /* index1 */, size_type index2) { return index2; } static BOOST_UBLAS_INLINE - size_type size1 (size_type size1, size_type size2) { + size_type size1 (size_type size1, size_type /* size2 */) { return size1; } static BOOST_UBLAS_INLINE - size_type size2 (size_type size1, size_type size2) { + size_type size2 (size_type /* size1 */, size_type size2) { return size2; } @@ -1467,25 +1467,25 @@ namespace boost { namespace numeric { namespace ublas { template static BOOST_UBLAS_INLINE - void increment1 (I &it, size_type size1, size_type size2) { + void increment1 (I &it, size_type /* size1 */, size_type size2) { it += size2; } template static BOOST_UBLAS_INLINE - void decrement1 (I &it, size_type size1, size_type size2) { + void decrement1 (I &it, size_type /* size1 */, size_type size2) { it -= size2; } template static BOOST_UBLAS_INLINE - void increment2 (I &it, size_type size1, size_type size2) { + void increment2 (I &it, size_type /* size1 */, size_type /* size2 */) { ++ it; } template static BOOST_UBLAS_INLINE - void decrement2 (I &it, size_type size1, size_type size2) { + void decrement2 (I &it, size_type /* size1 */, size_type /* size2 */) { -- it; } }; @@ -1518,22 +1518,22 @@ namespace boost { namespace numeric { namespace ublas { } static BOOST_UBLAS_INLINE - difference_type distance1 (difference_type k, size_type size1, size_type size2) { + difference_type distance1 (difference_type k, size_type /* size1 */, size_type /* size2 */) { return k; } static BOOST_UBLAS_INLINE - difference_type distance2 (difference_type k, size_type size1, size_type size2) { + difference_type distance2 (difference_type k, size_type size1, size_type /* size2 */) { return size1 != 0 ? k / size1 : 0; } static BOOST_UBLAS_INLINE - size_type index1 (difference_type k, size_type size1, size_type size2) { + size_type index1 (difference_type k, size_type size1, size_type /* size2 */) { return size1 != 0 ? k % size1 : 0; } static BOOST_UBLAS_INLINE - size_type index2 (difference_type k, size_type size1, size_type size2) { + size_type index2 (difference_type k, size_type size1, size_type /* size2 */) { return size1 != 0 ? k / size1 : 0; } static @@ -1543,7 +1543,7 @@ namespace boost { namespace numeric { namespace ublas { } static BOOST_UBLAS_INLINE - size_type one1 (size_type size1, size_type size2) { + size_type one1 (size_type /* size1 */, size_type /* size2 */) { return 1; } static @@ -1553,7 +1553,7 @@ namespace boost { namespace numeric { namespace ublas { } static BOOST_UBLAS_INLINE - size_type one2 (size_type size1, size_type size2) { + size_type one2 (size_type size1, size_type /* size2 */) { return size1; } @@ -1580,46 +1580,46 @@ namespace boost { namespace numeric { namespace ublas { static BOOST_UBLAS_INLINE - size_type element1 (size_type i, size_type size1, size_type j, size_type size2) { + size_type element1 (size_type /* i */, size_type /* size1 */, size_type j, size_type size2) { BOOST_UBLAS_CHECK (j < size2, bad_index ()); return j; } static BOOST_UBLAS_INLINE - size_type element2 (size_type i, size_type size1, size_type j, size_type size2) { + size_type element2 (size_type i, size_type size1, size_type /* j */, size_type /* size2 */) { BOOST_UBLAS_CHECK (i < size1, bad_index ()); return i; } static BOOST_UBLAS_INLINE - size_type address1 (size_type i, size_type size1, size_type j, size_type size2) { + size_type address1 (size_type /* i */, size_type /* size1 */, size_type j, size_type size2) { BOOST_UBLAS_CHECK (j <= size2, bad_index ()); return j; } static BOOST_UBLAS_INLINE - size_type address2 (size_type i, size_type size1, size_type j, size_type size2) { + size_type address2 (size_type i, size_type size1, size_type /* j */, size_type /* size2 */) { BOOST_UBLAS_CHECK (i <= size1, bad_index ()); return i; } static BOOST_UBLAS_INLINE - size_type index1 (size_type index1, size_type index2) { + size_type index1 (size_type /* index1 */, size_type index2) { return index2; } static BOOST_UBLAS_INLINE - size_type index2 (size_type index1, size_type index2) { + size_type index2 (size_type index1, size_type /* index2 */) { return index1; } static BOOST_UBLAS_INLINE - size_type size1 (size_type size1, size_type size2) { + size_type size1 (size_type /* size1 */, size_type size2) { return size2; } static BOOST_UBLAS_INLINE - size_type size2 (size_type size1, size_type size2) { + size_type size2 (size_type size1, size_type /* size2 */) { return size1; } @@ -1627,25 +1627,25 @@ namespace boost { namespace numeric { namespace ublas { template static BOOST_UBLAS_INLINE - void increment1 (I &it, size_type size1, size_type size2) { + void increment1 (I &it, size_type /* size1 */, size_type /* size2 */) { ++ it; } template static BOOST_UBLAS_INLINE - void decrement1 (I &it, size_type size1, size_type size2) { + void decrement1 (I &it, size_type /* size1 */, size_type /* size2 */) { -- it; } template static BOOST_UBLAS_INLINE - void increment2 (I &it, size_type size1, size_type size2) { + void increment2 (I &it, size_type size1, size_type /* size2 */) { it += size1; } template static BOOST_UBLAS_INLINE - void decrement2 (I &it, size_type size1, size_type size2) { + void decrement2 (I &it, size_type size1, size_type /* size2 */) { it -= size1; } }; @@ -1661,17 +1661,17 @@ namespace boost { namespace numeric { namespace ublas { static BOOST_UBLAS_INLINE - bool zero (size_type i, size_type j) { + bool zero (size_type /* i */, size_type /* j */) { return false; } static BOOST_UBLAS_INLINE - bool one (size_type i, size_type j) { + bool one (size_type /* i */, size_type /* j */) { return false; } static BOOST_UBLAS_INLINE - bool other (size_type i, size_type j) { + bool other (size_type /* i */, size_type /* j */) { return true; } }; @@ -1694,7 +1694,7 @@ namespace boost { namespace numeric { namespace ublas { } static BOOST_UBLAS_INLINE - bool one (size_type i, size_type j) { + bool one (size_type /* i */, size_type /* j */) { return false; } static @@ -1748,7 +1748,7 @@ namespace boost { namespace numeric { namespace ublas { } static BOOST_UBLAS_INLINE - bool one (size_type i, size_type j) { + bool one (size_type /* i */, size_type /* j */) { return false; } static diff --git a/include/boost/numeric/ublas/hermitian.hpp b/include/boost/numeric/ublas/hermitian.hpp index 8bf357d0..333dcf8e 100644 --- a/include/boost/numeric/ublas/hermitian.hpp +++ b/include/boost/numeric/ublas/hermitian.hpp @@ -325,27 +325,33 @@ namespace boost { namespace numeric { namespace ublas { // Construction and destruction BOOST_UBLAS_INLINE - hermitian_matrix (): + hermitian_matrix (): + matrix_expression (), size_ (0), data_ (0) {} BOOST_UBLAS_INLINE hermitian_matrix (size_type size): + matrix_expression (), size_ (BOOST_UBLAS_SAME (size, size)), data_ (0) { resize (size); } BOOST_UBLAS_INLINE hermitian_matrix (size_type size1, size_type size2): + matrix_expression (), size_ (BOOST_UBLAS_SAME (size1, size2)), data_ (0) { resize (size1, size2); } BOOST_UBLAS_INLINE hermitian_matrix (size_type size, const array_type &data): + matrix_expression (), size_ (size), data_ (data) {} BOOST_UBLAS_INLINE hermitian_matrix (const hermitian_matrix &m): + matrix_expression (), size_ (m.size_), data_ (m.data_) {} template BOOST_UBLAS_INLINE hermitian_matrix (const matrix_expression &ae): + matrix_expression (), size_ (BOOST_UBLAS_SAME (ae ().size1 (), ae ().size2 ())), data_ (0) { #ifndef BOOST_UBLAS_TYPE_CHECK resize (ae ().size1 (), ae ().size2 (), false); @@ -357,7 +363,7 @@ namespace boost { namespace numeric { namespace ublas { // Accessors BOOST_UBLAS_INLINE - size_type size1 () const { + size_type size1 () const { return size_; } BOOST_UBLAS_INLINE @@ -614,7 +620,7 @@ namespace boost { namespace numeric { namespace ublas { // Element lookup BOOST_UBLAS_INLINE - const_iterator1 find1 (int rank, size_type i, size_type j) const { + const_iterator1 find1 (int /* rank */, size_type i, size_type j) const { return const_iterator1 (*this, i, j); } BOOST_UBLAS_INLINE @@ -624,7 +630,7 @@ namespace boost { namespace numeric { namespace ublas { return iterator1 (*this, i, j); } BOOST_UBLAS_INLINE - const_iterator2 find2 (int rank, size_type i, size_type j) const { + const_iterator2 find2 (int /* rank */, size_type i, size_type j) const { return const_iterator2 (*this, i, j); } BOOST_UBLAS_INLINE @@ -1325,16 +1331,19 @@ namespace boost { namespace numeric { namespace ublas { // Construction and destruction BOOST_UBLAS_INLINE hermitian_adaptor (): + matrix_expression (), data_ (nil_) { BOOST_UBLAS_CHECK (data_.size1 () == data_.size2 (), bad_size ()); } BOOST_UBLAS_INLINE hermitian_adaptor (matrix_type &data): + matrix_expression (), data_ (data) { BOOST_UBLAS_CHECK (data_.size1 () == data_.size2 (), bad_size ()); } BOOST_UBLAS_INLINE - hermitian_adaptor (const hermitian_adaptor &m): + hermitian_adaptor (const hermitian_adaptor &m): + matrix_expression (), data_ (m.data_) { BOOST_UBLAS_CHECK (data_.size1 () == data_.size2 (), bad_size ()); } diff --git a/include/boost/numeric/ublas/matrix.hpp b/include/boost/numeric/ublas/matrix.hpp index 95ae894a..6275b9c9 100644 --- a/include/boost/numeric/ublas/matrix.hpp +++ b/include/boost/numeric/ublas/matrix.hpp @@ -67,21 +67,26 @@ namespace boost { namespace numeric { namespace ublas { // Construction and destruction BOOST_UBLAS_INLINE matrix (): + matrix_expression (), size1_ (0), size2_ (0), data_ (0) {} BOOST_UBLAS_INLINE matrix (size_type size1, size_type size2): + matrix_expression (), size1_ (size1), size2_ (size2), data_ (0) { resize (size1, size2); } BOOST_UBLAS_INLINE matrix (size_type size1, size_type size2, const array_type &data): + matrix_expression (), size1_ (size1), size2_ (size2), data_ (data) {} BOOST_UBLAS_INLINE matrix (const matrix &m): + matrix_expression (), size1_ (m.size1_), size2_ (m.size2_), data_ (m.data_) {} template BOOST_UBLAS_INLINE matrix (const matrix_expression &ae): + matrix_expression (), size1_ (ae ().size1 ()), size2_ (ae ().size2 ()), data_ (0) { #ifndef BOOST_UBLAS_TYPE_CHECK resize (ae ().size1 (), ae ().size2 (), false); @@ -280,7 +285,7 @@ namespace boost { namespace numeric { namespace ublas { // Element lookup BOOST_UBLAS_INLINE - const_iterator1 find1 (int rank, size_type i, size_type j) const { + const_iterator1 find1 (int /* rank */, size_type i, size_type j) const { #ifdef BOOST_UBLAS_USE_INDEXED_ITERATOR return const_iterator1 (*this, i, j); #else @@ -288,7 +293,7 @@ namespace boost { namespace numeric { namespace ublas { #endif } BOOST_UBLAS_INLINE - iterator1 find1 (int rank, size_type i, size_type j) { + iterator1 find1 (int /* rank */, size_type i, size_type j) { #ifdef BOOST_UBLAS_USE_INDEXED_ITERATOR return iterator1 (*this, i, j); #else @@ -296,7 +301,7 @@ namespace boost { namespace numeric { namespace ublas { #endif } BOOST_UBLAS_INLINE - const_iterator2 find2 (int rank, size_type i, size_type j) const { + const_iterator2 find2 (int /* rank */, size_type i, size_type j) const { #ifdef BOOST_UBLAS_USE_INDEXED_ITERATOR return const_iterator2 (*this, i, j); #else @@ -304,7 +309,7 @@ namespace boost { namespace numeric { namespace ublas { #endif } BOOST_UBLAS_INLINE - iterator2 find2 (int rank, size_type i, size_type j) { + iterator2 find2 (int /* rank */, size_type i, size_type j) { #ifdef BOOST_UBLAS_USE_INDEXED_ITERATOR return iterator2 (*this, i, j); #else @@ -1003,18 +1008,22 @@ namespace boost { namespace numeric { namespace ublas { // Construction and destruction BOOST_UBLAS_INLINE vector_of_vector (): + matrix_expression (), size1_ (0), size2_ (0), data_ (1) {} BOOST_UBLAS_INLINE vector_of_vector (size_type size1, size_type size2): + matrix_expression (), size1_ (size1), size2_ (size2), data_ (1) { resize (size1, size2); } BOOST_UBLAS_INLINE vector_of_vector (const vector_of_vector &m): + matrix_expression (), size1_ (m.size1_), size2_ (m.size2_), data_ (m.data_) {} template BOOST_UBLAS_INLINE vector_of_vector (const matrix_expression &ae): + matrix_expression (), size1_ (ae ().size1 ()), size2_ (ae ().size2 ()), data_ (1) { resize (ae ().size1 (), ae ().size2 (), false); matrix_assign (scalar_assign (), *this, ae); @@ -1022,7 +1031,7 @@ namespace boost { namespace numeric { namespace ublas { // Accessors BOOST_UBLAS_INLINE - size_type size1 () const { + size_type size1 () const { return size1_; } BOOST_UBLAS_INLINE @@ -1957,15 +1966,19 @@ namespace boost { namespace numeric { namespace ublas { // Construction and destruction BOOST_UBLAS_INLINE identity_matrix (): + matrix_expression (), size1_ (0), size2_ (0) {} BOOST_UBLAS_INLINE identity_matrix (size_type size): + matrix_expression (), size1_ (size), size2_ (size) {} BOOST_UBLAS_INLINE identity_matrix (size_type size1, size_type size2): + matrix_expression (), size1_ (size1), size2_ (size2) {} BOOST_UBLAS_INLINE identity_matrix (const identity_matrix &m): + matrix_expression (), size1_ (m.size1_), size2_ (m.size2_) {} // Accessors @@ -2424,15 +2437,19 @@ namespace boost { namespace numeric { namespace ublas { // Construction and destruction BOOST_UBLAS_INLINE zero_matrix (): + matrix_expression (), size1_ (0), size2_ (0) {} BOOST_UBLAS_INLINE zero_matrix (size_type size): + matrix_expression (), size1_ (size), size2_ (size) {} BOOST_UBLAS_INLINE zero_matrix (size_type size1, size_type size2): + matrix_expression (), size1_ (size1), size2_ (size2) {} BOOST_UBLAS_INLINE zero_matrix (const zero_matrix &m): + matrix_expression (), size1_ (m.size1_), size2_ (m.size2_) {} // Accessors @@ -2459,7 +2476,7 @@ namespace boost { namespace numeric { namespace ublas { // Element access BOOST_UBLAS_INLINE - const_reference operator () (size_type i, size_type j) const { + const_reference operator () (size_type /* i */, size_type /* j */) const { return zero_; } @@ -2876,12 +2893,15 @@ namespace boost { namespace numeric { namespace ublas { // Construction and destruction BOOST_UBLAS_INLINE scalar_matrix (): + matrix_expression (), size1_ (0), size2_ (0), value_ () {} BOOST_UBLAS_INLINE scalar_matrix (size_type size1, size_type size2, const value_type &value): + matrix_expression (), size1_ (size1), size2_ (size2), value_ (value) {} BOOST_UBLAS_INLINE scalar_matrix (const scalar_matrix &m): + matrix_expression (), size1_ (m.size1_), size2_ (m.size2_), value_ (m.value_) {} // Accessors diff --git a/include/boost/numeric/ublas/matrix_assign.hpp b/include/boost/numeric/ublas/matrix_assign.hpp index 92618892..fea6931e 100644 --- a/include/boost/numeric/ublas/matrix_assign.hpp +++ b/include/boost/numeric/ublas/matrix_assign.hpp @@ -96,7 +96,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void iterating_matrix_assign_scalar (const F &f, M &m, const T &t, row_major_tag) { + void iterating_matrix_assign_scalar (F, M &m, const T &t, row_major_tag) { typedef F functor_type; typedef typename M::difference_type difference_type; difference_type size1 (m.size1 ()); @@ -124,7 +124,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void iterating_matrix_assign_scalar (const F &f, M &m, const T &t, column_major_tag) { + void iterating_matrix_assign_scalar (F, M &m, const T &t, column_major_tag) { typedef F functor_type; typedef typename M::difference_type difference_type; difference_type size2 (m.size2 ()); @@ -152,7 +152,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void indexing_matrix_assign_scalar (const F &f, M &m, const T &t, row_major_tag) { + void indexing_matrix_assign_scalar (F, M &m, const T &t, row_major_tag) { typedef F functor_type; typedef typename M::difference_type difference_type; difference_type size1 (m.size1 ()); @@ -171,7 +171,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void indexing_matrix_assign_scalar (const F &f, M &m, const T &t, column_major_tag) { + void indexing_matrix_assign_scalar (F, M &m, const T &t, column_major_tag) { typedef F functor_type; typedef typename M::difference_type difference_type; difference_type size2 (m.size2 ()); @@ -191,7 +191,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void matrix_assign_scalar (const F &f, M &m, const T &t, dense_proxy_tag, C c) { + void matrix_assign_scalar (F, M &m, const T &t, dense_proxy_tag, C) { typedef F functor_type; typedef C orientation_category; #ifdef BOOST_UBLAS_USE_INDEXING @@ -213,7 +213,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void matrix_assign_scalar (const F &f, M &m, const T &t, packed_proxy_tag, row_major_tag) { + void matrix_assign_scalar (F, M &m, const T &t, packed_proxy_tag, row_major_tag) { typedef F functor_type; typedef typename M::difference_type difference_type; typename M::iterator1 it1 (m.begin1 ()); @@ -235,7 +235,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void matrix_assign_scalar (const F &f, M &m, const T &t, packed_proxy_tag, column_major_tag) { + void matrix_assign_scalar (F, M &m, const T &t, packed_proxy_tag, column_major_tag) { typedef F functor_type; typedef typename M::difference_type difference_type; typename M::iterator2 it2 (m.begin2 ()); @@ -257,7 +257,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void matrix_assign_scalar (const F &f, M &m, const T &t, sparse_proxy_tag, row_major_tag) { + void matrix_assign_scalar (F, M &m, const T &t, sparse_proxy_tag, row_major_tag) { typedef F functor_type; typename M::iterator1 it1 (m.begin1 ()); typename M::iterator1 it1_end (m.end1 ()); @@ -278,7 +278,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void matrix_assign_scalar (const F &f, M &m, const T &t, sparse_proxy_tag, column_major_tag) { + void matrix_assign_scalar (F, M &m, const T &t, sparse_proxy_tag, column_major_tag) { typedef F functor_type; typename M::iterator2 it2 (m.begin2 ()); typename M::iterator2 it2_end (m.end2 ()); @@ -299,7 +299,7 @@ namespace boost { namespace numeric { namespace ublas { // Dispatcher template BOOST_UBLAS_INLINE - void matrix_assign_scalar (const F &f, M &m, const T &t) { + void matrix_assign_scalar (F, M &m, const T &t) { typedef F functor_type; typedef typename M::storage_category storage_category; typedef typename M::orientation_category orientation_category; @@ -380,7 +380,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void iterating_matrix_assign (const F &f, M &m, const matrix_expression &e, row_major_tag) { + void iterating_matrix_assign (F, M &m, const matrix_expression &e, row_major_tag) { typedef F functor_type; typedef typename M::difference_type difference_type; difference_type size1 (BOOST_UBLAS_SAME (m.size1 (), e ().size1 ())); @@ -413,7 +413,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void iterating_matrix_assign (const F &f, M &m, const matrix_expression &e, column_major_tag) { + void iterating_matrix_assign (F, M &m, const matrix_expression &e, column_major_tag) { typedef F functor_type; typedef typename M::difference_type difference_type; difference_type size2 (BOOST_UBLAS_SAME (m.size2 (), e ().size2 ())); @@ -446,7 +446,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void indexing_matrix_assign (const F &f, M &m, const matrix_expression &e, row_major_tag) { + void indexing_matrix_assign (F, M &m, const matrix_expression &e, row_major_tag) { typedef F functor_type; typedef typename M::difference_type difference_type; difference_type size1 (BOOST_UBLAS_SAME (m.size1 (), e ().size1 ())); @@ -465,7 +465,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void indexing_matrix_assign (const F &f, M &m, const matrix_expression &e, column_major_tag) { + void indexing_matrix_assign (F, M &m, const matrix_expression &e, column_major_tag) { typedef F functor_type; typedef typename M::difference_type difference_type; difference_type size2 (BOOST_UBLAS_SAME (m.size2 (), e ().size2 ())); @@ -485,7 +485,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void matrix_assign (const F &f, M &m, const matrix_expression &e, full, dense_proxy_tag, C c) { + void matrix_assign (F, M &m, const matrix_expression &e, full, dense_proxy_tag, C) { typedef F functor_type; typedef C orientation_category; #ifdef BOOST_UBLAS_USE_INDEXING @@ -507,7 +507,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void matrix_assign (const F1 &f1, M &m, const matrix_expression &e, const F2 &f2, packed_proxy_tag, row_major_tag) { + void matrix_assign (F1, M &m, const matrix_expression &e, F2, packed_proxy_tag, row_major_tag) { BOOST_UBLAS_CHECK (m.size1 () == e ().size1 (), bad_size ()); BOOST_UBLAS_CHECK (m.size2 () == e ().size2 (), bad_size ()); typedef F1 functor1_type; @@ -642,7 +642,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void matrix_assign (const F1 &f1, M &m, const matrix_expression &e, const F2 &f2, packed_proxy_tag, column_major_tag) { + void matrix_assign (F1, M &m, const matrix_expression &e, F2, packed_proxy_tag, column_major_tag) { BOOST_UBLAS_CHECK (m.size2 () == e ().size2 (), bad_size ()); BOOST_UBLAS_CHECK (m.size1 () == e ().size1 (), bad_size ()); typedef F1 functor1_type; @@ -777,7 +777,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void matrix_assign (const F &f, M &m, const matrix_expression &e, full, sparse_tag, row_major_tag) { + void matrix_assign (F, M &m, const matrix_expression &e, full, sparse_tag, row_major_tag) { BOOST_UBLAS_CHECK (m.size1 () == e ().size1 (), bad_size ()); BOOST_UBLAS_CHECK (m.size2 () == e ().size2 (), bad_size ()); typedef F functor_type; @@ -820,7 +820,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void matrix_assign (const F &f, M &m, const matrix_expression &e, full, sparse_tag, column_major_tag) { + void matrix_assign (F, M &m, const matrix_expression &e, full, sparse_tag, column_major_tag) { BOOST_UBLAS_CHECK (m.size1 () == e ().size1 (), bad_size ()); BOOST_UBLAS_CHECK (m.size2 () == e ().size2 (), bad_size ()); typedef F functor_type; @@ -863,7 +863,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void matrix_assign (const F1 &f1, M &m, const matrix_expression &e, const F2 &f2, sparse_proxy_tag, row_major_tag) { + void matrix_assign (F1, M &m, const matrix_expression &e, F2, sparse_proxy_tag, row_major_tag) { BOOST_UBLAS_CHECK (m.size1 () == e ().size1 (), bad_size ()); BOOST_UBLAS_CHECK (m.size2 () == e ().size2 (), bad_size ()); typedef F1 functor1_type; @@ -1075,7 +1075,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void matrix_assign (const F1 &f1, M &m, const matrix_expression &e, const F2 &f2, sparse_proxy_tag, column_major_tag) { + void matrix_assign (F1, M &m, const matrix_expression &e, F2, sparse_proxy_tag, column_major_tag) { BOOST_UBLAS_CHECK (m.size1 () == e ().size1 (), bad_size ()); BOOST_UBLAS_CHECK (m.size2 () == e ().size2 (), bad_size ()); typedef F1 functor1_type; @@ -1287,7 +1287,7 @@ namespace boost { namespace numeric { namespace ublas { // Dispatcher template BOOST_UBLAS_INLINE - void matrix_assign (const F &f, M &m, const matrix_expression &e) { + void matrix_assign (F, M &m, const matrix_expression &e) { typedef F functor_type; typedef typename matrix_assign_traits BOOST_UBLAS_INLINE - void matrix_assign (const F1 &f1, M &m, const matrix_expression &e, const F2 &f2) { + void matrix_assign (F1, M &m, const matrix_expression &e, F2) { typedef F1 functor1_type; typedef F2 functor2_type; typedef typename matrix_assign_traits // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void matrix_swap (const F &f, M &m, matrix_expression &e, full, dense_proxy_tag, row_major_tag) { + void matrix_swap (F, M &m, matrix_expression &e, full, dense_proxy_tag, row_major_tag) { typedef F functor_type; typedef typename M::size_type size_type; typedef typename M::difference_type difference_type; @@ -1362,7 +1362,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void matrix_swap (const F &f, M &m, matrix_expression &e, full, dense_proxy_tag, column_major_tag) { + void matrix_swap (F, M &m, matrix_expression &e, full, dense_proxy_tag, column_major_tag) { typedef F functor_type; typedef typename M::size_type size_type; typedef typename M::difference_type difference_type; @@ -1388,7 +1388,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void matrix_swap (const F1 &f1, M &m, matrix_expression &e, const F2 &f2, packed_proxy_tag, row_major_tag) { + void matrix_swap (F1, M &m, matrix_expression &e, F2, packed_proxy_tag, row_major_tag) { typedef F1 functor1_type; typedef F2 functor2_type; typedef typename M::size_type size_type; @@ -1415,7 +1415,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void matrix_swap (const F1 &f1, M &m, matrix_expression &e, const F2 &f2, packed_proxy_tag, column_major_tag) { + void matrix_swap (F1, M &m, matrix_expression &e, F2, packed_proxy_tag, column_major_tag) { typedef F1 functor1_type; typedef F2 functor2_type; typedef typename M::size_type size_type; @@ -1442,7 +1442,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void matrix_swap (const F1 &f1, M &m, matrix_expression &e, const F2 &f2, sparse_proxy_tag, row_major_tag) { + void matrix_swap (F1, M &m, matrix_expression &e, F2, sparse_proxy_tag, row_major_tag) { BOOST_UBLAS_CHECK (m.size1 () == e ().size1 (), bad_size ()); BOOST_UBLAS_CHECK (m.size2 () == e ().size2 (), bad_size ()); typedef F1 functor1_type; @@ -1701,7 +1701,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void matrix_swap (const F1 &f1, M &m, matrix_expression &e, const F2 &f2, sparse_proxy_tag, column_major_tag) { + void matrix_swap (F1, M &m, matrix_expression &e, F2, sparse_proxy_tag, column_major_tag) { BOOST_UBLAS_CHECK (m.size1 () == e ().size1 (), bad_size ()); BOOST_UBLAS_CHECK (m.size2 () == e ().size2 (), bad_size ()); typedef F1 functor1_type; @@ -1962,7 +1962,7 @@ namespace boost { namespace numeric { namespace ublas { // Dispatcher template BOOST_UBLAS_INLINE - void matrix_swap (const F &f, M &m, matrix_expression &e) { + void matrix_swap (F, M &m, matrix_expression &e) { typedef F functor_type; typedef typename matrix_swap_traits BOOST_UBLAS_INLINE - void matrix_swap (const F1 &f1, M &m, matrix_expression &e, const F2 &f2) { + void matrix_swap (F1, M &m, matrix_expression &e, F2) { typedef F1 functor1_type; typedef F2 functor2_type; typedef typename matrix_swap_traits (), size1_ (0), size2_ (0), non_zeros_ (0), data_ () {} BOOST_UBLAS_INLINE sparse_matrix (size_type size1, size_type size2, size_type non_zeros = 0): + matrix_expression (), size1_ (size1), size2_ (size2), non_zeros_ (non_zeros), data_ () { reserve (non_zeros_); } BOOST_UBLAS_INLINE sparse_matrix (const sparse_matrix &m): + matrix_expression (), size1_ (m.size1_), size2_ (m.size2_), non_zeros_ (m.non_zeros_), data_ (m.data_) {} template BOOST_UBLAS_INLINE sparse_matrix (const matrix_expression &ae, size_type non_zeros = 0): + matrix_expression (), size1_ (ae ().size1 ()), size2_ (ae ().size2 ()), non_zeros_ (non_zeros), data_ () { reserve (non_zeros_); matrix_assign (scalar_assign (), *this, ae); @@ -484,7 +488,7 @@ namespace boost { namespace numeric { namespace ublas { template BOOST_UBLAS_INLINE sparse_matrix &plus_assign (const matrix_expression &ae) { - matrix_assign (scalar_plus_assign (), *this, ae); + matrix_assign (scalar_plus_assign (), *this, ae); return *this; } template @@ -585,7 +589,7 @@ namespace boost { namespace numeric { namespace ublas { #ifdef BOOST_UBLAS_BOUNDS_CHECK size_type index1 = size_type (-1); #endif - while (it != it_end) { + while (rank == 1 && it != it_end) { index2 = functor_type::index2 ((*it).first, size1_, size2_); #ifdef BOOST_UBLAS_BOUNDS_CHECK index1 = functor_type::index1 ((*it).first, size1_, size2_); @@ -624,7 +628,7 @@ namespace boost { namespace numeric { namespace ublas { #ifdef BOOST_UBLAS_BOUNDS_CHECK size_type index1 = size_type (-1); #endif - while (it != it_end) { + while (rank == 1 && it != it_end) { index2 = functor_type::index2 ((*it).first, size1_, size2_); #ifdef BOOST_UBLAS_BOUNDS_CHECK index1 = functor_type::index1 ((*it).first, size1_, size2_); @@ -663,7 +667,7 @@ namespace boost { namespace numeric { namespace ublas { #ifdef BOOST_UBLAS_BOUNDS_CHECK size_type index2 = size_type (-1); #endif - while (it != it_end) { + while (rank == 1 && it != it_end) { index1 = functor_type::index1 ((*it).first, size1_, size2_); #ifdef BOOST_UBLAS_BOUNDS_CHECK index2 = functor_type::index2 ((*it).first, size1_, size2_); @@ -702,7 +706,7 @@ namespace boost { namespace numeric { namespace ublas { #ifdef BOOST_UBLAS_BOUNDS_CHECK size_type index2 = size_type (-1); #endif - while (it != it_end) { + while (rank == 1 && it != it_end) { index1 = functor_type::index1 ((*it).first, size1_, size2_); #ifdef BOOST_UBLAS_BOUNDS_CHECK index2 = functor_type::index2 ((*it).first, size1_, size2_); @@ -1443,20 +1447,24 @@ namespace boost { namespace numeric { namespace ublas { // Construction and destruction BOOST_UBLAS_INLINE sparse_vector_of_sparse_vector (): + matrix_expression (), size1_ (0), size2_ (0), non_zeros_ (0), data_ () { data_ [functor_type::size1 (size1_, size2_)] = vector_data_value_type (); } BOOST_UBLAS_INLINE sparse_vector_of_sparse_vector (size_type size1, size_type size2, size_type non_zeros = 0): + matrix_expression (), size1_ (size1), size2_ (size2), non_zeros_ (non_zeros), data_ () { data_ [functor_type::size1 (size1_, size2_)] = vector_data_value_type (); } BOOST_UBLAS_INLINE sparse_vector_of_sparse_vector (const sparse_vector_of_sparse_vector &m): + matrix_expression (), size1_ (m.size1_), size2_ (m.size2_), non_zeros_ (m.non_zeros_), data_ (m.data_) {} template BOOST_UBLAS_INLINE sparse_vector_of_sparse_vector (const matrix_expression &ae, size_type non_zeros = 0): + matrix_expression (), size1_ (ae ().size1 ()), size2_ (ae ().size2 ()), non_zeros_ (non_zeros), data_ () { data_ [functor_type::size1 (size1_, size2_)] = vector_data_value_type (); matrix_assign (scalar_assign (), *this, ae); @@ -2600,6 +2608,7 @@ namespace boost { namespace numeric { namespace ublas { // Construction and destruction BOOST_UBLAS_INLINE compressed_matrix (): + matrix_expression (), size1_ (0), size2_ (0), non_zeros_ (0), filled1_ (1), filled2_ (0), index1_data_ (1), @@ -2608,6 +2617,7 @@ namespace boost { namespace numeric { namespace ublas { } BOOST_UBLAS_INLINE compressed_matrix (size_type size1, size_type size2, size_type non_zeros = 0): + matrix_expression (), size1_ (size1), size2_ (size2), non_zeros_ (non_zeros), filled1_ (1), filled2_ (0), index1_data_ (functor_type::size1 (size1_, size2_) + 1), @@ -2617,6 +2627,7 @@ namespace boost { namespace numeric { namespace ublas { } BOOST_UBLAS_INLINE compressed_matrix (const compressed_matrix &m): + matrix_expression (), size1_ (m.size1_), size2_ (m.size2_), non_zeros_ (m.non_zeros_), filled1_ (m.filled1_), filled2_ (m.filled2_), index1_data_ (m.index1_data_), @@ -2626,6 +2637,7 @@ namespace boost { namespace numeric { namespace ublas { template BOOST_UBLAS_INLINE compressed_matrix (const matrix_expression &ae, size_type non_zeros = 0): + matrix_expression (), size1_ (ae ().size1 ()), size2_ (ae ().size2 ()), non_zeros_ (non_zeros), filled1_ (1), filled2_ (0), index1_data_ (functor_type::size1 (ae ().size1 (), ae ().size2 ()) + 1), @@ -3910,12 +3922,14 @@ namespace boost { namespace numeric { namespace ublas { // Construction and destruction BOOST_UBLAS_INLINE coordinate_matrix (): + matrix_expression (), size1_ (0), size2_ (0), non_zeros_ (0), filled_ (0), sorted_ (true), index1_data_ (), index2_data_ (), value_data_ () {} BOOST_UBLAS_INLINE coordinate_matrix (size_type size1, size_type size2, size_type non_zeros = 0): + matrix_expression (), size1_ (size1), size2_ (size2), non_zeros_ (non_zeros), filled_ (0), sorted_ (true), index1_data_ (non_zeros), @@ -3924,6 +3938,7 @@ namespace boost { namespace numeric { namespace ublas { } BOOST_UBLAS_INLINE coordinate_matrix (const coordinate_matrix &m): + matrix_expression (), size1_ (m.size1_), size2_ (m.size2_), non_zeros_ (m.non_zeros_), filled_ (m.filled_), sorted_ (m.sorted_), index1_data_ (m.index1_data_), @@ -3931,6 +3946,7 @@ namespace boost { namespace numeric { namespace ublas { template BOOST_UBLAS_INLINE coordinate_matrix (const matrix_expression &ae, size_type non_zeros = 0): + matrix_expression (), size1_ (ae ().size1 ()), size2_ (ae ().size2 ()), non_zeros_ (non_zeros), filled_ (0), sorted_ (true), index1_data_ (non_zeros), diff --git a/include/boost/numeric/ublas/noalias.hpp b/include/boost/numeric/ublas/noalias.hpp index aa3cc53e..3be0c008 100644 --- a/include/boost/numeric/ublas/noalias.hpp +++ b/include/boost/numeric/ublas/noalias.hpp @@ -26,10 +26,10 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_INLINE noalias_proxy (C& lval): - lval_ (lval) {} + boost::nonassignable (), lval_ (lval) {} BOOST_UBLAS_INLINE noalias_proxy (const noalias_proxy& p): - lval_ (p.lval_) {} + boost::nonassignable (), lval_ (p.lval_) {} template BOOST_UBLAS_INLINE diff --git a/include/boost/numeric/ublas/operation.hpp b/include/boost/numeric/ublas/operation.hpp index d7ac2c4f..39b845b8 100644 --- a/include/boost/numeric/ublas/operation.hpp +++ b/include/boost/numeric/ublas/operation.hpp @@ -418,7 +418,7 @@ namespace boost { namespace numeric { namespace ublas { M & axpy_prod (const matrix_expression &e1, const matrix_expression &e2, - M &m, const F &f, + M &m, F, dense_proxy_tag, row_major_tag) { typedef M matrix_type; typedef const E1 expression1_type; @@ -445,13 +445,14 @@ namespace boost { namespace numeric { namespace ublas { M & axpy_prod (const matrix_expression &e1, const matrix_expression &e2, - M &m, const F &f, + M &m, F, sparse_proxy_tag, row_major_tag) { typedef M matrix_type; typedef const E1 expression1_type; typedef const E2 expression2_type; typedef typename M::size_type size_type; typedef typename M::value_type value_type; + typedef F functor_type; #ifdef BOOST_UBLAS_TYPE_CHECK matrix cm (m.size1 (), m.size2 ()); @@ -473,7 +474,7 @@ namespace boost { namespace numeric { namespace ublas { typename matrix_row::const_iterator itr (mr.begin ()); typename matrix_row::const_iterator itr_end (mr.end ()); while (itr != itr_end) { - if (f.other (it1.index1 (), itr.index ())) + if (functor_type ().other (it1.index1 (), itr.index ())) m (it1.index1 (), itr.index ()) += *it2 * *itr; ++ itr; } @@ -492,7 +493,7 @@ namespace boost { namespace numeric { namespace ublas { M & axpy_prod (const matrix_expression &e1, const matrix_expression &e2, - M &m, const F &f, + M &m, F, dense_proxy_tag, column_major_tag) { typedef M matrix_type; typedef const E1 expression1_type; @@ -519,13 +520,14 @@ namespace boost { namespace numeric { namespace ublas { M & axpy_prod (const matrix_expression &e1, const matrix_expression &e2, - M &m, const F &f, + M &m, F, sparse_proxy_tag, column_major_tag) { typedef M matrix_type; typedef const E1 expression1_type; typedef const E2 expression2_type; typedef typename M::size_type size_type; typedef typename M::value_type value_type; + typedef F functor_type; #ifdef BOOST_UBLAS_TYPE_CHECK matrix cm (m.size1 (), m.size2 ()); @@ -547,7 +549,7 @@ namespace boost { namespace numeric { namespace ublas { typename matrix_column::const_iterator itc (mc.begin ()); typename matrix_column::const_iterator itc_end (mc.end ()); while (itc != itc_end) { - if (f.other (itc.index (), it2.index2 ())) + if (functor_type ().other (itc.index (), it2.index2 ())) m (itc.index (), it2.index2 ()) += *it1 * *itc; ++ itc; } @@ -567,27 +569,29 @@ namespace boost { namespace numeric { namespace ublas { M & axpy_prod (const matrix_expression &e1, const matrix_expression &e2, - M &m, const F &f, bool init = true) { + M &m, F, bool init = true) { typedef typename M::value_type value_type; typedef typename M::storage_category storage_category; typedef typename M::orientation_category orientation_category; + typedef F functor_type; if (init) m.assign (zero_matrix (e1 ().size1 (), e2 ().size2 ())); - return axpy_prod (e1, e2, m, f, storage_category (), orientation_category ()); + return axpy_prod (e1, e2, m, functor_type (), storage_category (), orientation_category ()); } template BOOST_UBLAS_INLINE M axpy_prod (const matrix_expression &e1, const matrix_expression &e2, - const F &f) { + F) { typedef M matrix_type; + typedef F functor_type; matrix_type m (e1 ().size1 (), e2 ().size2 ()); // FIXME: needed for c_matrix?! - // return axpy_prod (e1, e2, m, f, false); - return axpy_prod (e1, e2, m, f, true); + // return axpy_prod (e1, e2, m, functor_type (), false); + return axpy_prod (e1, e2, m, functor_type (), true); } template BOOST_UBLAS_INLINE @@ -621,7 +625,7 @@ namespace boost { namespace numeric { namespace ublas { M & opb_prod (const matrix_expression &e1, const matrix_expression &e2, - M &m, const F &f, + M &m, F, dense_proxy_tag, row_major_tag) { typedef M matrix_type; typedef const E1 expression1_type; @@ -650,7 +654,7 @@ namespace boost { namespace numeric { namespace ublas { M & opb_prod (const matrix_expression &e1, const matrix_expression &e2, - M &m, const F &f, + M &m, F, dense_proxy_tag, column_major_tag) { typedef M matrix_type; typedef const E1 expression1_type; @@ -680,27 +684,29 @@ namespace boost { namespace numeric { namespace ublas { M & opb_prod (const matrix_expression &e1, const matrix_expression &e2, - M &m, const F &f, bool init = true) { + M &m, F, bool init = true) { typedef typename M::value_type value_type; typedef typename M::storage_category storage_category; typedef typename M::orientation_category orientation_category; + typedef F functor_type; if (init) m.assign (zero_matrix (e1 ().size1 (), e2 ().size2 ())); - return opb_prod (e1, e2, m, f, storage_category (), orientation_category ()); + return opb_prod (e1, e2, m, functor_type (), storage_category (), orientation_category ()); } template BOOST_UBLAS_INLINE M opb_prod (const matrix_expression &e1, const matrix_expression &e2, - const F &f) { + F) { typedef M matrix_type; + typedef F functor_type; matrix_type m (e1 ().size1 (), e2 ().size2 ()); // FIXME: needed for c_matrix?! - // return opb_prod (e1, e2, m, f, false); - return opb_prod (e1, e2, m, f, true); + // return opb_prod (e1, e2, m, functor_type (), false); + return opb_prod (e1, e2, m, functor_type (), true); } template BOOST_UBLAS_INLINE diff --git a/include/boost/numeric/ublas/storage.hpp b/include/boost/numeric/ublas/storage.hpp index 6673bdd1..f8ab8995 100644 --- a/include/boost/numeric/ublas/storage.hpp +++ b/include/boost/numeric/ublas/storage.hpp @@ -1072,7 +1072,7 @@ namespace boost { namespace numeric { namespace ublas { template BOOST_UBLAS_INLINE - void resize (std::vector &a, typename std::vector::size_type size, bool preserve) { + void resize (std::vector &a, typename std::vector::size_type size, bool /* preserve */) { a.resize (size); } @@ -1741,11 +1741,11 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_INLINE index_pair(V& v, size_type i) : - container_reference(v), i_(i), + boost::noncopyable (), container_reference(v), i_(i), v1_(v.data1_[i]), v2_(v.data2_[i]), dirty_(false) {} BOOST_UBLAS_INLINE index_pair(const self_type& rhs) : - container_reference(rhs()), i_(rhs.i_), + boost::noncopyable (), container_reference(rhs()), i_(rhs.i_), v1_(rhs.v1_), v2_(rhs.v2_), dirty_(false) {} BOOST_UBLAS_INLINE ~index_pair() { @@ -1898,11 +1898,11 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_INLINE index_triple(M& m, size_type i) : - container_reference(m), i_(i), + boost::noncopyable (), container_reference(m), i_(i), v1_(m.data1_[i]), v2_(m.data2_[i]), v3_(m.data3_[i]), dirty_(false) {} BOOST_UBLAS_INLINE index_triple(const self_type& rhs) : - container_reference(rhs()), i_(rhs.i_), + boost::noncopyable (), container_reference(rhs()), i_(rhs.i_), v1_(rhs.v1_), v2_(rhs.v2_), v3_(rhs.v3_), dirty_(false) {} BOOST_UBLAS_INLINE ~index_triple() { diff --git a/include/boost/numeric/ublas/storage_sparse.hpp b/include/boost/numeric/ublas/storage_sparse.hpp index 8141ab36..d125c384 100644 --- a/include/boost/numeric/ublas/storage_sparse.hpp +++ b/include/boost/numeric/ublas/storage_sparse.hpp @@ -667,12 +667,12 @@ namespace boost { namespace numeric { namespace ublas { template BOOST_UBLAS_INLINE - void reserve (std::map &a, typename std::map::size_type capacity) {} + void reserve (std::map &/* a */, typename std::map::size_type /* capacity */) {} #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template BOOST_UBLAS_INLINE - typename std::map::mapped_type &make_reference (std::map &a, typename std::map::iterator it) { + typename std::map::mapped_type &make_reference (std::map &/* a */, typename std::map::iterator it) { return (*it).second; } #endif diff --git a/include/boost/numeric/ublas/symmetric.hpp b/include/boost/numeric/ublas/symmetric.hpp index 015f2ce1..7855c766 100644 --- a/include/boost/numeric/ublas/symmetric.hpp +++ b/include/boost/numeric/ublas/symmetric.hpp @@ -77,26 +77,32 @@ namespace boost { namespace numeric { namespace ublas { // Construction and destruction BOOST_UBLAS_INLINE symmetric_matrix (): + matrix_expression (), size_ (0), data_ (0) {} BOOST_UBLAS_INLINE symmetric_matrix (size_type size): + matrix_expression (), size_ (BOOST_UBLAS_SAME (size, size)), data_ (0) { resize (size); } BOOST_UBLAS_INLINE symmetric_matrix (size_type size1, size_type size2): + matrix_expression (), size_ (BOOST_UBLAS_SAME (size1, size2)), data_ (0) { resize (size1, size2); } BOOST_UBLAS_INLINE symmetric_matrix (size_type size, const array_type &data): + matrix_expression (), size_ (size), data_ (data) {} BOOST_UBLAS_INLINE symmetric_matrix (const symmetric_matrix &m): + matrix_expression (), size_ (m.size_), data_ (m.data_) {} template BOOST_UBLAS_INLINE symmetric_matrix (const matrix_expression &ae): + matrix_expression (), size_ (BOOST_UBLAS_SAME (ae ().size1 (), ae ().size2 ())), data_ (0) { #ifndef BOOST_UBLAS_TYPE_CHECK resize (ae ().size1 (), ae ().size2 (), false); @@ -331,7 +337,7 @@ namespace boost { namespace numeric { namespace ublas { // Element lookup BOOST_UBLAS_INLINE - const_iterator1 find1 (int rank, size_type i, size_type j) const { + const_iterator1 find1 (int /* rank */, size_type i, size_type j) const { return const_iterator1 (*this, i, j); } BOOST_UBLAS_INLINE @@ -341,7 +347,7 @@ namespace boost { namespace numeric { namespace ublas { return iterator1 (*this, i, j); } BOOST_UBLAS_INLINE - const_iterator2 find2 (int rank, size_type i, size_type j) const { + const_iterator2 find2 (int /* rank */, size_type i, size_type j) const { return const_iterator2 (*this, i, j); } BOOST_UBLAS_INLINE @@ -1021,16 +1027,19 @@ namespace boost { namespace numeric { namespace ublas { // Construction and destruction BOOST_UBLAS_INLINE symmetric_adaptor (): + matrix_expression (), data_ (nil_) { BOOST_UBLAS_CHECK (data_.size1 () == data_.size2 (), bad_size ()); } BOOST_UBLAS_INLINE symmetric_adaptor (matrix_type &data): + matrix_expression (), data_ (data) { BOOST_UBLAS_CHECK (data_.size1 () == data_.size2 (), bad_size ()); } BOOST_UBLAS_INLINE symmetric_adaptor (const symmetric_adaptor &m): + matrix_expression (), data_ (m.data_) { BOOST_UBLAS_CHECK (data_.size1 () == data_.size2 (), bad_size ()); } diff --git a/include/boost/numeric/ublas/traits.hpp b/include/boost/numeric/ublas/traits.hpp index f7373542..e4510efe 100644 --- a/include/boost/numeric/ublas/traits.hpp +++ b/include/boost/numeric/ublas/traits.hpp @@ -41,32 +41,32 @@ namespace boost { namespace numeric { namespace ublas { static BOOST_UBLAS_INLINE - real_type real (const_reference t) { + real_type real (const_reference) { external_logic ().raise (); return 0; } static BOOST_UBLAS_INLINE - real_type imag (const_reference t) { + real_type imag (const_reference) { external_logic ().raise (); return 0; } static BOOST_UBLAS_INLINE - value_type conj (const_reference t) { + value_type conj (const_reference) { external_logic ().raise (); return 0; } static BOOST_UBLAS_INLINE - real_type abs (const_reference t) { + real_type abs (const_reference) { external_logic ().raise (); return 0; } static BOOST_UBLAS_INLINE - value_type sqrt (const_reference t) { + value_type sqrt (const_reference) { external_logic ().raise (); return 0; } diff --git a/include/boost/numeric/ublas/triangular.hpp b/include/boost/numeric/ublas/triangular.hpp index c75b4b92..d1a9be2a 100644 --- a/include/boost/numeric/ublas/triangular.hpp +++ b/include/boost/numeric/ublas/triangular.hpp @@ -60,21 +60,26 @@ namespace boost { namespace numeric { namespace ublas { // Construction and destruction BOOST_UBLAS_INLINE triangular_matrix (): + matrix_expression (), size1_ (0), size2_ (0), data_ (0) {} BOOST_UBLAS_INLINE triangular_matrix (size_type size1, size_type size2): + matrix_expression (), size1_ (size1), size2_ (size2), data_ (0) { resize (size1, size2); } BOOST_UBLAS_INLINE triangular_matrix (size_type size1, size_type size2, const array_type &data): + matrix_expression (), size1_ (size1), size2_ (size2), data_ (data) {} BOOST_UBLAS_INLINE triangular_matrix (const triangular_matrix &m): + matrix_expression (), size1_ (m.size1_), size2_ (m.size2_), data_ (m.data_) {} template BOOST_UBLAS_INLINE triangular_matrix (const matrix_expression &ae): + matrix_expression (), size1_ (ae ().size1 ()), size2_ (ae ().size2 ()), data_ (0) { #ifndef BOOST_UBLAS_TYPE_CHECK resize (ae ().size1 (), ae ().size2 (), false); @@ -1021,12 +1026,15 @@ namespace boost { namespace numeric { namespace ublas { // Construction and destruction BOOST_UBLAS_INLINE triangular_adaptor (): + matrix_expression (), data_ (nil_) {} BOOST_UBLAS_INLINE triangular_adaptor (matrix_type &data): + matrix_expression (), data_ (data) {} BOOST_UBLAS_INLINE triangular_adaptor (const triangular_adaptor &m): + matrix_expression (), data_ (m.data_) {} // Accessors diff --git a/include/boost/numeric/ublas/vector.hpp b/include/boost/numeric/ublas/vector.hpp index 3111a951..9c49cf21 100644 --- a/include/boost/numeric/ublas/vector.hpp +++ b/include/boost/numeric/ublas/vector.hpp @@ -61,21 +61,26 @@ namespace boost { namespace numeric { namespace ublas { // Construction and destruction BOOST_UBLAS_INLINE vector (): + vector_expression (), size_ (0), data_ (0) {} BOOST_UBLAS_EXPLICIT BOOST_UBLAS_INLINE vector (size_type size): + vector_expression (), size_ (size), data_ (0) { resize (size); } BOOST_UBLAS_INLINE vector (size_type size, const array_type &data): + vector_expression (), size_ (size), data_ (data) {} BOOST_UBLAS_INLINE vector (const vector &v): + vector_expression (), size_ (v.size_), data_ (v.data_) {} template BOOST_UBLAS_INLINE vector (const vector_expression &ae): + vector_expression (), size_ (ae ().size ()), data_ (0) { #ifndef BOOST_UBLAS_TYPE_CHECK resize (ae ().size (), false); @@ -583,12 +588,15 @@ namespace boost { namespace numeric { namespace ublas { // Construction and destruction BOOST_UBLAS_INLINE unit_vector (): + vector_expression (), size_ (0), index_ (0) {} BOOST_UBLAS_INLINE unit_vector (size_type size, size_type index): + vector_expression (), size_ (size), index_ (index) {} BOOST_UBLAS_INLINE unit_vector (const unit_vector &v): + vector_expression (), size_ (v.size_), index_ (v.index_) {} // Accessors @@ -830,12 +838,15 @@ namespace boost { namespace numeric { namespace ublas { // Construction and destruction BOOST_UBLAS_INLINE zero_vector (): + vector_expression (), size_ (0) {} BOOST_UBLAS_EXPLICIT BOOST_UBLAS_INLINE zero_vector (size_type size): + vector_expression (), size_ (size) {} BOOST_UBLAS_INLINE zero_vector (const zero_vector &v): + vector_expression (), size_ (v.size_) {} // Accessors @@ -852,7 +863,7 @@ namespace boost { namespace numeric { namespace ublas { // Element access BOOST_UBLAS_INLINE - const_reference operator () (size_type i) const { + const_reference operator () (size_type /* i */) const { return zero_; } @@ -898,7 +909,7 @@ namespace boost { namespace numeric { namespace ublas { // Element lookup BOOST_UBLAS_INLINE const_iterator find (size_type i) const { - return const_iterator (*this, 0); + return const_iterator (*this, i); } // Iterators simply are pointers. @@ -1036,12 +1047,15 @@ namespace boost { namespace numeric { namespace ublas { // Construction and destruction BOOST_UBLAS_INLINE scalar_vector (): + vector_expression (), size_ (0), value_ () {} BOOST_UBLAS_INLINE scalar_vector (size_type size, const value_type &value): + vector_expression (), size_ (size), value_ (value) {} BOOST_UBLAS_INLINE scalar_vector (const scalar_vector &v): + vector_expression (), size_ (v.size_), value_ (v.value_) {} // Accessors diff --git a/include/boost/numeric/ublas/vector_assign.hpp b/include/boost/numeric/ublas/vector_assign.hpp index 70db95a3..b8821011 100644 --- a/include/boost/numeric/ublas/vector_assign.hpp +++ b/include/boost/numeric/ublas/vector_assign.hpp @@ -66,7 +66,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void iterating_vector_assign_scalar (const F &f, V &v, const T &t) { + void iterating_vector_assign_scalar (F, V &v, const T &t) { typedef F functor_type; typedef typename V::difference_type difference_type; difference_type size (v.size ()); @@ -83,7 +83,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void indexing_vector_assign_scalar (const F &f, V &v, const T &t) { + void indexing_vector_assign_scalar (F, V &v, const T &t) { typedef F functor_type; typedef typename V::difference_type difference_type; difference_type size (v.size ()); @@ -100,7 +100,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void vector_assign_scalar (const F &f, V &v, const T &t, dense_proxy_tag) { + void vector_assign_scalar (F, V &v, const T &t, dense_proxy_tag) { typedef F functor_type; #ifdef BOOST_UBLAS_USE_INDEXING indexing_vector_assign_scalar (functor_type (), v, t); @@ -119,7 +119,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void vector_assign_scalar (const F &f, V &v, const T &t, packed_proxy_tag) { + void vector_assign_scalar (F, V &v, const T &t, packed_proxy_tag) { typedef F functor_type; typedef typename V::difference_type difference_type; typename V::iterator it (v.begin ()); @@ -131,7 +131,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void vector_assign_scalar (const F &f, V &v, const T &t, sparse_proxy_tag) { + void vector_assign_scalar (F, V &v, const T &t, sparse_proxy_tag) { typedef F functor_type; typename V::iterator it (v.begin ()); typename V::iterator it_end (v.end ()); @@ -142,7 +142,7 @@ namespace boost { namespace numeric { namespace ublas { // Dispatcher template BOOST_UBLAS_INLINE - void vector_assign_scalar (const F &f, V &v, const T &t) { + void vector_assign_scalar (F, V &v, const T &t) { typedef F functor_type; typedef typename V::storage_category storage_category; vector_assign_scalar (functor_type (), v, t, storage_category ()); @@ -222,7 +222,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void iterating_vector_assign (const F &f, V &v, const vector_expression &e) { + void iterating_vector_assign (F, V &v, const vector_expression &e) { typedef F functor_type; typedef typename V::difference_type difference_type; difference_type size (BOOST_UBLAS_SAME (v.size (), e ().size ())); @@ -241,7 +241,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void indexing_vector_assign (const F &f, V &v, const vector_expression &e) { + void indexing_vector_assign (F, V &v, const vector_expression &e) { typedef F functor_type; typedef typename V::difference_type difference_type; difference_type size (BOOST_UBLAS_SAME (v.size (), e ().size ())); @@ -258,7 +258,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void vector_assign (const F &f, V &v, const vector_expression &e, dense_proxy_tag) { + void vector_assign (F, V &v, const vector_expression &e, dense_proxy_tag) { typedef F functor_type; #ifdef BOOST_UBLAS_USE_INDEXING indexing_vector_assign (functor_type (), v, e); @@ -277,7 +277,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void vector_assign (const F &f, V &v, const vector_expression &e, packed_proxy_tag) { + void vector_assign (F, V &v, const vector_expression &e, packed_proxy_tag) { BOOST_UBLAS_CHECK (v.size () == e ().size (), bad_size ()); typedef F functor_type; typedef typename V::difference_type difference_type; @@ -338,7 +338,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void vector_assign (const F &f, V &v, const vector_expression &e, sparse_tag) { + void vector_assign (F, V &v, const vector_expression &e, sparse_tag) { BOOST_UBLAS_CHECK (v.size () == e ().size (), bad_size ()); typedef F functor_type; typedef typename V::value_type value_type; @@ -370,7 +370,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void vector_assign (const F &f, V &v, const vector_expression &e, sparse_proxy_tag) { + void vector_assign (F, V &v, const vector_expression &e, sparse_proxy_tag) { BOOST_UBLAS_CHECK (v.size () == e ().size (), bad_size ()); typedef F functor_type; typedef typename V::size_type size_type; @@ -454,7 +454,7 @@ namespace boost { namespace numeric { namespace ublas { // Dispatcher template BOOST_UBLAS_INLINE - void vector_assign (const F &f, V &v, const vector_expression &e) { + void vector_assign (F, V &v, const vector_expression &e) { typedef F functor_type; typedef typename vector_assign_traits // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void vector_swap (const F &f, V &v, vector_expression &e, dense_proxy_tag) { + void vector_swap (F, V &v, vector_expression &e, dense_proxy_tag) { typedef F functor_type; typedef typename V::difference_type difference_type; difference_type size (BOOST_UBLAS_SAME (v.size (), e ().size ())); @@ -494,7 +494,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void vector_swap (const F &f, V &v, vector_expression &e, packed_proxy_tag) { + void vector_swap (F, V &v, vector_expression &e, packed_proxy_tag) { typedef F functor_type; typedef typename V::difference_type difference_type; typename V::iterator it (v.begin ()); @@ -525,7 +525,7 @@ namespace boost { namespace numeric { namespace ublas { template // This function seems to be big. So we do not let the compiler inline it. // BOOST_UBLAS_INLINE - void vector_swap (const F &f, V &v, vector_expression &e, sparse_proxy_tag) { + void vector_swap (F, V &v, vector_expression &e, sparse_proxy_tag) { BOOST_UBLAS_CHECK (v.size () == e ().size (), bad_size ()); typedef F functor_type; typedef typename V::size_type size_type; @@ -618,7 +618,7 @@ namespace boost { namespace numeric { namespace ublas { // Dispatcher template BOOST_UBLAS_INLINE - void vector_swap (const F &f, V &v, vector_expression &e) { + void vector_swap (F, V &v, vector_expression &e) { typedef F functor_type; typedef typename vector_swap_traits::storage_category storage_category; diff --git a/include/boost/numeric/ublas/vector_sparse.hpp b/include/boost/numeric/ublas/vector_sparse.hpp index c4424260..b754209a 100644 --- a/include/boost/numeric/ublas/vector_sparse.hpp +++ b/include/boost/numeric/ublas/vector_sparse.hpp @@ -328,18 +328,22 @@ namespace boost { namespace numeric { namespace ublas { // Construction and destruction BOOST_UBLAS_INLINE sparse_vector (): + vector_expression (), size_ (0), non_zeros_ (0), data_ () {} BOOST_UBLAS_INLINE sparse_vector (size_type size, size_type non_zeros = 0): + vector_expression (), size_ (size), non_zeros_ (non_zeros), data_ () { reserve (non_zeros_); } BOOST_UBLAS_INLINE sparse_vector (const sparse_vector &v): + vector_expression (), size_ (v.size_), non_zeros_ (v.non_zeros_), data_ (v.data_) {} template BOOST_UBLAS_INLINE sparse_vector (const vector_expression &ae, size_type non_zeros = 0): + vector_expression (), size_ (ae ().size ()), non_zeros_ (non_zeros), data_ () { reserve (non_zeros_); vector_assign (scalar_assign (), *this, ae); @@ -815,21 +819,25 @@ namespace boost { namespace numeric { namespace ublas { // Construction and destruction BOOST_UBLAS_INLINE compressed_vector (): + vector_expression (), size_ (0), non_zeros_ (0), filled_ (0), index_data_ (), value_data_ () {} BOOST_UBLAS_INLINE compressed_vector (size_type size, size_type non_zeros = 0): + vector_expression (), size_ (size), non_zeros_ (non_zeros), filled_ (0), index_data_ (non_zeros), value_data_ (non_zeros) { reserve (non_zeros_); } BOOST_UBLAS_INLINE compressed_vector (const compressed_vector &v): + vector_expression (), size_ (v.size_), non_zeros_ (v.non_zeros_), filled_ (v.filled_), index_data_ (v.index_data_), value_data_ (v.value_data_) {} template BOOST_UBLAS_INLINE compressed_vector (const vector_expression &ae, size_type non_zeros = 0): + vector_expression (), size_ (ae ().size ()), non_zeros_ (non_zeros), filled_ (0), index_data_ (non_zeros), value_data_ (non_zeros) { reserve (non_zeros_, false); @@ -1380,21 +1388,25 @@ namespace boost { namespace numeric { namespace ublas { // Construction and destruction BOOST_UBLAS_INLINE coordinate_vector (): + vector_expression (), size_ (0), non_zeros_ (0), filled_ (0), sorted_ (true), index_data_ (), value_data_ () {} BOOST_UBLAS_INLINE coordinate_vector (size_type size, size_type non_zeros = 0): + vector_expression (), size_ (size), non_zeros_ (non_zeros), filled_ (0), sorted_ (true), index_data_ (non_zeros), value_data_ (non_zeros) { reserve (non_zeros_); } BOOST_UBLAS_INLINE coordinate_vector (const coordinate_vector &v): + vector_expression (), size_ (v.size_), non_zeros_ (v.non_zeros_), filled_ (v.filled_), sorted_ (v.sorted_), index_data_ (v.index_data_), value_data_ (v.value_data_) {} template BOOST_UBLAS_INLINE coordinate_vector (const vector_expression &ae, size_type non_zeros = 0): + vector_expression (), size_ (ae ().size ()), non_zeros_ (non_zeros), filled_ (0), sorted_ (true), index_data_ (non_zeros), value_data_ (non_zeros) { reserve (non_zeros_, false);