diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2007-06-01 07:56:24 +0000 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2007-06-01 07:56:24 +0000 |
commit | 6d749c172a2f8f4dd5ec342356553f0b70018f74 (patch) | |
tree | 381948895c40256b7283b98eda55913a3352cfe2 /tvmet-1.7.1/include/tvmet/xpr/MVProduct.h | |
parent | 887ff84376ffb5aae81bdf56cb27fca6ffd606eb (diff) |
replace size_t with int everywhere.
The size_t type means a number of _bytes_, and it was misused as
counting e.g. the number of rows/columns in a matrix. Moreover, it is unsigned,
which can give strange bugs if a signed/unsigned mismatch occurs.
Diffstat (limited to 'tvmet-1.7.1/include/tvmet/xpr/MVProduct.h')
-rw-r--r-- | tvmet-1.7.1/include/tvmet/xpr/MVProduct.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tvmet-1.7.1/include/tvmet/xpr/MVProduct.h b/tvmet-1.7.1/include/tvmet/xpr/MVProduct.h index 15d13adae..878e65a89 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/MVProduct.h +++ b/tvmet-1.7.1/include/tvmet/xpr/MVProduct.h @@ -38,7 +38,7 @@ namespace tvmet { * M\,v * \f] */ -template<class E1, std::size_t Rows, std::size_t Cols, +template<class E1, int Rows, int Cols, class E2> class XprMVProduct : public TvmetBase< XprMVProduct<E1, Rows, Cols, E2> > @@ -81,27 +81,27 @@ public: private: /** Wrapper for meta gemm. */ static inline - value_type do_gemv(dispatch<true>, const E1& lhs, const E2& rhs, std::size_t j) { + value_type do_gemv(dispatch<true>, const E1& lhs, const E2& rhs, int j) { return meta::gemv<Rows, Cols, 0>::prod(lhs, rhs, j); } /** Wrapper for loop gemm. */ static inline - value_type do_gemv(dispatch<false>, const E1& lhs, const E2& rhs, std::size_t j) { + value_type do_gemv(dispatch<false>, const E1& lhs, const E2& rhs, int j) { return loop::gemv<Rows, Cols>::prod(lhs, rhs, j); } public: /** index operator, returns the expression by index. This is the vector style since a matrix*vector gives a vector. */ - value_type operator()(std::size_t j) const { + value_type operator()(int j) const { TVMET_RT_CONDITION(j < Rows , "XprMVProduct Bounce Violation") return do_gemv(dispatch<use_meta>(), m_lhs, m_rhs, j); } public: // debugging Xpr parse tree - void print_xpr(std::ostream& os, std::size_t l=0) const { + void print_xpr(std::ostream& os, int l=0) const { os << IndentLevel(l++) << "XprMVProduct[" << (use_meta ? "M" : "L") << ", O=" << ops |