[shark] 73/79: made scalar_expressions a vector expression which prevents dangling reference problems...
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Thu Nov 26 15:41:39 UTC 2015
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch master
in repository shark.
commit 063ec6d27cacf3b79c9c7112e27d676c3ff3014d
Author: Oswin <oswin.krause at di.ku.dk>
Date: Thu Oct 29 17:50:19 2015 +0100
made scalar_expressions a vector expression which prevents dangling reference problems...
---
include/shark/LinAlg/BLAS/matrix_expression.hpp | 6 +++---
include/shark/LinAlg/BLAS/vector_expression.hpp | 16 ++++++----------
2 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/include/shark/LinAlg/BLAS/matrix_expression.hpp b/include/shark/LinAlg/BLAS/matrix_expression.hpp
index 77b23ac..3a10580 100644
--- a/include/shark/LinAlg/BLAS/matrix_expression.hpp
+++ b/include/shark/LinAlg/BLAS/matrix_expression.hpp
@@ -260,7 +260,7 @@ public:
typedef std::ptrdiff_t difference_type;
typedef T value_type;
typedef const T& const_reference;
- typedef T& reference;
+ typedef const_reference reference;
typedef value_type const* const_pointer;
typedef value_type scalar_type;
typedef const_pointer pointer;
@@ -269,8 +269,8 @@ public:
typedef index_type const* const_index_pointer;
typedef index_type index_pointer;
- typedef const matrix_reference<const self_type> const_closure_type;
- typedef matrix_reference<self_type> closure_type;
+ typedef self_type const_closure_type;
+ typedef self_type closure_type;
typedef dense_tag storage_category;
typedef unknown_orientation orientation;
typedef elementwise_tag evaluation_category;
diff --git a/include/shark/LinAlg/BLAS/vector_expression.hpp b/include/shark/LinAlg/BLAS/vector_expression.hpp
index ff80088..7bd9c34 100644
--- a/include/shark/LinAlg/BLAS/vector_expression.hpp
+++ b/include/shark/LinAlg/BLAS/vector_expression.hpp
@@ -128,16 +128,17 @@ public:
typedef T value_type;
typedef T scalar_type;
typedef const T& const_reference;
- typedef T& reference;
- typedef T* pointer;
- typedef const T *const_pointer;
+ typedef const_reference reference;
+ typedef T const* const_pointer;
+ typedef const_pointer pointer;
+
typedef std::size_t index_type;
typedef index_type const* const_index_pointer;
typedef index_type index_pointer;
- typedef const vector_reference<const self_type> const_closure_type;
- typedef vector_reference<self_type> closure_type;
+ typedef self_type const_closure_type;
+ typedef self_type closure_type;
typedef unknown_storage_tag storage_category;
typedef elementwise_tag evaluation_category;
@@ -154,11 +155,6 @@ public:
return m_size;
}
- // Resizing
- void resize(size_type size, bool /*preserve*/ = true) {
- m_size = size;
- }
-
// Element access
const_reference operator()(index_type /*i*/) const {
return m_value;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/shark.git
More information about the debian-science-commits
mailing list