[mlpack] 33/44: Backport row_col_iterator.
Barak A. Pearlmutter
barak+git at pearlmutter.net
Mon Feb 15 19:35:54 UTC 2016
This is an automated email from the git hooks/post-receive script.
bap pushed a commit to tag mlpack-1.0.11
in repository mlpack.
commit 72e90adb7a5c187dd7725e8cdc462f040f956a7d
Author: Ryan Curtin <ryan at ratml.org>
Date: Mon Dec 8 05:00:29 2014 +0000
Backport row_col_iterator.
---
src/mlpack/core/arma_extend/CMakeLists.txt | 2 +
src/mlpack/core/arma_extend/Mat_extra_bones.hpp | 141 +++++++
src/mlpack/core/arma_extend/Mat_extra_meat.hpp | 477 ++++++++++++++++++++++
src/mlpack/core/arma_extend/SpMat_extra_bones.hpp | 34 +-
src/mlpack/core/arma_extend/SpMat_extra_meat.hpp | 97 +++++
5 files changed, 749 insertions(+), 2 deletions(-)
diff --git a/src/mlpack/core/arma_extend/CMakeLists.txt b/src/mlpack/core/arma_extend/CMakeLists.txt
index 9098cd0..50b3cad 100644
--- a/src/mlpack/core/arma_extend/CMakeLists.txt
+++ b/src/mlpack/core/arma_extend/CMakeLists.txt
@@ -14,6 +14,8 @@ set(SOURCES
typedef.hpp
SpMat_extra_bones.hpp
SpMat_extra_meat.hpp
+ Mat_extra_bones.hpp
+ Mat_extra_meat.hpp
)
# add directory name to sources
diff --git a/src/mlpack/core/arma_extend/Mat_extra_bones.hpp b/src/mlpack/core/arma_extend/Mat_extra_bones.hpp
new file mode 100644
index 0000000..45b25d5
--- /dev/null
+++ b/src/mlpack/core/arma_extend/Mat_extra_bones.hpp
@@ -0,0 +1,141 @@
+/*
+ * Add row_col_iterator and row_col_const_iterator to arma::Mat.
+ */
+
+/*
+ * row_col_iterator for Mat<eT>. This iterator can return row and column index
+ * of the entry its pointing too. The functionality of this iterator is similar
+ * to sparse matrix iterators.
+ */
+
+#if ARMA_VERSION_MAJOR < 4 || \
+ (ARMA_VERSION_MAJOR == 4 && ARMA_VERSION_MINOR < 349)
+class row_col_iterator;
+
+class const_row_col_iterator
+ {
+ public:
+
+ // empty constructor
+ inline const_row_col_iterator();
+ // constructs const iterator from other iterators
+ inline const_row_col_iterator(const row_col_iterator& it);
+ inline const_row_col_iterator(const const_row_iterator& it);
+ inline const_row_col_iterator(const row_iterator& it);
+ // constructs iterator with given row and col index
+ inline const_row_col_iterator(const Mat<eT>& in_M, const uword row = 0, const uword col = 0);
+
+ /*
+ * Returns the value of the current position.
+ */
+ inline arma_hot const eT& operator*() const { return *current_pos; }
+
+ /*
+ * Increment and decrement operators for this iterator.
+ */
+ inline arma_hot const_row_col_iterator& operator++();
+ inline arma_hot const_row_col_iterator operator++(int);
+ inline arma_hot const_row_col_iterator& operator--();
+ inline arma_hot const_row_col_iterator operator--(int);
+
+ /*
+ * Comparison operator with itself and other relevant iterators.
+ */
+ inline arma_hot bool operator==(const const_row_col_iterator& rhs) const;
+ inline arma_hot bool operator!=(const const_row_col_iterator& rhs) const;
+ inline arma_hot bool operator==(const row_col_iterator& rhs) const;
+ inline arma_hot bool operator!=(const row_col_iterator& rhs) const;
+ inline arma_hot bool operator==(const const_iterator& rhs) const;
+ inline arma_hot bool operator!=(const const_iterator& rhs) const;
+ inline arma_hot bool operator==(const iterator& rhs) const;
+ inline arma_hot bool operator!=(const iterator& rhs) const;
+ inline arma_hot bool operator==(const const_row_iterator& rhs) const;
+ inline arma_hot bool operator!=(const const_row_iterator& rhs) const;
+ inline arma_hot bool operator==(const row_iterator& rhs) const;
+ inline arma_hot bool operator!=(const row_iterator& rhs) const;
+
+ arma_inline uword row() const { return internal_row; }
+ arma_inline uword col() const { return internal_col; }
+
+ // So that we satisfy the STL iterator types.
+ typedef std::bidirectional_iterator_tag iterator_category;
+ typedef eT value_type;
+ typedef uword difference_type; // not certain on this one
+ typedef const eT* pointer;
+ typedef const eT& reference;
+
+ arma_aligned const Mat<eT>* M;
+
+ arma_aligned const eT* current_pos;
+ arma_aligned uword internal_col;
+ arma_aligned uword internal_row;
+ };
+
+class row_col_iterator
+ {
+ public:
+
+ // empty constructor
+ inline row_col_iterator();
+ // constructs const iterator from other iterators
+ inline row_col_iterator(const row_iterator& it);
+ // constructs iterator with given row and col index
+ inline row_col_iterator(Mat<eT>& in_M, const uword row = 0, const uword col = 0);
+
+ /*
+ * Returns the value of the current position.
+ */
+ inline arma_hot eT& operator*() const { return *current_pos; }
+
+ /*
+ * Increment and decrement operators for this iterator.
+ */
+ inline arma_hot row_col_iterator& operator++();
+ inline arma_hot row_col_iterator operator++(int);
+ inline arma_hot row_col_iterator& operator--();
+ inline arma_hot row_col_iterator operator--(int);
+
+ /*
+ * Comparison operator with itself and other relevant iterators.
+ */
+ inline arma_hot bool operator==(const const_row_col_iterator& rhs) const;
+ inline arma_hot bool operator!=(const const_row_col_iterator& rhs) const;
+ inline arma_hot bool operator==(const row_col_iterator& rhs) const;
+ inline arma_hot bool operator!=(const row_col_iterator& rhs) const;
+ inline arma_hot bool operator==(const const_iterator& rhs) const;
+ inline arma_hot bool operator!=(const const_iterator& rhs) const;
+ inline arma_hot bool operator==(const iterator& rhs) const;
+ inline arma_hot bool operator!=(const iterator& rhs) const;
+ inline arma_hot bool operator==(const const_row_iterator& rhs) const;
+ inline arma_hot bool operator!=(const const_row_iterator& rhs) const;
+ inline arma_hot bool operator==(const row_iterator& rhs) const;
+ inline arma_hot bool operator!=(const row_iterator& rhs) const;
+
+ arma_inline uword row() const { return internal_row; }
+ arma_inline uword col() const { return internal_col; }
+
+ // So that we satisfy the STL iterator types.
+ typedef std::bidirectional_iterator_tag iterator_category;
+ typedef eT value_type;
+ typedef uword difference_type; // not certain on this one
+ typedef const eT* pointer;
+ typedef const eT& reference;
+
+ arma_aligned const Mat<eT>* M;
+
+ arma_aligned eT* current_pos;
+ arma_aligned uword internal_col;
+ arma_aligned uword internal_row;
+ };
+
+/*
+ * Extra functions for Mat<eT>
+ */
+// begin for iterator row_col_iterator
+inline const_row_col_iterator begin_row_col() const;
+inline row_col_iterator begin_row_col();
+
+// end for iterator row_col_iterator
+inline const_row_col_iterator end_row_col() const;
+inline row_col_iterator end_row_col();
+#endif
diff --git a/src/mlpack/core/arma_extend/Mat_extra_meat.hpp b/src/mlpack/core/arma_extend/Mat_extra_meat.hpp
new file mode 100644
index 0000000..fe7ba1b
--- /dev/null
+++ b/src/mlpack/core/arma_extend/Mat_extra_meat.hpp
@@ -0,0 +1,477 @@
+#if ARMA_VERSION_MAJOR < 4 || \
+ (ARMA_VERSION_MAJOR == 4 && ARMA_VERSION_MINOR < 349)
+///////////////////////////////////////////////////////////////////////////////
+// Mat::const_row_col_iterator implementation //
+///////////////////////////////////////////////////////////////////////////////
+
+template<typename eT>
+inline
+Mat<eT>::const_row_col_iterator::const_row_col_iterator()
+ : M(NULL), current_pos(NULL), internal_col(0), internal_row(0)
+ {
+ // Technically this iterator is invalid (it may not point to a real element)
+ }
+
+
+
+template<typename eT>
+inline
+Mat<eT>::const_row_col_iterator::const_row_col_iterator(const row_col_iterator& it)
+ : M(it.M), current_pos(it.current_pos), internal_col(it.col()), internal_row(it.row())
+ {
+ // Nothing to do.
+ }
+
+
+
+template<typename eT>
+inline
+Mat<eT>::const_row_col_iterator::const_row_col_iterator(const const_row_iterator& it)
+ : M(&it.M), current_pos(&it.M(it.row, it.col)), internal_col(it.col), internal_row(it.row)
+ {
+ // Nothing to do.
+ }
+
+
+
+template<typename eT>
+inline
+Mat<eT>::const_row_col_iterator::const_row_col_iterator(const row_iterator& it)
+ : M(&it.M), current_pos(&it.M(it.row, it.col)), internal_col(it.col), internal_row(it.row)
+ {
+ // Nothing to do.
+ }
+
+
+
+template<typename eT>
+inline
+Mat<eT>::const_row_col_iterator::const_row_col_iterator(const Mat<eT>& in_M, const uword row, const uword col)
+ : M(&in_M), current_pos(&in_M(row,col)), internal_col(col), internal_row(row)
+ {
+ // Nothing to do.
+ }
+
+
+
+template<typename eT>
+inline typename Mat<eT>::const_row_col_iterator&
+Mat<eT>::const_row_col_iterator::operator++()
+ {
+ current_pos++;
+ internal_row++;
+
+ // Check to see if we moved a column.
+ if(internal_row == M->n_rows)
+ {
+ internal_col++;
+ internal_row = 0;
+ }
+
+ return *this;
+ }
+
+
+
+template<typename eT>
+inline typename Mat<eT>::const_row_col_iterator
+Mat<eT>::const_row_col_iterator::operator++(int)
+ {
+ typename Mat<eT>::const_row_col_iterator temp(*this);
+
+ ++(*this);
+
+ return temp;
+ }
+
+
+
+template<typename eT>
+inline typename Mat<eT>::const_row_col_iterator&
+Mat<eT>::const_row_col_iterator::operator--()
+ {
+ if(internal_row > 0)
+ {
+ current_pos--;
+ internal_row--;
+ }
+ else if(internal_col > 0)
+ {
+ current_pos--;
+ internal_col--;
+ internal_row = M->n_rows - 1;
+ }
+
+ return *this;
+ }
+
+
+
+template<typename eT>
+inline typename Mat<eT>::const_row_col_iterator
+Mat<eT>::const_row_col_iterator::operator--(int)
+ {
+ typename Mat<eT>::const_row_col_iterator temp(*this);
+
+ --(*this);
+
+ return temp;
+ }
+
+
+
+template<typename eT>
+inline bool
+Mat<eT>::const_row_col_iterator::operator==(const const_row_col_iterator& rhs) const
+ {
+ return (rhs.current_pos == current_pos);
+ }
+
+
+
+template<typename eT>
+inline bool
+Mat<eT>::const_row_col_iterator::operator!=(const const_row_col_iterator& rhs) const
+ {
+ return (rhs.current_pos != current_pos);
+ }
+
+
+
+template<typename eT>
+inline bool
+Mat<eT>::const_row_col_iterator::operator==(const row_col_iterator& rhs) const
+ {
+ return (rhs.current_pos == current_pos);
+ }
+
+
+
+template<typename eT>
+inline bool
+Mat<eT>::const_row_col_iterator::operator!=(const row_col_iterator& rhs) const
+ {
+ return (rhs.current_pos != current_pos);
+ }
+
+
+
+template<typename eT>
+inline bool
+Mat<eT>::const_row_col_iterator::operator==(const const_iterator& rhs) const
+ {
+ return (rhs == current_pos);
+ }
+
+
+
+template<typename eT>
+inline bool
+Mat<eT>::const_row_col_iterator::operator!=(const const_iterator& rhs) const
+ {
+ return (rhs != current_pos);
+ }
+
+
+
+template<typename eT>
+inline bool
+Mat<eT>::const_row_col_iterator::operator==(const iterator& rhs) const
+ {
+ return (rhs == current_pos);
+ }
+
+
+
+template<typename eT>
+inline bool
+Mat<eT>::const_row_col_iterator::operator!=(const iterator& rhs) const
+ {
+ return (rhs != current_pos);
+ }
+
+
+
+template<typename eT>
+inline bool
+Mat<eT>::const_row_col_iterator::operator==(const const_row_iterator& rhs) const
+ {
+ return (&rhs.M(rhs.row, rhs.col) == current_pos);
+ }
+
+
+
+template<typename eT>
+inline bool
+Mat<eT>::const_row_col_iterator::operator!=(const const_row_iterator& rhs) const
+ {
+ return (&rhs.M(rhs.row, rhs.col) != current_pos);
+ }
+
+
+
+template<typename eT>
+inline bool
+Mat<eT>::const_row_col_iterator::operator==(const row_iterator& rhs) const
+ {
+ return (&rhs.M(rhs.row, rhs.col) == current_pos);
+ }
+
+
+
+template<typename eT>
+inline bool
+Mat<eT>::const_row_col_iterator::operator!=(const row_iterator& rhs) const
+ {
+ return (&rhs.M(rhs.row, rhs.col) != current_pos);
+ }
+
+
+
+///////////////////////////////////////////////////////////////////////////////
+// Mat::row_col_iterator implementation //
+///////////////////////////////////////////////////////////////////////////////
+
+template<typename eT>
+inline
+Mat<eT>::row_col_iterator::row_col_iterator()
+ : M(NULL), current_pos(NULL), internal_col(0), internal_row(0)
+ {
+ // Technically this iterator is invalid (it may not point to a real element)
+ }
+
+
+
+template<typename eT>
+inline
+Mat<eT>::row_col_iterator::row_col_iterator(const row_iterator& it)
+ : M(&it.M), current_pos(&it.M(it.row, it.col)), internal_col(it.col), internal_row(it.row)
+ {
+ // Nothing to do.
+ }
+
+
+
+template<typename eT>
+inline
+Mat<eT>::row_col_iterator::row_col_iterator(Mat<eT>& in_M, const uword row, const uword col)
+ : M(&in_M), current_pos(&in_M(row,col)), internal_col(col), internal_row(row)
+ {
+ // Nothing to do.
+ }
+
+
+
+template<typename eT>
+inline typename Mat<eT>::row_col_iterator&
+Mat<eT>::row_col_iterator::operator++()
+ {
+ current_pos++;
+ internal_row++;
+
+ // Check to see if we moved a column.
+ if(internal_row == M->n_rows)
+ {
+ internal_col++;
+ internal_row = 0;
+ }
+
+ return *this;
+ }
+
+
+
+template<typename eT>
+inline typename Mat<eT>::row_col_iterator
+Mat<eT>::row_col_iterator::operator++(int)
+ {
+ typename Mat<eT>::row_col_iterator temp(*this);
+
+ ++(*this);
+
+ return temp;
+ }
+
+
+
+template<typename eT>
+inline typename Mat<eT>::row_col_iterator&
+Mat<eT>::row_col_iterator::operator--()
+ {
+ if(internal_row != 0)
+ {
+ current_pos--;
+ internal_row--;
+ }
+ else if(internal_col != 0)
+ {
+ current_pos--;
+ internal_col--;
+ internal_row = M->n_rows - 1;
+ }
+
+ return *this;
+ }
+
+
+
+template<typename eT>
+inline typename Mat<eT>::row_col_iterator
+Mat<eT>::row_col_iterator::operator--(int)
+ {
+ typename Mat<eT>::row_col_iterator temp(*this);
+
+ --(*this);
+
+ return temp;
+ }
+
+
+
+template<typename eT>
+inline bool
+Mat<eT>::row_col_iterator::operator==(const const_row_col_iterator& rhs) const
+ {
+ return (rhs.current_pos == current_pos);
+ }
+
+
+
+template<typename eT>
+inline bool
+Mat<eT>::row_col_iterator::operator!=(const const_row_col_iterator& rhs) const
+ {
+ return (rhs.current_pos != current_pos);
+ }
+
+
+
+template<typename eT>
+inline bool
+Mat<eT>::row_col_iterator::operator==(const row_col_iterator& rhs) const
+ {
+ return (rhs.current_pos == current_pos);
+ }
+
+
+
+template<typename eT>
+inline bool
+Mat<eT>::row_col_iterator::operator!=(const row_col_iterator& rhs) const
+ {
+ return (rhs.current_pos != current_pos);
+ }
+
+
+
+template<typename eT>
+inline bool
+Mat<eT>::row_col_iterator::operator==(const const_iterator& rhs) const
+ {
+ return (rhs == current_pos);
+ }
+
+
+
+template<typename eT>
+inline bool
+Mat<eT>::row_col_iterator::operator!=(const const_iterator& rhs) const
+ {
+ return (rhs != current_pos);
+ }
+
+
+
+template<typename eT>
+inline bool
+Mat<eT>::row_col_iterator::operator==(const iterator& rhs) const
+ {
+ return (rhs == current_pos);
+ }
+
+
+
+template<typename eT>
+inline bool
+Mat<eT>::row_col_iterator::operator!=(const iterator& rhs) const
+ {
+ return (rhs != current_pos);
+ }
+
+
+
+template<typename eT>
+inline bool
+Mat<eT>::row_col_iterator::operator==(const const_row_iterator& rhs) const
+ {
+ return (&rhs.M(rhs.row, rhs.col) == current_pos);
+ }
+
+
+
+template<typename eT>
+inline bool
+Mat<eT>::row_col_iterator::operator!=(const const_row_iterator& rhs) const
+ {
+ return (&rhs.M(rhs.row, rhs.col) != current_pos);
+ }
+
+
+
+template<typename eT>
+inline bool
+Mat<eT>::row_col_iterator::operator==(const row_iterator& rhs) const
+ {
+ return (&rhs.M(rhs.row, rhs.col) == current_pos);
+ }
+
+
+
+template<typename eT>
+inline bool
+Mat<eT>::row_col_iterator::operator!=(const row_iterator& rhs) const
+ {
+ return (&rhs.M(rhs.row, rhs.col) != current_pos);
+ }
+
+
+
+///////////////////////////////////////////////////////////////////////////////
+// extended Mat functionality implementation //
+///////////////////////////////////////////////////////////////////////////////
+
+template<typename eT>
+inline typename Mat<eT>::const_row_col_iterator
+Mat<eT>::begin_row_col() const
+ {
+ return const_row_col_iterator(*this);
+ }
+
+
+
+template<typename eT>
+inline typename Mat<eT>::row_col_iterator
+Mat<eT>::begin_row_col()
+ {
+ return row_col_iterator(*this);
+ }
+
+
+
+template<typename eT>
+inline typename Mat<eT>::const_row_col_iterator
+Mat<eT>::end_row_col() const
+ {
+ return ++const_row_col_iterator(*this, n_rows - 1, n_cols - 1);
+ }
+
+
+
+template<typename eT>
+inline typename Mat<eT>::row_col_iterator
+Mat<eT>::end_row_col()
+ {
+ return ++row_col_iterator(*this, n_rows - 1, n_cols - 1);
+ }
+
+#endif
diff --git a/src/mlpack/core/arma_extend/SpMat_extra_bones.hpp b/src/mlpack/core/arma_extend/SpMat_extra_bones.hpp
index 3214aa1..51b724c 100644
--- a/src/mlpack/core/arma_extend/SpMat_extra_bones.hpp
+++ b/src/mlpack/core/arma_extend/SpMat_extra_bones.hpp
@@ -5,15 +5,45 @@
* Add a batch constructor for SpMat, if the version is older than 3.810.0.
*/
#if ARMA_VERSION_MAJOR == 3 && ARMA_VERSION_MINOR < 810
-template<typename T1, typename T2> inline SpMat(
+template<typename T1, typename T2>
+inline SpMat(
const Base<uword, T1>& locations,
const Base<eT, T2>& values,
const bool sort_locations = true);
-template<typename T1, typename T2> inline SpMat(
+template<typename T1, typename T2>
+inline SpMat(
const Base<uword, T1>& locations,
const Base<eT, T2>& values,
const uword n_rows,
const uword n_cols,
const bool sort_locations = true);
#endif
+
+#if ARMA_VERSION_MAJOR == 3 && ARMA_VERSION_MINOR < 920
+template<typename T1, typename T2, typename T3>
+inline SpMat(
+ const Base<uword, T1>& rowind,
+ const Base<uword, T2>& colptr,
+ const Base<eT, T3>& values,
+ const uword n_rows,
+ const uword n_cols);
+#endif
+
+/*
+ * Extra functions for SpMat<eT>
+ * Adding definition of row_col_iterator to generalize with Mat<eT>::row_col_iterator
+ */
+#if ARMA_VERSION_MAJOR < 4 || \
+ (ARMA_VERSION_MAJOR == 4 && ARMA_VERSION_MINOR < 349)
+typedef iterator row_col_iterator;
+typedef const_iterator const_row_col_iterator;
+
+// begin for iterator row_col_iterator
+inline const_row_col_iterator begin_row_col() const;
+inline row_col_iterator begin_row_col();
+
+// end for iterator row_col_iterator
+inline const_row_col_iterator end_row_col() const;
+inline row_col_iterator end_row_col();
+#endif
diff --git a/src/mlpack/core/arma_extend/SpMat_extra_meat.hpp b/src/mlpack/core/arma_extend/SpMat_extra_meat.hpp
index 58134e8..d2ad10e 100644
--- a/src/mlpack/core/arma_extend/SpMat_extra_meat.hpp
+++ b/src/mlpack/core/arma_extend/SpMat_extra_meat.hpp
@@ -249,3 +249,100 @@ SpMat<eT>::SpMat(const Base<uword,T1>& locations_expr, const Base<eT,T2>& vals_e
}
#endif
+
+#if ARMA_VERSION_MAJOR == 3 && ARMA_VERSION_MINOR < 920
+//! Insert a large number of values at once.
+//! Per CSC format, rowind_expr should be row indices,~
+//! colptr_expr should column ptr indices locations,
+//! and values should be the corresponding values.
+//! In this constructor the size is explicitly given.
+//! Values are assumed to be sorted, and the size~
+//! information is trusted
+template<typename eT>
+template<typename T1, typename T2, typename T3>
+inline
+SpMat<eT>::SpMat
+ (
+ const Base<uword,T1>& rowind_expr,
+ const Base<uword,T2>& colptr_expr,
+ const Base<eT, T3>& values_expr,
+ const uword in_n_rows,
+ const uword in_n_cols
+ )
+ : n_rows(0)
+ , n_cols(0)
+ , n_elem(0)
+ , n_nonzero(0)
+ , vec_state(0)
+ , values(NULL)
+ , row_indices(NULL)
+ , col_ptrs(NULL)
+ {
+ arma_extra_debug_sigprint_this(this);
+
+ init(in_n_rows, in_n_cols);
+
+ const unwrap<T1> rowind_tmp( rowind_expr.get_ref() );
+ const unwrap<T2> colptr_tmp( colptr_expr.get_ref() );
+ const unwrap<T3> vals_tmp( values_expr.get_ref() );
+
+ const Mat<uword>& rowind = rowind_tmp.M;
+ const Mat<uword>& colptr = colptr_tmp.M;
+ const Mat<eT>& vals = vals_tmp.M;
+
+ arma_debug_check( (rowind.is_vec() == false), "SpMat::SpMat(): given 'rowind' object is not a vector" );
+ arma_debug_check( (colptr.is_vec() == false), "SpMat::SpMat(): given 'colptr' object is not a vector" );
+ arma_debug_check( (vals.is_vec() == false), "SpMat::SpMat(): given 'values' object is not a vector" );
+
+ arma_debug_check( (rowind.n_elem != vals.n_elem), "SpMat::SpMat(): number of row indices is not equal to number of values" );
+ arma_debug_check( (colptr.n_elem != (n_cols+1) ), "SpMat::SpMat(): number of column pointers is not equal to n_cols+1" );
+
+ // Resize to correct number of elements (this also sets n_nonzero)
+ mem_resize(vals.n_elem);
+
+ // copy supplied values into sparse matrix -- not checked for consistency
+ arrayops::copy(access::rwp(row_indices), rowind.memptr(), rowind.n_elem );
+ arrayops::copy(access::rwp(col_ptrs), colptr.memptr(), colptr.n_elem );
+ arrayops::copy(access::rwp(values), vals.memptr(), vals.n_elem );
+
+ // important: set the sentinel as well
+ access::rw(col_ptrs[n_cols + 1]) = std::numeric_limits<uword>::max();
+ }
+#endif
+
+#if ARMA_VERSION_MAJOR < 4 || \
+ (ARMA_VERSION_MAJOR == 4 && ARMA_VERSION_MINOR < 349)
+template<typename eT>
+inline typename SpMat<eT>::const_row_col_iterator
+SpMat<eT>::begin_row_col() const
+ {
+ return begin();
+ }
+
+
+
+template<typename eT>
+inline typename SpMat<eT>::row_col_iterator
+SpMat<eT>::begin_row_col()
+ {
+ return begin();
+ }
+
+
+
+template<typename eT>
+inline typename SpMat<eT>::const_row_col_iterator
+SpMat<eT>::end_row_col() const
+ {
+ return end();
+ }
+
+
+
+template<typename eT>
+inline typename SpMat<eT>::row_col_iterator
+SpMat<eT>::end_row_col()
+ {
+ return end();
+ }
+#endif
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mlpack.git
More information about the debian-science-commits
mailing list