From 6d749c172a2f8f4dd5ec342356553f0b70018f74 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Fri, 1 Jun 2007 07:56:24 +0000 Subject: [PATCH] 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. --- tvmet-1.7.1/ChangeLog | 2 +- tvmet-1.7.1/ChangeLog.1 | 6 +- tvmet-1.7.1/config/config.h.in | 2 +- tvmet-1.7.1/config/ltmain.sh | 8 +- tvmet-1.7.1/configure | 22 +- tvmet-1.7.1/doc/usage.dox | 2 +- tvmet-1.7.1/examples/frob_matrix_norm.cc | 4 +- tvmet-1.7.1/include/tvmet/BinaryFunctionals.h | 16 +- tvmet-1.7.1/include/tvmet/CommaInitializer.h | 6 +- tvmet-1.7.1/include/tvmet/Matrix.h | 48 ++-- .../include/tvmet/MatrixBinaryFunctions.h | 36 +-- tvmet-1.7.1/include/tvmet/MatrixEval.h | 24 +- tvmet-1.7.1/include/tvmet/MatrixFunctions.h | 208 +++++++++--------- tvmet-1.7.1/include/tvmet/MatrixImpl.h | 24 +- tvmet-1.7.1/include/tvmet/MatrixOperators.h | 108 ++++----- .../include/tvmet/MatrixUnaryFunctions.h | 8 +- tvmet-1.7.1/include/tvmet/TvmetBase.h | 6 +- tvmet-1.7.1/include/tvmet/UnaryFunctionals.h | 20 +- tvmet-1.7.1/include/tvmet/Vector.h | 42 ++-- .../include/tvmet/VectorBinaryFunctions.h | 36 +-- tvmet-1.7.1/include/tvmet/VectorEval.h | 24 +- tvmet-1.7.1/include/tvmet/VectorFunctions.h | 120 +++++----- tvmet-1.7.1/include/tvmet/VectorImpl.h | 22 +- tvmet-1.7.1/include/tvmet/VectorOperators.h | 72 +++--- .../include/tvmet/VectorUnaryFunctions.h | 8 +- .../include/tvmet/config/config-vc71.h | 2 +- .../include/tvmet/config/config-vc71.h.in | 2 +- tvmet-1.7.1/include/tvmet/loop/Gemm.h | 16 +- tvmet-1.7.1/include/tvmet/loop/Gemmt.h | 16 +- tvmet-1.7.1/include/tvmet/loop/Gemtm.h | 16 +- tvmet-1.7.1/include/tvmet/loop/Gemtv.h | 12 +- tvmet-1.7.1/include/tvmet/loop/Gemv.h | 12 +- tvmet-1.7.1/include/tvmet/loop/Matrix.h | 6 +- tvmet-1.7.1/include/tvmet/loop/Vector.h | 4 +- tvmet-1.7.1/include/tvmet/meta/Gemm.h | 10 +- tvmet-1.7.1/include/tvmet/meta/Gemmt.h | 10 +- tvmet-1.7.1/include/tvmet/meta/Gemtm.h | 10 +- tvmet-1.7.1/include/tvmet/meta/Gemtv.h | 8 +- tvmet-1.7.1/include/tvmet/meta/Gemv.h | 8 +- tvmet-1.7.1/include/tvmet/meta/Matrix.h | 4 +- tvmet-1.7.1/include/tvmet/meta/Vector.h | 4 +- tvmet-1.7.1/include/tvmet/util/General.h | 26 +-- tvmet-1.7.1/include/tvmet/xpr/BinOperator.h | 6 +- tvmet-1.7.1/include/tvmet/xpr/Eval.h | 6 +- tvmet-1.7.1/include/tvmet/xpr/Identity.h | 6 +- tvmet-1.7.1/include/tvmet/xpr/Literal.h | 6 +- tvmet-1.7.1/include/tvmet/xpr/MMProduct.h | 12 +- .../include/tvmet/xpr/MMProductTransposed.h | 12 +- tvmet-1.7.1/include/tvmet/xpr/MMtProduct.h | 12 +- tvmet-1.7.1/include/tvmet/xpr/MVProduct.h | 10 +- tvmet-1.7.1/include/tvmet/xpr/Matrix.h | 8 +- .../include/tvmet/xpr/MatrixBinaryFunctions.h | 12 +- tvmet-1.7.1/include/tvmet/xpr/MatrixCol.h | 10 +- tvmet-1.7.1/include/tvmet/xpr/MatrixDiag.h | 6 +- .../include/tvmet/xpr/MatrixFunctions.h | 100 ++++----- .../include/tvmet/xpr/MatrixOperators.h | 56 ++--- tvmet-1.7.1/include/tvmet/xpr/MatrixRow.h | 10 +- .../include/tvmet/xpr/MatrixTranspose.h | 4 +- .../include/tvmet/xpr/MatrixUnaryFunctions.h | 4 +- tvmet-1.7.1/include/tvmet/xpr/MtMProduct.h | 12 +- tvmet-1.7.1/include/tvmet/xpr/MtVProduct.h | 10 +- tvmet-1.7.1/include/tvmet/xpr/Null.h | 2 +- tvmet-1.7.1/include/tvmet/xpr/UnOperator.h | 6 +- tvmet-1.7.1/include/tvmet/xpr/Vector.h | 10 +- .../include/tvmet/xpr/VectorBinaryFunctions.h | 12 +- .../include/tvmet/xpr/VectorFunctions.h | 54 ++--- .../include/tvmet/xpr/VectorOperators.h | 44 ++-- .../include/tvmet/xpr/VectorUnaryFunctions.h | 4 +- tvmet-1.7.1/tests/swap.cc | 18 +- tvmet-1.7.1/tests/t.cc | 2 +- tvmet-1.7.1/testsuite/TestConstruction.h | 12 +- tvmet-1.7.1/testsuite/TestUnloops.h | 22 +- 72 files changed, 764 insertions(+), 764 deletions(-) diff --git a/tvmet-1.7.1/ChangeLog b/tvmet-1.7.1/ChangeLog index 2841ec7ce..5b2b679fe 100644 --- a/tvmet-1.7.1/ChangeLog +++ b/tvmet-1.7.1/ChangeLog @@ -3160,7 +3160,7 @@ 2003-05-18 19:37 opetzold - * include/tvmet/: Matrix.h, Vector.h: cast to std::size_t for + * include/tvmet/: Matrix.h, Vector.h: cast to int for iterator concept constructors runtime check. 2003-05-18 18:04 opetzold diff --git a/tvmet-1.7.1/ChangeLog.1 b/tvmet-1.7.1/ChangeLog.1 index 5f17f4b06..391a35ba0 100644 --- a/tvmet-1.7.1/ChangeLog.1 +++ b/tvmet-1.7.1/ChangeLog.1 @@ -157,11 +157,11 @@ Matrix<> and XprMatrix<> moved here from Matrix.h. * include/tvmet/MatrixImpl.h: Forgotten macro prefix TVMET_ added. - operator %=,^=,&=,|= have as argument std::size_t since these + operator %=,^=,&=,|= have as argument int since these are bitops, only int's are allowed/usefull. * include/tvmet/Matrix.h (class Matrix): operator %=,^=,&=,|= have - as argumeent std::size_t since these are bitops, only int's + as argumeent int since these are bitops, only int's are allowed/usefull. * include/tvmet/VectorOperators.h: operators for /=, %= ... <<= for @@ -676,7 +676,7 @@ PromoteTraits::value_type' is implicitly a typename, changed, (class MetaMV ): same here. - * include/tvmet/: brute-force query-replace size_t with std::size_t + * include/tvmet/: brute-force query-replace int with int * doc/intro.doxy: slightly changed and anhanced docs due to positive test with stlport and gcc-3.1. diff --git a/tvmet-1.7.1/config/config.h.in b/tvmet-1.7.1/config/config.h.in index aff6d0eb5..1f1b28c4c 100644 --- a/tvmet-1.7.1/config/config.h.in +++ b/tvmet-1.7.1/config/config.h.in @@ -123,4 +123,4 @@ #undef restrict /* Define to `unsigned' if does not define. */ -#undef size_t +#undef int diff --git a/tvmet-1.7.1/config/ltmain.sh b/tvmet-1.7.1/config/ltmain.sh index 70f0b2d03..02f401d76 100644 --- a/tvmet-1.7.1/config/ltmain.sh +++ b/tvmet-1.7.1/config/ltmain.sh @@ -4641,7 +4641,7 @@ EOF const char *program_name = NULL; -void * xmalloc (size_t num); +void * xmalloc (int num); char * xstrdup (const char *string); char * basename (const char *name); char * fnqualify(const char *path); @@ -4680,7 +4680,7 @@ EOF } void * -xmalloc (size_t num) +xmalloc (int num) { void * p = (void *) malloc (num); if (!p) @@ -4716,7 +4716,7 @@ basename (const char *name) char * fnqualify(const char *path) { - size_t size; + int size; char *p; char tmp[LT_PATHMAX + 1]; @@ -4743,7 +4743,7 @@ fnqualify(const char *path) char * strendzap(char *str, const char *pat) { - size_t len, patlen; + int len, patlen; assert(str != NULL); assert(pat != NULL); diff --git a/tvmet-1.7.1/configure b/tvmet-1.7.1/configure index 1c1532d71..5621468ab 100755 --- a/tvmet-1.7.1/configure +++ b/tvmet-1.7.1/configure @@ -20545,9 +20545,9 @@ _ACEOF ;; esac -echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6 -if test "${ac_cv_type_size_t+set}" = set; then +echo "$as_me:$LINENO: checking for int" >&5 +echo $ECHO_N "checking for int... $ECHO_C" >&6 +if test "${ac_cv_type_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -20560,9 +20560,9 @@ $ac_includes_default int main () { -if ((size_t *) 0) +if ((int *) 0) return 0; -if (sizeof (size_t)) +if (sizeof (int)) return 0; ; return 0; @@ -20590,23 +20590,23 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_type_size_t=yes + ac_cv_type_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_size_t=no +ac_cv_type_int=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6 -if test $ac_cv_type_size_t = yes; then +echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 +echo "${ECHO_T}$ac_cv_type_int" >&6 +if test $ac_cv_type_int = yes; then : else cat >>confdefs.h <<_ACEOF -#define size_t unsigned +#define int unsigned _ACEOF fi diff --git a/tvmet-1.7.1/doc/usage.dox b/tvmet-1.7.1/doc/usage.dox index 3b2bd7bce..4bbc446ff 100644 --- a/tvmet-1.7.1/doc/usage.dox +++ b/tvmet-1.7.1/doc/usage.dox @@ -152,7 +152,7 @@ 2,5,8, 3,6,9 }; - std::size_t sz = sizeof(data)/sizeof(T); + int sz = sizeof(data)/sizeof(T); T* first = data; T* last = data + sz; diff --git a/tvmet-1.7.1/examples/frob_matrix_norm.cc b/tvmet-1.7.1/examples/frob_matrix_norm.cc index 8267aa99d..446a440cb 100644 --- a/tvmet-1.7.1/examples/frob_matrix_norm.cc +++ b/tvmet-1.7.1/examples/frob_matrix_norm.cc @@ -27,7 +27,7 @@ using namespace std; -template +template double frob_norm(const tvmet::Matrix& M) { return std::sqrt(M(0,0)*M(0,0) + M(1,0)*M(1,0) + M(2,0)*M(2,0) @@ -36,7 +36,7 @@ frob_norm(const tvmet::Matrix& M) { } namespace tvmet { - template + template typename NumericTraits::float_type norm(const Matrix& M) { return std::sqrt( sum( diag( MtM_prod(M,M) ) ) ); diff --git a/tvmet-1.7.1/include/tvmet/BinaryFunctionals.h b/tvmet-1.7.1/include/tvmet/BinaryFunctionals.h index eaf1ca5b4..89fdbdf41 100644 --- a/tvmet-1.7.1/include/tvmet/BinaryFunctionals.h +++ b/tvmet-1.7.1/include/tvmet/BinaryFunctionals.h @@ -42,7 +42,7 @@ struct Fcnl_assign : public BinaryFunctional { } static - void print_xpr(std::ostream& os, std::size_t l=0) { + void print_xpr(std::ostream& os, int l=0) { os << IndentLevel(l) << "fcnl_assign," << std::endl; @@ -71,7 +71,7 @@ struct Fcnl_##NAME : public BinaryFunctional { \ } \ \ static \ - void print_xpr(std::ostream& os, std::size_t l=0) { \ + void print_xpr(std::ostream& os, int l=0) { \ os << IndentLevel(l) \ << "Fcnl_" << #NAME << "," \ @@ -114,7 +114,7 @@ struct Fcnl_##NAME : public BinaryFunctional { \ } \ \ static \ - void print_xpr(std::ostream& os, std::size_t l=0) { \ + void print_xpr(std::ostream& os, int l=0) { \ os << IndentLevel(l) \ << "Fcnl_" << #NAME << "," \ @@ -155,7 +155,7 @@ struct Fcnl_##NAME : public BinaryFunctional { \ } \ \ static \ - void print_xpr(std::ostream& os, std::size_t l=0) { \ + void print_xpr(std::ostream& os, int l=0) { \ os << IndentLevel(l) \ << "Fcnl_" << #NAME << "," \ @@ -189,7 +189,7 @@ struct Fcnl_##NAME : public BinaryFunctional { \ } \ \ static \ - void print_xpr(std::ostream& os, std::size_t l=0) { \ + void print_xpr(std::ostream& os, int l=0) { \ os << IndentLevel(l) \ << "Fcnl_" << #NAME << "," \ @@ -219,7 +219,7 @@ struct Fcnl_##NAME : public BinaryFunctional { \ } \ \ static \ - void print_xpr(std::ostream& os, std::size_t l=0) { \ + void print_xpr(std::ostream& os, int l=0) { \ os << IndentLevel(l) \ << "Fcnl_" << #NAME << "," \ @@ -260,7 +260,7 @@ struct Fcnl_polar : public BinaryFunctional { } static - void print_xpr(std::ostream& os, std::size_t l=0) { + void print_xpr(std::ostream& os, int l=0) { os << IndentLevel(l) << "Fcnl_polar," << std::endl; @@ -286,7 +286,7 @@ struct Fcnl_swap : public BinaryFunctional { } static - void print_xpr(std::ostream& os, std::size_t l=0) { + void print_xpr(std::ostream& os, int l=0) { os << IndentLevel(l) << "Fcnl_swap," << std::endl; diff --git a/tvmet-1.7.1/include/tvmet/CommaInitializer.h b/tvmet-1.7.1/include/tvmet/CommaInitializer.h index bb3c640ca..c78653d56 100644 --- a/tvmet-1.7.1/include/tvmet/CommaInitializer.h +++ b/tvmet-1.7.1/include/tvmet/CommaInitializer.h @@ -60,7 +60,7 @@ namespace tvmet { * will be written random into the memory. * */ -template +template class CommaInitializer { CommaInitializer(); @@ -71,7 +71,7 @@ private: * \class Initializer * \brief Helper fo recursive overloaded comma operator. */ - template class Initializer + template class Initializer { Initializer(); Initializer& operator=(const Initializer&); @@ -139,7 +139,7 @@ private: /* * Implementation */ -template +template typename CommaInitializer::template Initializer CommaInitializer::operator,(typename Obj::value_type rhs) { diff --git a/tvmet-1.7.1/include/tvmet/Matrix.h b/tvmet-1.7.1/include/tvmet/Matrix.h index f10ed1755..dfc18d623 100644 --- a/tvmet-1.7.1/include/tvmet/Matrix.h +++ b/tvmet-1.7.1/include/tvmet/Matrix.h @@ -40,11 +40,11 @@ namespace tvmet { /* forwards */ -template class Matrix; +template class Matrix; template + int RowsBgn, int RowsEnd, + int ColsBgn, int ColsEnd, + int RowStride, int ColStride /*=1*/> class MatrixSliceConstReference; // unused here; for me only @@ -52,7 +52,7 @@ class MatrixSliceConstReference; // unused here; for me only * \class MatrixConstReference Matrix.h "tvmet/Matrix.h" * \brief value iterator for ET */ -template +template class MatrixConstReference : public TvmetBase < MatrixConstReference > { @@ -91,13 +91,13 @@ public: public: // access operators /** access by index. */ - value_type operator()(std::size_t i, std::size_t j) const { + value_type operator()(int i, int j) const { assert((i < Rows) && (j < Cols)); return m_data[i * Cols + 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) << "MatrixConstReference[O=" << ops << "]<" << "T=" << typeid(value_type).name() << ">," @@ -119,7 +119,7 @@ private: * two paramters are needed). Therefore the cleanest way to do it is * with operator() rather than with operator[]. \see C++ FAQ Lite 13.8 */ -template +template class Matrix { public: @@ -190,20 +190,20 @@ public: // STL interface } /** The size of the matrix. */ - static std::size_t size() { return Size; } + static int size() { return Size; } /** STL vector max_size() - returns allways rows()*cols(). */ - static std::size_t max_size() { return Size; } + static int max_size() { return Size; } /** STL vector empty() - returns allways false. */ static bool empty() { return false; } public: /** The number of rows of matrix. */ - static std::size_t rows() { return Rows; } + static int rows() { return Rows; } /** The number of columns of matrix. */ - static std::size_t cols() { return Cols; } + static int cols() { return Cols; } public: /** Default Destructor */ @@ -226,7 +226,7 @@ public: template explicit Matrix(InputIterator first, InputIterator last) { - assert(static_cast(std::distance(first, last)) <= Size); + assert(static_cast(std::distance(first, last)) <= Size); std::copy(first, last, m_data); } @@ -235,7 +235,7 @@ public: * self, there isn't any stored reference to the array pointer. */ template - explicit Matrix(InputIterator first, std::size_t sz) + explicit Matrix(InputIterator first, int sz) { assert(sz <= Size); std::copy(first, first + sz, m_data); @@ -266,13 +266,13 @@ public: // access operators const value_type* _tvmet_restrict data() const { return m_data; } public: // index access operators - value_type& _tvmet_restrict operator()(std::size_t i, std::size_t j) { + value_type& _tvmet_restrict operator()(int i, int j) { // Note: g++-2.95.3 does have problems on typedef reference assert((i < Rows) && (j < Cols)); return m_data[i * Cols + j]; } - value_type operator()(std::size_t i, std::size_t j) const { + value_type operator()(int i, int j) const { assert((i < Rows) && (j < Cols)); return m_data[i * Cols + j]; } @@ -341,7 +341,7 @@ public: // assign operations } private: - template friend class CommaInitializer; + template friend class CommaInitializer; /** This is a helper for assigning a comma separated initializer list. It's equal to Matrix& operator=(value_type) which does @@ -359,12 +359,12 @@ public: // math operators with scalars Matrix& operator*=(value_type) TVMET_CXX_ALWAYS_INLINE; Matrix& operator/=(value_type) TVMET_CXX_ALWAYS_INLINE; - Matrix& operator%=(std::size_t) TVMET_CXX_ALWAYS_INLINE; - Matrix& operator^=(std::size_t) TVMET_CXX_ALWAYS_INLINE; - Matrix& operator&=(std::size_t) TVMET_CXX_ALWAYS_INLINE; - Matrix& operator|=(std::size_t) TVMET_CXX_ALWAYS_INLINE; - Matrix& operator<<=(std::size_t) TVMET_CXX_ALWAYS_INLINE; - Matrix& operator>>=(std::size_t) TVMET_CXX_ALWAYS_INLINE; + Matrix& operator%=(int) TVMET_CXX_ALWAYS_INLINE; + Matrix& operator^=(int) TVMET_CXX_ALWAYS_INLINE; + Matrix& operator&=(int) TVMET_CXX_ALWAYS_INLINE; + Matrix& operator|=(int) TVMET_CXX_ALWAYS_INLINE; + Matrix& operator<<=(int) TVMET_CXX_ALWAYS_INLINE; + Matrix& operator>>=(int) TVMET_CXX_ALWAYS_INLINE; public: // math operators with matrizes // NOTE: access using the operators in ns element_wise, since that's what is does @@ -419,7 +419,7 @@ public: // io static Info info() { return Info(); } /** Member function for expression level printing. */ - std::ostream& print_xpr(std::ostream& os, std::size_t l=0) const; + std::ostream& print_xpr(std::ostream& os, int l=0) const; /** Member function for printing internal data. */ std::ostream& print_on(std::ostream& os) const; diff --git a/tvmet-1.7.1/include/tvmet/MatrixBinaryFunctions.h b/tvmet-1.7.1/include/tvmet/MatrixBinaryFunctions.h index 6a85b62eb..907d346da 100644 --- a/tvmet-1.7.1/include/tvmet/MatrixBinaryFunctions.h +++ b/tvmet-1.7.1/include/tvmet/MatrixBinaryFunctions.h @@ -36,7 +36,7 @@ namespace tvmet { * binary_function(XprMatrix, Matrix) */ #define TVMET_DECLARE_MACRO(NAME) \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME, \ @@ -48,7 +48,7 @@ XprMatrix< \ NAME(const Matrix& lhs, \ const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME, \ @@ -60,7 +60,7 @@ XprMatrix< \ NAME(const XprMatrix& lhs, \ const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME, \ @@ -90,7 +90,7 @@ TVMET_DECLARE_MACRO(polar) * binary_function(Matrix, POD) */ #define TVMET_DECLARE_MACRO(NAME, TP) \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME, \ @@ -153,7 +153,7 @@ TVMET_DECLARE_MACRO(pow, long double) */ #if defined(TVMET_HAVE_COMPLEX) && defined(TVMET_HAVE_COMPLEX_MATH1) -template +template XprMatrix< XprBinOp< Fcnl_pow >, @@ -166,7 +166,7 @@ pow(const Matrix& lhs, const std::complex& rhs) TVMET_CXX_ALWAYS_INLINE; -template +template XprMatrix< XprBinOp< Fcnl_pow< std::complex, std::complex >, @@ -183,7 +183,7 @@ pow(const Matrix, Rows, Cols>& lhs, * \fn pow(const Matrix, Rows, Cols>& lhs, const T& rhs) * \ingroup _binary_function */ -template +template XprMatrix< XprBinOp< Fcnl_pow, T>, @@ -200,7 +200,7 @@ pow(const Matrix, Rows, Cols>& lhs, * \fn pow(const Matrix, Rows, Cols>& lhs, int rhs) * \ingroup _binary_function */ -template +template XprMatrix< XprBinOp< Fcnl_pow, int>, @@ -213,7 +213,7 @@ pow(const Matrix, Rows, Cols>& lhs, int rhs) TVMET_CXX_ALWAYS_INLINE; -template +template XprMatrix< XprBinOp< Fcnl_polar, @@ -243,7 +243,7 @@ polar(const Matrix& lhs, * binary_function(XprMatrix, Matrix) */ #define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -263,7 +263,7 @@ NAME(const Matrix& lhs, const Matrix& rhs) { \ expr_type(lhs.const_ref(), rhs.const_ref())); \ } \ \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -283,7 +283,7 @@ NAME(const XprMatrix& lhs, const Matrix& rhs) { \ expr_type(lhs, rhs.const_ref())); \ } \ \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -320,7 +320,7 @@ TVMET_IMPLEMENT_MACRO(polar) * binary_function(Matrix, POD) */ #define TVMET_IMPLEMENT_MACRO(NAME, TP) \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -396,7 +396,7 @@ TVMET_IMPLEMENT_MACRO(pow, long double) * \fn pow(const Matrix& lhs, const std::complex& rhs) * \ingroup _binary_function */ -template +template inline XprMatrix< XprBinOp< @@ -421,7 +421,7 @@ pow(const Matrix& lhs, const std::complex& rhs) { * \fn pow(const Matrix, Rows, Cols>& lhs, const std::complex& rhs) * \ingroup _binary_function */ -template +template inline XprMatrix< XprBinOp< @@ -446,7 +446,7 @@ pow(const Matrix, Rows, Cols>& lhs, const std::complex& rhs) * \fn pow(const Matrix, Rows, Cols>& lhs, const T& rhs) * \ingroup _binary_function */ -template +template inline XprMatrix< XprBinOp< @@ -471,7 +471,7 @@ pow(const Matrix, Rows, Cols>& lhs, const T& rhs) { * \fn pow(const Matrix, Rows, Cols>& lhs, int rhs) * \ingroup _binary_function */ -template +template inline XprMatrix< XprBinOp< @@ -496,7 +496,7 @@ pow(const Matrix, Rows, Cols>& lhs, int rhs) { * \fn polar(const Matrix& lhs, const T& rhs) * \ingroup _binary_function */ -template +template inline XprMatrix< XprBinOp< diff --git a/tvmet-1.7.1/include/tvmet/MatrixEval.h b/tvmet-1.7.1/include/tvmet/MatrixEval.h index c4d13f9f6..d8e71509b 100644 --- a/tvmet-1.7.1/include/tvmet/MatrixEval.h +++ b/tvmet-1.7.1/include/tvmet/MatrixEval.h @@ -42,7 +42,7 @@ namespace tvmet { * \endcode * \sa \ref compare */ -template +template inline bool all_elements(const XprMatrix& e) { return meta::Matrix::all_elements(e); @@ -64,7 +64,7 @@ bool all_elements(const XprMatrix& e) { * \endcode * \sa \ref compare */ -template +template inline bool any_elements(const XprMatrix& e) { return meta::Matrix::any_elements(e); @@ -87,7 +87,7 @@ bool any_elements(const XprMatrix& e) { * This eval is for the a?b:c syntax, since it's not allowed to overload * these operators. */ -template +template inline XprMatrix< XprEval< @@ -117,7 +117,7 @@ eval(const XprMatrix& e1, * This eval is for the a?b:c syntax, since it's not allowed to overload * these operators. */ -template +template inline XprMatrix< XprEval< @@ -147,7 +147,7 @@ eval(const XprMatrix& e1, * This eval is for the a?b:c syntax, since it's not allowed to overload * these operators. */ -template +template inline XprMatrix< XprEval< @@ -177,7 +177,7 @@ eval(const XprMatrix& e1, * This eval is for the a?b:c syntax, since it's not allowed to overload * these operators. */ -template +template inline XprMatrix< XprEval< @@ -207,7 +207,7 @@ eval(const XprMatrix& e1, * XprMatrix ? XprMatrix : POD */ #define TVMET_IMPLEMENT_MACRO(POD) \ -template \ +template \ inline \ XprMatrix< \ XprEval< \ @@ -227,7 +227,7 @@ eval(const XprMatrix& e, POD x2, POD x3) { \ expr_type(e, XprLiteral< POD >(x2), XprLiteral< POD >(x3))); \ } \ \ -template \ +template \ inline \ XprMatrix< \ XprEval< \ @@ -247,7 +247,7 @@ eval(const XprMatrix& e1, POD x2, const XprMatrix(x2), e3)); \ } \ \ -template \ +template \ inline \ XprMatrix< \ XprEval< \ @@ -299,7 +299,7 @@ TVMET_IMPLEMENT_MACRO(long double) * This eval is for the a?b:c syntax, since it's not allowed to overload * these operators. */ -template +template inline XprMatrix< XprEval< @@ -327,7 +327,7 @@ eval(const XprMatrix& e, const std::complex& x2, const std::co * This eval is for the a?b:c syntax, since it's not allowed to overload * these operators. */ -template +template inline XprMatrix< XprEval< @@ -355,7 +355,7 @@ eval(const XprMatrix& e1, const std::complex& x2, const XprMa * This eval is for the a?b:c syntax, since it's not allowed to overload * these operators. */ -template +template inline XprMatrix< XprEval< diff --git a/tvmet-1.7.1/include/tvmet/MatrixFunctions.h b/tvmet-1.7.1/include/tvmet/MatrixFunctions.h index 7f0399453..57a2d637f 100644 --- a/tvmet-1.7.1/include/tvmet/MatrixFunctions.h +++ b/tvmet-1.7.1/include/tvmet/MatrixFunctions.h @@ -29,8 +29,8 @@ namespace tvmet { /* forwards */ -template class Vector; -template class VectorConstReference; +template class Vector; +template class VectorConstReference; /********************************************************* @@ -49,7 +49,7 @@ template class VectorConstReference; * function(Matrix, XprMatrix) */ #define TVMET_DECLARE_MACRO(NAME) \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME, \ @@ -61,7 +61,7 @@ XprMatrix< \ NAME (const Matrix& lhs, \ const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME, \ @@ -73,7 +73,7 @@ XprMatrix< \ NAME (const XprMatrix& lhs, \ const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME, \ @@ -101,7 +101,7 @@ namespace element_wise { * Note: - operations +,-,*,/ are per se element wise */ #define TVMET_DECLARE_MACRO(NAME, POD) \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME, \ @@ -113,7 +113,7 @@ XprMatrix< \ NAME (const Matrix& lhs, \ POD rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME< POD, T>, \ @@ -165,7 +165,7 @@ TVMET_DECLARE_MACRO(div, long double) * \todo type promotion */ #define TVMET_DECLARE_MACRO(NAME) \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME< std::complex, std::complex >, \ @@ -177,7 +177,7 @@ XprMatrix< \ NAME (const Matrix< std::complex, Rows, Cols>& lhs, \ const std::complex& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME< std::complex, std::complex >, \ @@ -204,8 +204,8 @@ TVMET_DECLARE_MACRO(div) *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -template +template XprMatrix< XprMMProduct< MatrixConstReference, Rows1, Cols1, // M1(Rows1, Cols1) @@ -217,8 +217,8 @@ prod(const Matrix& lhs, const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; -template +template XprMatrix< XprMMProduct< XprMatrix, Rows1, Cols1, // M1(Rows1, Cols1) @@ -230,8 +230,8 @@ prod(const XprMatrix& lhs, const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; -template +template XprMatrix< XprMMProduct< MatrixConstReference, Rows1, Cols1, // M1(Rows1, Cols1) @@ -243,8 +243,8 @@ prod(const Matrix& lhs, const XprMatrix& rhs) TVMET_CXX_ALWAYS_INLINE; -template +template XprMatrix< XprMMProductTransposed< MatrixConstReference, Rows1, Cols1, // M1(Rows1, Cols1) @@ -256,8 +256,8 @@ trans_prod(const Matrix& lhs, const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; -template // Rows2 = Rows1 +template // Rows2 = Rows1 XprMatrix< XprMtMProduct< MatrixConstReference, Rows1, Cols1, // M1(Rows1, Cols1) @@ -269,8 +269,8 @@ MtM_prod(const Matrix& lhs, const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; -template +template XprMatrix< XprMMtProduct< MatrixConstReference, Rows1, Cols1, // M1(Rows1, Cols1) @@ -287,7 +287,7 @@ MMt_prod(const Matrix& lhs, *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -template +template XprVector< XprMVProduct< MatrixConstReference, Rows, Cols, // M(Rows, Cols) @@ -299,7 +299,7 @@ prod(const Matrix& lhs, const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; -template +template XprVector< XprMVProduct< MatrixConstReference, Rows, Cols, @@ -311,7 +311,7 @@ prod(const Matrix& lhs, const XprVector& rhs) TVMET_CXX_ALWAYS_INLINE; -template +template XprVector< XprMVProduct< XprMatrix, Rows, Cols, // M(Rows, Cols) @@ -323,7 +323,7 @@ prod(const XprMatrix& lhs, const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; -template +template XprVector< XprMtVProduct< MatrixConstReference, Rows, Cols, // M(Rows, Cols) @@ -340,7 +340,7 @@ Mtx_prod(const Matrix& lhs, *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -template +template XprMatrix< XprMatrixTranspose< MatrixConstReference @@ -350,12 +350,12 @@ XprMatrix< trans(const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; -template +template typename NumericTraits::sum_type trace(const Matrix& m) TVMET_CXX_ALWAYS_INLINE; -template +template XprVector< XprMatrixRow< MatrixConstReference, @@ -364,10 +364,10 @@ XprVector< Cols > row(const Matrix& m, - std::size_t no) TVMET_CXX_ALWAYS_INLINE; + int no) TVMET_CXX_ALWAYS_INLINE; -template +template XprVector< XprMatrixCol< MatrixConstReference, @@ -376,10 +376,10 @@ XprVector< Rows > col(const Matrix& m, - std::size_t no) TVMET_CXX_ALWAYS_INLINE; + int no) TVMET_CXX_ALWAYS_INLINE; -template +template XprVector< XprMatrixDiag< MatrixConstReference, @@ -395,41 +395,41 @@ diag(const Matrix& m) TVMET_CXX_ALWAYS_INLINE; *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -template -Extremum +template +Extremum maximum(const XprMatrix& e); // NOT TVMET_CXX_ALWAYS_INLINE; -template -Extremum +template +Extremum maximum(const Matrix& m) TVMET_CXX_ALWAYS_INLINE; -template -Extremum +template +Extremum minimum(const XprMatrix& e); // NOT TVMET_CXX_ALWAYS_INLINE; -template -Extremum +template +Extremum minimum(const Matrix& m) TVMET_CXX_ALWAYS_INLINE; -template +template typename E::value_type max(const XprMatrix& e); // NOT TVMET_CXX_ALWAYS_INLINE; -template +template T max(const Matrix& m) TVMET_CXX_ALWAYS_INLINE; -template +template typename E::value_type min(const XprMatrix& e); // NOT TVMET_CXX_ALWAYS_INLINE; -template +template T min(const Matrix& m) TVMET_CXX_ALWAYS_INLINE; @@ -438,7 +438,7 @@ T min(const Matrix& m) TVMET_CXX_ALWAYS_INLINE; *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -template +template XprMatrix< XprIdentity, Rows, Cols @@ -456,7 +456,7 @@ XprMatrix< identity() TVMET_CXX_ALWAYS_INLINE; -template +template XprMatrix< MatrixConstReference, Rows, Cols @@ -480,7 +480,7 @@ cmatrix_ref(const T* mem) TVMET_CXX_ALWAYS_INLINE; * function(Matrix, XprMatrix) */ #define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -500,7 +500,7 @@ NAME (const Matrix& lhs, const Matrix& rhs) { \ expr_type(lhs.const_ref(), rhs.const_ref())); \ } \ \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -520,7 +520,7 @@ NAME (const XprMatrix& lhs, const Matrix& rhs) { \ expr_type(lhs, rhs.const_ref())); \ } \ \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -556,7 +556,7 @@ namespace element_wise { * Note: - operations +,-,*,/ are per se element wise */ #define TVMET_IMPLEMENT_MACRO(NAME, POD) \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -576,7 +576,7 @@ NAME (const Matrix& lhs, POD rhs) { \ expr_type(lhs.const_ref(), XprLiteral< POD >(rhs))); \ } \ \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -636,7 +636,7 @@ TVMET_IMPLEMENT_MACRO(div, long double) * \todo type promotion */ #define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -657,7 +657,7 @@ NAME (const Matrix< std::complex, Rows, Cols>& lhs, \ expr_type(lhs.const_ref(), XprLiteral< std::complex >(rhs))); \ } \ \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -699,8 +699,8 @@ TVMET_IMPLEMENT_MACRO(div) * \ingroup _binary_function * \note The rows2 has to be equal to cols1. */ -template +template inline XprMatrix< XprMMProduct< @@ -724,8 +724,8 @@ prod(const Matrix& lhs, const Matrix& rhs) { * \brief Evaluate the product of XprMatrix and Matrix. * \ingroup _binary_function */ -template +template inline XprMatrix< XprMMProduct< @@ -749,8 +749,8 @@ prod(const XprMatrix& lhs, const Matrix& rhs * \brief Evaluate the product of Matrix and XprMatrix. * \ingroup _binary_function */ -template +template inline XprMatrix< XprMMProduct< @@ -778,8 +778,8 @@ prod(const Matrix& lhs, const XprMatrix& rhs * (M_1\,M_2)^T * \f] */ -template +template inline XprMatrix< XprMMProductTransposed< @@ -810,8 +810,8 @@ trans_prod(const Matrix& lhs, const Matrix& * matrix 1, since matrix 1 is trans - the result is a (Cols1 x Cols2) * matrix. */ -template // Rows2 = Rows1 +template // Rows2 = Rows1 inline XprMatrix< XprMtMProduct< @@ -836,8 +836,8 @@ MtM_prod(const Matrix& lhs, const Matrix& rh * \ingroup _binary_function * \note The Cols2 has to be equal to Cols1. */ -template +template inline XprMatrix< XprMMtProduct< @@ -866,7 +866,7 @@ MMt_prod(const Matrix& lhs, const Matrix& rh * \brief Function for the matrix-vector-product * \ingroup _binary_function */ -template +template inline XprVector< XprMVProduct< @@ -890,7 +890,7 @@ prod(const Matrix& lhs, const Vector& rhs) { * \brief Function for the matrix-vector-product * \ingroup _binary_function */ -template +template inline XprVector< XprMVProduct< @@ -914,7 +914,7 @@ prod(const Matrix& lhs, const XprVector& rhs) { * \brief Compute the product of an XprMatrix with a Vector. * \ingroup _binary_function */ -template +template inline XprVector< XprMVProduct< @@ -942,7 +942,7 @@ prod(const XprMatrix& lhs, const Vector& rhs) { * M^T\, x * \f] */ -template +template inline XprVector< XprMtVProduct< @@ -971,7 +971,7 @@ Mtx_prod(const Matrix& lhs, const Vector& rhs) { * \brief Transpose the matrix * \ingroup _unary_function */ -template +template inline XprMatrix< XprMatrixTranspose< @@ -998,7 +998,7 @@ trans(const Matrix& rhs) { * \sum_{k = 0}^{Sz-1} m(k, k) * \f] */ -template +template inline typename NumericTraits::sum_type trace(const Matrix& m) { @@ -1007,11 +1007,11 @@ trace(const Matrix& m) { /** - * \fn row(const Matrix& m, std::size_t no) + * \fn row(const Matrix& m, int no) * \brief Returns a row vector of the given matrix. * \ingroup _binary_function */ -template +template inline XprVector< XprMatrixRow< @@ -1020,7 +1020,7 @@ XprVector< >, Cols > -row(const Matrix& m, std::size_t no) { +row(const Matrix& m, int no) { typedef XprMatrixRow< MatrixConstReference, Rows, Cols @@ -1030,11 +1030,11 @@ row(const Matrix& m, std::size_t no) { /** - * \fn col(const Matrix& m, std::size_t no) + * \fn col(const Matrix& m, int no) * \brief Returns a column vector of the given matrix. * \ingroup _binary_function */ -template +template inline XprVector< XprMatrixCol< @@ -1043,7 +1043,7 @@ XprVector< >, Rows > -col(const Matrix& m, std::size_t no) { +col(const Matrix& m, int no) { typedef XprMatrixCol< MatrixConstReference, Rows, Cols @@ -1057,7 +1057,7 @@ col(const Matrix& m, std::size_t no) { * \brief Returns the diagonal vector of the given square matrix. * \ingroup _unary_function */ -template +template inline XprVector< XprMatrixDiag< @@ -1085,17 +1085,17 @@ diag(const Matrix& m) { * \brief Find the maximum of a matrix expression * \ingroup _unary_function */ -template +template inline -Extremum +Extremum maximum(const XprMatrix& e) { typedef typename E::value_type value_type; value_type temp(e(0, 0)); - std::size_t row_no(0), col_no(0); + int row_no(0), col_no(0); - for(std::size_t i = 0; i != Rows; ++i) { - for(std::size_t j = 0; j != Cols; ++j) { + for(int i = 0; i != Rows; ++i) { + for(int j = 0; j != Cols; ++j) { if(e(i, j) > temp) { temp = e(i, j); row_no = i; @@ -1104,7 +1104,7 @@ maximum(const XprMatrix& e) { } } - return Extremum(temp, row_no, col_no); + return Extremum(temp, row_no, col_no); } @@ -1113,9 +1113,9 @@ maximum(const XprMatrix& e) { * \brief Find the maximum of a matrix * \ingroup _unary_function */ -template +template inline -Extremum +Extremum maximum(const Matrix& m) { return maximum(m.as_expr()); } @@ -1124,17 +1124,17 @@ maximum(const Matrix& m) { return maximum(m.as_expr()); } * \brief Find the minimum of a matrix expression * \ingroup _unary_function */ -template +template inline -Extremum +Extremum minimum(const XprMatrix& e) { typedef typename E::value_type value_type; value_type temp(e(0, 0)); - std::size_t row_no(0), col_no(0); + int row_no(0), col_no(0); - for(std::size_t i = 0; i != Rows; ++i) { - for(std::size_t j = 0; j != Cols; ++j) { + for(int i = 0; i != Rows; ++i) { + for(int j = 0; j != Cols; ++j) { if(e(i, j) < temp) { temp = e(i, j); row_no = i; @@ -1143,7 +1143,7 @@ minimum(const XprMatrix& e) { } } - return Extremum(temp, row_no, col_no); + return Extremum(temp, row_no, col_no); } @@ -1152,9 +1152,9 @@ minimum(const XprMatrix& e) { * \brief Find the minimum of a matrix * \ingroup _unary_function */ -template +template inline -Extremum +Extremum minimum(const Matrix& m) { return minimum(m.as_expr()); } @@ -1163,7 +1163,7 @@ minimum(const Matrix& m) { return minimum(m.as_expr()); } * \brief Find the maximum of a matrix expression * \ingroup _unary_function */ -template +template inline typename E::value_type max(const XprMatrix& e) { @@ -1171,8 +1171,8 @@ max(const XprMatrix& e) { value_type temp(e(0, 0)); - for(std::size_t i = 0; i != Rows; ++i) - for(std::size_t j = 0; j != Cols; ++j) + for(int i = 0; i != Rows; ++i) + for(int j = 0; j != Cols; ++j) if(e(i, j) > temp) temp = e(i, j); @@ -1185,7 +1185,7 @@ max(const XprMatrix& e) { * \brief Find the maximum of a matrix * \ingroup _unary_function */ -template +template inline T max(const Matrix& m) { typedef T value_type; @@ -1210,7 +1210,7 @@ T max(const Matrix& m) { * \brief Find the minimum of a matrix expression * \ingroup _unary_function */ -template +template inline typename E::value_type min(const XprMatrix& e) { @@ -1218,8 +1218,8 @@ min(const XprMatrix& e) { value_type temp(e(0, 0)); - for(std::size_t i = 0; i != Rows; ++i) - for(std::size_t j = 0; j != Cols; ++j) + for(int i = 0; i != Rows; ++i) + for(int j = 0; j != Cols; ++j) if(e(i, j) < temp) temp = e(i, j); @@ -1232,7 +1232,7 @@ min(const XprMatrix& e) { * \brief Find the minimum of a matrix * \ingroup _unary_function */ -template +template inline T min(const Matrix& m) { typedef T value_type; @@ -1280,7 +1280,7 @@ T min(const Matrix& m) { * * \since release 1.6.0 */ -template +template inline XprMatrix< XprIdentity, @@ -1354,7 +1354,7 @@ identity() { * * \since release 1.6.0 */ -template +template inline XprMatrix< MatrixConstReference, diff --git a/tvmet-1.7.1/include/tvmet/MatrixImpl.h b/tvmet-1.7.1/include/tvmet/MatrixImpl.h index 1fbc4d0ee..738daaec7 100644 --- a/tvmet-1.7.1/include/tvmet/MatrixImpl.h +++ b/tvmet-1.7.1/include/tvmet/MatrixImpl.h @@ -36,8 +36,8 @@ namespace tvmet { /* * member operators for i/o */ -template -std::ostream& Matrix::print_xpr(std::ostream& os, std::size_t l) const +template +std::ostream& Matrix::print_xpr(std::ostream& os, int l) const { os << IndentLevel(l++) << "Matrix[" << ops << "]<" << typeid(T).name() << ", " << Rows << ", " << Cols << ">," @@ -48,7 +48,7 @@ std::ostream& Matrix::print_xpr(std::ostream& os, std::size_t l } -template +template std::ostream& Matrix::print_on(std::ostream& os) const { enum { @@ -58,9 +58,9 @@ std::ostream& Matrix::print_on(std::ostream& os) const std::streamsize w = IoPrintHelper::width(dispatch(), *this); os << std::setw(0) << "[\n"; - for(std::size_t i = 0; i < Rows; ++i) { + for(int i = 0; i < Rows; ++i) { os << " ["; - for(std::size_t j = 0; j < (Cols - 1); ++j) { + for(int j = 0; j < (Cols - 1); ++j) { os << std::setw(w) << this->operator()(i, j) << ", "; } os << std::setw(w) << this->operator()(i, Cols - 1) @@ -76,7 +76,7 @@ std::ostream& Matrix::print_on(std::ostream& os) const * member operators with scalars, per se element wise */ #define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template \ +template \ inline \ Matrix& \ Matrix::operator OP (value_type rhs) { \ @@ -93,10 +93,10 @@ TVMET_IMPLEMENT_MACRO(div_eq, /=) #define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template \ +template \ inline \ Matrix& \ -Matrix::operator OP (std::size_t rhs) { \ +Matrix::operator OP (int rhs) { \ typedef XprLiteral expr_type; \ this->M_##NAME(XprMatrix(expr_type(rhs))); \ return *this; \ @@ -115,7 +115,7 @@ TVMET_IMPLEMENT_MACRO(shr_eq, >>=) * member functions (operators) with matrizes, for use with +=,-= ... <<= */ #define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ +template \ template \ inline \ Matrix& \ @@ -141,7 +141,7 @@ TVMET_IMPLEMENT_MACRO(shr_eq) * member functions (operators) with expressions, for use width +=,-= ... <<= */ #define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ +template \ template \ inline \ Matrix& \ @@ -168,7 +168,7 @@ TVMET_IMPLEMENT_MACRO(shr_eq) * for use with +=,-= ... <<= */ #define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ +template \ template \ inline \ Matrix& \ @@ -190,7 +190,7 @@ TVMET_IMPLEMENT_MACRO(div_eq) * for use width +=,-= ... <<= and aliased(), */ #define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ +template \ template \ inline \ Matrix& \ diff --git a/tvmet-1.7.1/include/tvmet/MatrixOperators.h b/tvmet-1.7.1/include/tvmet/MatrixOperators.h index 2917e351a..372c5fe3d 100644 --- a/tvmet-1.7.1/include/tvmet/MatrixOperators.h +++ b/tvmet-1.7.1/include/tvmet/MatrixOperators.h @@ -32,7 +32,7 @@ namespace tvmet { *********************************************************/ -template +template std::ostream& operator<<(std::ostream& os, const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; @@ -49,12 +49,12 @@ std::ostream& operator<<(std::ostream& os, * \todo: the operator*= can have element wise mul oder product, decide! */ #define TVMET_DECLARE_MACRO(NAME, OP) \ -template \ +template \ Matrix& \ operator OP (Matrix& lhs, \ const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ Matrix& \ operator OP (Matrix& lhs, \ const XprMatrix& rhs) TVMET_CXX_ALWAYS_INLINE; @@ -92,7 +92,7 @@ namespace element_wise { * Note: per se element wise */ #define TVMET_DECLARE_MACRO(NAME, OP) \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME, \ @@ -104,7 +104,7 @@ XprMatrix< \ operator OP (const Matrix& lhs, \ const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME, \ @@ -116,7 +116,7 @@ XprMatrix< \ operator OP (const XprMatrix& lhs, \ const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME, \ @@ -143,7 +143,7 @@ namespace element_wise { * Note: operations +,-,*,/ are per se element wise */ #define TVMET_DECLARE_MACRO(NAME, OP, POD) \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME, \ @@ -155,7 +155,7 @@ XprMatrix< \ operator OP (const Matrix& lhs, \ POD rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME< POD, T>, \ @@ -207,7 +207,7 @@ TVMET_DECLARE_MACRO(div, /, long double) * \todo type promotion */ #define TVMET_DECLARE_MACRO(NAME, OP) \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME< std::complex, std::complex >, \ @@ -219,7 +219,7 @@ XprMatrix< \ operator OP (const Matrix< std::complex, Rows, Cols>& lhs, \ const std::complex& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME< std::complex, std::complex >, \ @@ -246,8 +246,8 @@ TVMET_DECLARE_MACRO(div, /) *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -template +template XprMatrix< XprMMProduct< MatrixConstReference, Rows1, Cols1, @@ -259,8 +259,8 @@ operator*(const Matrix& lhs, const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; -template +template XprMatrix< XprMMProduct< XprMatrix, Rows1, Cols1, @@ -272,8 +272,8 @@ operator*(const XprMatrix& lhs, const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; -template +template XprMatrix< XprMMProduct< MatrixConstReference, Rows1, Cols1, @@ -290,7 +290,7 @@ operator*(const Matrix& lhs, *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -template +template XprVector< XprMVProduct< MatrixConstReference, Rows, Cols, @@ -302,7 +302,7 @@ operator*(const Matrix& lhs, const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; -template +template XprVector< XprMVProduct< MatrixConstReference, Rows, Cols, @@ -314,7 +314,7 @@ operator*(const Matrix& lhs, const XprVector& rhs) TVMET_CXX_ALWAYS_INLINE; -template +template XprVector< XprMVProduct< XprMatrix, Rows, Cols, @@ -338,7 +338,7 @@ operator*(const XprMatrix& lhs, * Note: operations are per se element wise */ #define TVMET_DECLARE_MACRO(NAME, OP) \ -template \ XprMatrix< \ XprBinOp< \ @@ -352,7 +352,7 @@ operator OP (const Matrix& lhs, \ const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ template \ + class T, int Rows, int Cols> \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME, \ @@ -364,7 +364,7 @@ XprMatrix< \ operator OP (const XprMatrix& lhs, \ const Matrix& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ XprMatrix< \ XprBinOp< \ @@ -409,7 +409,7 @@ TVMET_DECLARE_MACRO(or, ||) * \todo type promotion */ #define TVMET_DECLARE_MACRO(NAME, OP) \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME< std::complex, std::complex >, \ @@ -421,7 +421,7 @@ XprMatrix< \ operator OP (const Matrix< std::complex, Rows, Cols>& lhs, \ const std::complex& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME< std::complex, std::complex >, \ @@ -454,7 +454,7 @@ TVMET_DECLARE_MACRO(or, ||) * Note: operations are per se element wise */ #define TVMET_DECLARE_MACRO(NAME, OP, TP) \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME, \ @@ -465,7 +465,7 @@ XprMatrix< \ > \ operator OP (const Matrix& lhs, TP rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME< TP, T>, \ @@ -565,7 +565,7 @@ TVMET_DECLARE_MACRO(or, ||, long double) * Note: per se element wise */ #define TVMET_DECLARE_MACRO(NAME, OP) \ -template \ +template \ XprMatrix< \ XprUnOp< \ Fcnl_##NAME, \ @@ -591,7 +591,7 @@ TVMET_DECLARE_MACRO(neg, -) * \brief Overload operator for i/o * \ingroup _binary_operator */ -template +template inline std::ostream& operator<<(std::ostream& os, const Matrix& rhs) { return rhs.print_on(os); @@ -610,14 +610,14 @@ std::ostream& operator<<(std::ostream& os, const Matrix& rhs) { * \todo: the operator*= can have element wise mul oder product, decide! */ #define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template \ +template \ inline \ Matrix& \ operator OP (Matrix& lhs, const Matrix& rhs) { \ return lhs.M_##NAME(rhs); \ } \ \ -template \ +template \ inline \ Matrix& \ operator OP (Matrix& lhs, const XprMatrix& rhs) { \ @@ -657,7 +657,7 @@ namespace element_wise { * Note: per se element wise */ #define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -671,7 +671,7 @@ operator OP (const Matrix& lhs, const Matrix& rh return NAME(lhs, rhs); \ } \ \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -685,7 +685,7 @@ operator OP (const XprMatrix& lhs, const Matrix& r return NAME(lhs, rhs); \ } \ \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -714,7 +714,7 @@ namespace element_wise { * Note: operations +,-,*,/ are per se element wise */ #define TVMET_IMPLEMENT_MACRO(NAME, OP, POD) \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -728,7 +728,7 @@ operator OP (const Matrix& lhs, POD rhs) { \ return NAME (lhs, rhs); \ } \ \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -782,7 +782,7 @@ TVMET_IMPLEMENT_MACRO(div, /, long double) * \todo type promotion */ #define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -797,7 +797,7 @@ operator OP (const Matrix< std::complex, Rows, Cols>& lhs, \ return NAME (lhs, rhs); \ } \ \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -834,8 +834,8 @@ TVMET_IMPLEMENT_MACRO(div, /) * \note The rows2 has to be equal to cols1. * \sa prod(const Matrix& lhs, const Matrix& rhs) */ -template +template inline XprMatrix< XprMMProduct< @@ -855,8 +855,8 @@ operator*(const Matrix& lhs, const Matrix& r * \ingroup _binary_operator * \sa prod(const XprMatrix& lhs, const Matrix& rhs) */ -template +template inline XprMatrix< XprMMProduct< @@ -876,8 +876,8 @@ operator*(const XprMatrix& lhs, const Matrix * \ingroup _binary_operator * \sa prod(const Matrix& lhs, const XprMatrix& rhs) */ -template +template inline XprMatrix< XprMMProduct< @@ -903,7 +903,7 @@ operator*(const Matrix& lhs, const XprMatrix * \note The length of the Vector has to be equal to the number of Columns. * \sa prod(const Matrix& m, const Vector& v) */ -template +template inline XprVector< XprMVProduct< @@ -923,7 +923,7 @@ operator*(const Matrix& lhs, const Vector& rhs) { * \ingroup _binary_operator * \sa prod(const Matrix& lhs, const XprVector& rhs) */ -template +template inline XprVector< XprMVProduct< @@ -943,7 +943,7 @@ operator*(const Matrix& lhs, const XprVector& rhs) { * \ingroup _binary_operator * \sa prod(const XprMatrix& lhs, const Vector& rhs) */ -template +template inline XprVector< XprMVProduct< @@ -969,7 +969,7 @@ operator*(const XprMatrix& lhs, const Vector& rhs) { * Note: operations are per se element wise */ #define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template \ inline \ XprMatrix< \ @@ -991,7 +991,7 @@ operator OP (const Matrix& lhs, \ } \ \ template \ + class T, int Rows, int Cols> \ inline \ XprMatrix< \ XprBinOp< \ @@ -1010,7 +1010,7 @@ operator OP (const XprMatrix& lhs, const Matrix& r return XprMatrix(expr_type(lhs, rhs.const_ref())); \ } \ \ -template \ inline \ XprMatrix< \ @@ -1062,7 +1062,7 @@ TVMET_IMPLEMENT_MACRO(or, ||) * \todo type promotion */ #define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -1083,7 +1083,7 @@ operator OP (const Matrix< std::complex, Rows, Cols>& lhs, \ expr_type(lhs.const_ref(), XprLiteral< std::complex >(rhs))); \ } \ \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -1125,7 +1125,7 @@ TVMET_IMPLEMENT_MACRO(or, ||) * Note: operations are per se element wise */ #define TVMET_IMPLEMENT_MACRO(NAME, OP, TP) \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -1145,7 +1145,7 @@ operator OP (const Matrix& lhs, TP rhs) { \ expr_type(lhs.const_ref(), XprLiteral< TP >(rhs))); \ } \ \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -1254,7 +1254,7 @@ TVMET_IMPLEMENT_MACRO(or, ||, long double) * Note: per se element wise */ #define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template \ +template \ inline \ XprMatrix< \ XprUnOp< \ diff --git a/tvmet-1.7.1/include/tvmet/MatrixUnaryFunctions.h b/tvmet-1.7.1/include/tvmet/MatrixUnaryFunctions.h index ff42c392a..2300977a4 100644 --- a/tvmet-1.7.1/include/tvmet/MatrixUnaryFunctions.h +++ b/tvmet-1.7.1/include/tvmet/MatrixUnaryFunctions.h @@ -35,7 +35,7 @@ namespace tvmet { * unary_function(Matrix) */ #define TVMET_DECLARE_MACRO(NAME) \ -template \ +template \ inline \ XprMatrix< \ XprUnOp< \ @@ -96,7 +96,7 @@ TVMET_DECLARE_MACRO(finite) */ #if defined(TVMET_HAVE_COMPLEX) #define TVMET_DECLARE_MACRO(NAME) \ -template \ +template \ inline \ XprMatrix< \ XprUnOp< \ @@ -127,7 +127,7 @@ TVMET_DECLARE_MACRO(conj) * unary_function(Matrix) */ #define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ +template \ inline \ XprMatrix< \ XprUnOp< \ @@ -194,7 +194,7 @@ TVMET_IMPLEMENT_MACRO(finite) */ #if defined(TVMET_HAVE_COMPLEX) #define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ +template \ inline \ XprMatrix< \ XprUnOp< \ diff --git a/tvmet-1.7.1/include/tvmet/TvmetBase.h b/tvmet-1.7.1/include/tvmet/TvmetBase.h index b5a6fd4fb..262f860d4 100644 --- a/tvmet-1.7.1/include/tvmet/TvmetBase.h +++ b/tvmet-1.7.1/include/tvmet/TvmetBase.h @@ -47,15 +47,15 @@ template class TvmetBase { }; class IndentLevel : public TvmetBase< IndentLevel > { public: - IndentLevel(std::size_t level) : m_level(level) { } + IndentLevel(int level) : m_level(level) { } std::ostream& print_xpr(std::ostream& os) const { - for(std::size_t i = 0; i != m_level; ++i) os << " "; + for(int i = 0; i != m_level; ++i) os << " "; return os; } private: - std::size_t m_level; + int m_level; }; diff --git a/tvmet-1.7.1/include/tvmet/UnaryFunctionals.h b/tvmet-1.7.1/include/tvmet/UnaryFunctionals.h index 3268c120b..fa3176496 100644 --- a/tvmet-1.7.1/include/tvmet/UnaryFunctionals.h +++ b/tvmet-1.7.1/include/tvmet/UnaryFunctionals.h @@ -39,7 +39,7 @@ struct Fcnl_not : public UnaryFunctional { } static - void print_xpr(std::ostream& os, std::size_t l=0) { + void print_xpr(std::ostream& os, int l=0) { os << IndentLevel(l) << "Fcnl_not," << std::endl; @@ -60,7 +60,7 @@ struct Fcnl_##NAME : public UnaryFunctional { \ } \ \ static \ - void print_xpr(std::ostream& os, std::size_t l=0) { \ + void print_xpr(std::ostream& os, int l=0) { \ os << IndentLevel(l) << "Fcnl_" << #NAME << "," \ << std::endl; \ @@ -99,7 +99,7 @@ struct Fcnl_##NAME : public UnaryFunctional { \ } \ \ static \ - void print_xpr(std::ostream& os, std::size_t l=0) { \ + void print_xpr(std::ostream& os, int l=0) { \ os << IndentLevel(l) << "Fcnl_" << #NAME << "," \ << std::endl; \ @@ -139,7 +139,7 @@ struct Fcnl_##NAME : public UnaryFunctional { \ } \ \ static \ - void print_xpr(std::ostream& os, std::size_t l=0) { \ + void print_xpr(std::ostream& os, int l=0) { \ os << IndentLevel(l) << "Fcnl_" << #NAME << "," \ << std::endl; \ @@ -177,7 +177,7 @@ struct Fcnl_##NAME : public UnaryFunctional { \ } \ \ static \ - void print_xpr(std::ostream& os, std::size_t l=0) { \ + void print_xpr(std::ostream& os, int l=0) { \ os << IndentLevel(l) << "Fcnl_" << #NAME << "," \ << std::endl; \ @@ -219,7 +219,7 @@ struct Fcnl_##NAME< POD > : public UnaryFunctional { \ } \ \ static \ - void print_xpr(std::ostream& os, std::size_t l=0) { \ + void print_xpr(std::ostream& os, int l=0) { \ os << IndentLevel(l) << "Fcnl_" << #NAME << "," \ << std::endl; \ @@ -260,7 +260,7 @@ struct Fcnl_abs< std::complex > : public UnaryFunctional { } static - void print_xpr(std::ostream& os, std::size_t l=0) { + void print_xpr(std::ostream& os, int l=0) { os << IndentLevel(l) << "Fcnl_abs).name() << ">," << std::endl; @@ -286,7 +286,7 @@ struct Fcnl_conj< std::complex > : public UnaryFunctional { } static - void print_xpr(std::ostream& os, std::size_t l=0) { + void print_xpr(std::ostream& os, int l=0) { os << IndentLevel(l) << "Fcnl_conj).name() << ">," << std::endl; @@ -310,7 +310,7 @@ struct Fcnl_##NAME< std::complex > : public UnaryFunctional { \ } \ \ static \ - void print_xpr(std::ostream& os, std::size_t l=0) { \ + void print_xpr(std::ostream& os, int l=0) { \ os << IndentLevel(l) << "Fcnl_" << #NAME << ").name() << ">," \ << std::endl; \ @@ -341,7 +341,7 @@ struct Fcnl_##NAME : public UnaryFunctional { \ } \ \ static \ - void print_xpr(std::ostream& os, std::size_t l=0) { \ + void print_xpr(std::ostream& os, int l=0) { \ os << IndentLevel(l) << "Fcnl_" << #NAME << "," \ << std::endl; \ diff --git a/tvmet-1.7.1/include/tvmet/Vector.h b/tvmet-1.7.1/include/tvmet/Vector.h index 24a514233..6409fab96 100644 --- a/tvmet-1.7.1/include/tvmet/Vector.h +++ b/tvmet-1.7.1/include/tvmet/Vector.h @@ -37,14 +37,14 @@ namespace tvmet { /* forwards */ -template class Vector; +template class Vector; /** * \class VectorConstReference Vector.h "tvmet/Vector.h" * \brief Const value iterator for ET */ -template +template class VectorConstReference : public TvmetBase< VectorConstReference > { @@ -82,13 +82,13 @@ public: public: // access operators /** access by index. */ - value_type operator()(std::size_t i) const { + value_type operator()(int i) const { assert(i < Size); return m_data[i]; } 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) << "VectorConstReference[O=" << ops << "]<" << "T=" << typeid(T).name() << ">," @@ -104,7 +104,7 @@ private: * \class Vector Vector.h "tvmet/Vector.h" * \brief Compile time fixed length vector with evaluation on compile time. */ -template +template class Vector { public: @@ -188,10 +188,10 @@ public: // STL interface static bool empty() { return false; } /** The size of the vector. */ - static std::size_t size() { return Size; } + static int size() { return Size; } /** STL vector max_size() - returns allways Size. */ - static std::size_t max_size() { return Size; } + static int max_size() { return Size; } public: /** Default Destructor */ @@ -214,7 +214,7 @@ public: template explicit Vector(InputIterator first, InputIterator last) { - assert( static_cast(std::distance(first, last)) <= Size); + assert( static_cast(std::distance(first, last)) <= Size); std::copy(first, last, m_data); } @@ -223,7 +223,7 @@ public: * vector self, there isn't any stored reference to the array pointer. */ template - explicit Vector(InputIterator first, std::size_t sz) + explicit Vector(InputIterator first, int sz) { assert(sz <= Size); std::copy(first, first + sz, m_data); @@ -330,23 +330,23 @@ public: // access operators const value_type* _tvmet_restrict data() const { return m_data; } public: // index access operators - value_type& _tvmet_restrict operator()(std::size_t i) { + value_type& _tvmet_restrict operator()(int i) { // Note: g++-2.95.3 does have problems on typedef reference assert(i < Size); return m_data[i]; } - value_type operator()(std::size_t i) const { + value_type operator()(int i) const { assert(i < Size); return m_data[i]; } - value_type& _tvmet_restrict operator[](std::size_t i) { + value_type& _tvmet_restrict operator[](int i) { // Note: g++-2.95.3 does have problems on typedef reference return this->operator()(i); } - value_type operator[](std::size_t i) const { + value_type operator[](int i) const { return this->operator()(i); } @@ -400,7 +400,7 @@ public: // assign operations } private: - template friend class CommaInitializer; + template friend class CommaInitializer; /** This is a helper for assigning a comma separated initializer list. It's equal to Vector& operator=(value_type) which does @@ -418,12 +418,12 @@ public: // math operators with scalars Vector& operator*=(value_type) TVMET_CXX_ALWAYS_INLINE; Vector& operator/=(value_type) TVMET_CXX_ALWAYS_INLINE; - Vector& operator%=(std::size_t) TVMET_CXX_ALWAYS_INLINE; - Vector& operator^=(std::size_t) TVMET_CXX_ALWAYS_INLINE; - Vector& operator&=(std::size_t) TVMET_CXX_ALWAYS_INLINE; - Vector& operator|=(std::size_t) TVMET_CXX_ALWAYS_INLINE; - Vector& operator<<=(std::size_t) TVMET_CXX_ALWAYS_INLINE; - Vector& operator>>=(std::size_t) TVMET_CXX_ALWAYS_INLINE; + Vector& operator%=(int) TVMET_CXX_ALWAYS_INLINE; + Vector& operator^=(int) TVMET_CXX_ALWAYS_INLINE; + Vector& operator&=(int) TVMET_CXX_ALWAYS_INLINE; + Vector& operator|=(int) TVMET_CXX_ALWAYS_INLINE; + Vector& operator<<=(int) TVMET_CXX_ALWAYS_INLINE; + Vector& operator>>=(int) TVMET_CXX_ALWAYS_INLINE; public: // math assign operators with vectors // NOTE: access using the operators in ns element_wise, since that's what is does @@ -478,7 +478,7 @@ public: // io static Info info() { return Info(); } /** Member function for expression level printing. */ - std::ostream& print_xpr(std::ostream& os, std::size_t l=0) const; + std::ostream& print_xpr(std::ostream& os, int l=0) const; /** Member function for printing internal data. */ std::ostream& print_on(std::ostream& os) const; diff --git a/tvmet-1.7.1/include/tvmet/VectorBinaryFunctions.h b/tvmet-1.7.1/include/tvmet/VectorBinaryFunctions.h index 08d5397b3..d31b2b1d2 100644 --- a/tvmet-1.7.1/include/tvmet/VectorBinaryFunctions.h +++ b/tvmet-1.7.1/include/tvmet/VectorBinaryFunctions.h @@ -40,7 +40,7 @@ namespace tvmet { * binary_function(XprVector, Vector) */ #define TVMET_DECLARE_MACRO(NAME) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -53,7 +53,7 @@ XprVector< \ NAME(const Vector& lhs, \ const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -66,7 +66,7 @@ XprVector< \ NAME(const XprVector& lhs, \ const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -97,7 +97,7 @@ TVMET_DECLARE_MACRO(polar) * binary_function(Vector, POD) */ #define TVMET_DECLARE_MACRO(NAME, TP) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -161,7 +161,7 @@ TVMET_DECLARE_MACRO(pow, long double) */ #if defined(TVMET_HAVE_COMPLEX) && defined(TVMET_HAVE_COMPLEX_MATH1) -template +template XprVector< XprBinOp< Fcnl_pow >, @@ -174,7 +174,7 @@ pow(const Vector& lhs, const std::complex& rhs) TVMET_CXX_ALWAYS_INLINE; -template +template XprVector< XprBinOp< Fcnl_pow, std::complex >, @@ -187,7 +187,7 @@ pow(const Vector, Sz>& lhs, const std::complex& rhs) TVMET_CXX_ALWAYS_INLINE; -template +template XprVector< XprBinOp< Fcnl_pow, T>, @@ -200,7 +200,7 @@ pow(const Vector, Sz>& lhs, const T& rhs) TVMET_CXX_ALWAYS_INLINE; -template +template XprVector< XprBinOp< Fcnl_pow, int>, @@ -213,7 +213,7 @@ pow(const Vector, Sz>& lhs, int rhs) TVMET_CXX_ALWAYS_INLINE; -template +template XprVector< XprBinOp< Fcnl_polar, @@ -241,7 +241,7 @@ polar(const Vector& lhs, const T& rhs) TVMET_CXX_ALWAYS_INLINE; * binary_function(XprVector, Vector) */ #define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -261,7 +261,7 @@ NAME(const Vector& lhs, const Vector& rhs) { \ expr_type(lhs.const_ref(), rhs.const_ref())); \ } \ \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -281,7 +281,7 @@ NAME(const XprVector& lhs, const Vector& rhs) { \ expr_type(lhs, rhs.const_ref())); \ } \ \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -319,7 +319,7 @@ TVMET_IMPLEMENT_MACRO(polar) * binary_function(Vector, POD) */ #define TVMET_IMPLEMENT_MACRO(NAME, TP) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -395,7 +395,7 @@ TVMET_IMPLEMENT_MACRO(pow, long double) * \fn pow(const Vector& lhs, const std::complex& rhs) * \ingroup _binary_function */ -template +template inline XprVector< XprBinOp< @@ -420,7 +420,7 @@ pow(const Vector& lhs, const std::complex& rhs) { * \fn pow(const Vector, Sz>& lhs, const std::complex& rhs) * \ingroup _binary_function */ -template +template inline XprVector< XprBinOp< @@ -445,7 +445,7 @@ pow(const Vector, Sz>& lhs, const std::complex& rhs) { * \fn pow(const Vector, Sz>& lhs, const T& rhs) * \ingroup _binary_function */ -template +template inline XprVector< XprBinOp< @@ -470,7 +470,7 @@ pow(const Vector, Sz>& lhs, const T& rhs) { * \fn pow(const Vector, Sz>& lhs, int rhs) * \ingroup _binary_function */ -template +template inline XprVector< XprBinOp< @@ -495,7 +495,7 @@ pow(const Vector, Sz>& lhs, int rhs) { * \fn polar(const Vector& lhs, const T& rhs) * \ingroup _binary_function */ -template +template inline XprVector< XprBinOp< diff --git a/tvmet-1.7.1/include/tvmet/VectorEval.h b/tvmet-1.7.1/include/tvmet/VectorEval.h index 4043100f1..2e4430fc1 100644 --- a/tvmet-1.7.1/include/tvmet/VectorEval.h +++ b/tvmet-1.7.1/include/tvmet/VectorEval.h @@ -47,7 +47,7 @@ namespace tvmet { * \endcode * \sa \ref compare */ -template +template inline bool all_elements(const XprVector& e) { return meta::Vector::all_elements(e); @@ -69,7 +69,7 @@ bool all_elements(const XprVector& e) { * \endcode * \sa \ref compare */ -template +template inline bool any_elements(const XprVector& e) { return meta::Vector::any_elements(e); @@ -91,7 +91,7 @@ bool any_elements(const XprVector& e) { * This eval is for the a?b:c syntax, since it's not allowed to overload * these operators. */ -template +template inline XprVector< XprEval< @@ -119,7 +119,7 @@ eval(const XprVector& e1, const Vector& v2, const Vector * This eval is for the a?b:c syntax, since it's not allowed to overload * these operators. */ -template +template inline XprVector< XprEval< @@ -147,7 +147,7 @@ eval(const XprVector& e1, const Vector& v2, const XprVector +template inline XprVector< XprEval< @@ -175,7 +175,7 @@ eval(const XprVector& e1, const XprVector& e2, const Vector +template inline XprVector< XprEval< @@ -203,7 +203,7 @@ eval(const XprVector& e1, const XprVector& e2, const XprVector ? XprVector : POD */ #define TVMET_IMPLEMENT_MACRO(POD) \ -template \ +template \ inline \ XprVector< \ XprEval< \ @@ -223,7 +223,7 @@ eval(const XprVector& e, POD x2, POD x3) { \ expr_type(e, XprLiteral< POD >(x2), XprLiteral< POD >(x3))); \ } \ \ -template \ +template \ inline \ XprVector< \ XprEval< \ @@ -243,7 +243,7 @@ eval(const XprVector& e1, POD x2, const XprVector& e3) { \ expr_type(e1, XprLiteral< POD >(x2), e3)); \ } \ \ -template \ +template \ inline \ XprVector< \ XprEval< \ @@ -296,7 +296,7 @@ TVMET_IMPLEMENT_MACRO(long double) * This eval is for the a?b:c syntax, since it's not allowed to overload * these operators. */ -template +template inline XprVector< XprEval< @@ -323,7 +323,7 @@ eval(const XprVector& e, std::complex z2, std::complex z3) { * This eval is for the a?b:c syntax, since it's not allowed to overload * these operators. */ -template +template inline XprVector< XprEval< @@ -350,7 +350,7 @@ eval(const XprVector& e1, std::complex z2, const XprVector& e * This eval is for the a?b:c syntax, since it's not allowed to overload * these operators. */ -template +template inline XprVector< XprEval< diff --git a/tvmet-1.7.1/include/tvmet/VectorFunctions.h b/tvmet-1.7.1/include/tvmet/VectorFunctions.h index d0b3342a4..247d4b990 100644 --- a/tvmet-1.7.1/include/tvmet/VectorFunctions.h +++ b/tvmet-1.7.1/include/tvmet/VectorFunctions.h @@ -45,7 +45,7 @@ namespace tvmet { * function(XprVector, Vector) */ #define TVMET_DECLARE_MACRO(NAME) \ -template \ +template \ XprVector< \ XprBinOp< \ Fcnl_##NAME, \ @@ -57,7 +57,7 @@ XprVector< \ NAME (const Vector& lhs, \ const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprVector< \ XprBinOp< \ Fcnl_##NAME, \ @@ -69,7 +69,7 @@ XprVector< \ NAME (const XprVector& lhs, \ const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprVector< \ XprBinOp< \ Fcnl_##NAME, \ @@ -97,7 +97,7 @@ namespace element_wise { * Note: - operations +,-,*,/ are per se element wise */ #define TVMET_DECLARE_MACRO(NAME, POD) \ -template \ +template \ XprVector< \ XprBinOp< \ Fcnl_##NAME< T, POD >, \ @@ -109,7 +109,7 @@ XprVector< \ NAME (const Vector& lhs, \ POD rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprVector< \ XprBinOp< \ Fcnl_##NAME< POD, T>, \ @@ -161,7 +161,7 @@ TVMET_DECLARE_MACRO(div, long double) * \todo type promotion */ #define TVMET_DECLARE_MACRO(NAME) \ -template \ +template \ XprVector< \ XprBinOp< \ Fcnl_##NAME< std::complex, std::complex >, \ @@ -173,7 +173,7 @@ XprVector< \ NAME (const Vector, Sz>& lhs, \ const std::complex& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprVector< \ XprBinOp< \ Fcnl_##NAME< std::complex, std::complex >, \ @@ -200,17 +200,17 @@ TVMET_DECLARE_MACRO(div) *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -template +template typename NumericTraits::sum_type sum(const Vector& v) TVMET_CXX_ALWAYS_INLINE; -template +template typename NumericTraits::sum_type product(const Vector& v) TVMET_CXX_ALWAYS_INLINE; -template +template typename PromoteTraits::value_type dot(const Vector& lhs, const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; @@ -222,17 +222,17 @@ cross(const Vector& lhs, const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; -template +template typename NumericTraits::sum_type norm1(const Vector& v) TVMET_CXX_ALWAYS_INLINE; -template +template typename NumericTraits::sum_type norm2(const Vector& v) TVMET_CXX_ALWAYS_INLINE; -template +template XprVector< XprBinOp< Fcnl_div, @@ -248,45 +248,45 @@ normalize(const Vector& v) TVMET_CXX_ALWAYS_INLINE; * min/max unary functions *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -template -Extremum +template +Extremum maximum(const XprVector& e); // NOT TVMET_CXX_ALWAYS_INLINE; -template -Extremum +template +Extremum maximum(const Vector& v) TVMET_CXX_ALWAYS_INLINE; -template -Extremum +template +Extremum minimum(const XprVector& e); // NOT TVMET_CXX_ALWAYS_INLINE; -template -Extremum +template +Extremum minimum(const Vector& v) TVMET_CXX_ALWAYS_INLINE; -template +template typename E::value_type max(const XprVector& e); // NOT TVMET_CXX_ALWAYS_INLINE; -template +template T max(const Vector& v) TVMET_CXX_ALWAYS_INLINE; -template +template typename E::value_type min(const XprVector& e); // NOT TVMET_CXX_ALWAYS_INLINE; -template +template T min(const Vector& v) TVMET_CXX_ALWAYS_INLINE; -template +template XprVector< VectorConstReference, Sz @@ -310,7 +310,7 @@ cvector_ref(const T* mem) TVMET_CXX_ALWAYS_INLINE; * function(XprVector, Vector) */ #define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -330,7 +330,7 @@ NAME (const Vector& lhs, const Vector& rhs) { \ expr_type(lhs.const_ref(), rhs.const_ref())); \ } \ \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -350,7 +350,7 @@ NAME (const XprVector& lhs, const Vector& rhs) { \ expr_type(lhs, rhs.const_ref())); \ } \ \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -386,7 +386,7 @@ namespace element_wise { * Note: - operations +,-,*,/ are per se element wise */ #define TVMET_IMPLEMENT_MACRO(NAME, POD) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -406,7 +406,7 @@ NAME (const Vector& lhs, POD rhs) { \ expr_type(lhs.const_ref(), XprLiteral< POD >(rhs))); \ } \ \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -466,7 +466,7 @@ TVMET_IMPLEMENT_MACRO(div, long double) * \todo type promotion */ #define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -486,7 +486,7 @@ NAME (const Vector, Sz>& lhs, const std::complex& rhs) { \ expr_type(lhs.const_ref(), XprLiteral< std::complex >(rhs))); \ } \ \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -531,7 +531,7 @@ TVMET_IMPLEMENT_MACRO(div) * \sum_{i = 0}^{Sz-1} v[i] * \f] */ -template +template inline typename NumericTraits::sum_type sum(const Vector& v) { @@ -549,7 +549,7 @@ sum(const Vector& v) { * \prod_{i = 0}^{Sz - 1} v[i] * \f] */ -template +template inline typename NumericTraits::sum_type product(const Vector& v) { @@ -569,7 +569,7 @@ product(const Vector& v) { * where lhs is a column vector and rhs is a row vector, both vectors * have the same dimension. */ -template +template inline typename PromoteTraits::value_type dot(const Vector& lhs, const Vector& rhs) { @@ -606,7 +606,7 @@ cross(const Vector& lhs, const Vector& rhs) { * |Vector v| = |v| = \sum_{i=0}^{Sz-1}\,|v[i]| * \f] */ -template +template inline typename NumericTraits::sum_type norm1(const Vector& v) { @@ -627,7 +627,7 @@ norm1(const Vector& v) { * * \note The internal cast for Vector avoids warnings on sqrt. */ -template +template inline typename NumericTraits::sum_type norm2(const Vector& v) { @@ -646,7 +646,7 @@ norm2(const Vector& v) { * \frac{Vector v}{\sqrt{ \sum_{i=0}^{Sz-1}\,v[i]^2 }} * \f] */ -template +template inline XprVector< XprBinOp< @@ -677,24 +677,24 @@ normalize(const Vector& v) { * \brief Find the maximum of a vector expression * \ingroup _unary_function */ -template +template inline -Extremum +Extremum maximum(const XprVector& e) { typedef typename E::value_type value_type; value_type m_max(e(0)); - std::size_t m_idx(0); + int m_idx(0); // this loop is faster than meta templates! - for(std::size_t i = 1; i != Sz; ++i) { + for(int i = 1; i != Sz; ++i) { if(e(i) > m_max) { m_max = e(i); m_idx = i; } } - return Extremum(m_max, m_idx); + return Extremum(m_max, m_idx); } @@ -703,9 +703,9 @@ maximum(const XprVector& e) { * \brief Find the maximum of a vector * \ingroup _unary_function */ -template +template inline -Extremum +Extremum maximum(const Vector& v) { return maximum(v.as_expr()); } @@ -714,24 +714,24 @@ maximum(const Vector& v) { return maximum(v.as_expr()); } * \brief Find the minimum of a vector expression * \ingroup _unary_function */ -template +template inline -Extremum +Extremum minimum(const XprVector& e) { typedef typename E::value_type value_type; value_type m_min(e(0)); - std::size_t m_idx(0); + int m_idx(0); // this loop is faster than meta templates! - for(std::size_t i = 1; i != Sz; ++i) { + for(int i = 1; i != Sz; ++i) { if(e(i) < m_min) { m_min = e(i); m_idx = i; } } - return Extremum(m_min, m_idx); + return Extremum(m_min, m_idx); } @@ -740,9 +740,9 @@ minimum(const XprVector& e) { * \brief Find the minimum of a vector * \ingroup _unary_function */ -template +template inline -Extremum +Extremum minimum(const Vector& v) { return minimum(v.as_expr()); } @@ -751,7 +751,7 @@ minimum(const Vector& v) { return minimum(v.as_expr()); } * \brief Find the maximum of a vector expression * \ingroup _unary_function */ -template +template inline typename E::value_type max(const XprVector& e) { @@ -760,7 +760,7 @@ max(const XprVector& e) { value_type m_max(e(0)); // this loop is faster than meta templates! - for(std::size_t i = 1; i != Sz; ++i) + for(int i = 1; i != Sz; ++i) if(e(i) > m_max) m_max = e(i); @@ -773,7 +773,7 @@ max(const XprVector& e) { * \brief Find the maximum of a vector * \ingroup _unary_function */ -template +template inline T max(const Vector& v) { typedef T value_type; @@ -796,7 +796,7 @@ T max(const Vector& v) { * \brief Find the minimum of a vector expression * \ingroup _unary_function */ -template +template inline typename E::value_type min(const XprVector& e) { @@ -805,7 +805,7 @@ min(const XprVector& e) { value_type m_min(e(0)); // this loop is faster than meta templates! - for(std::size_t i = 1; i != Sz; ++i) + for(int i = 1; i != Sz; ++i) if(e(i) < m_min) m_min = e(i); @@ -818,7 +818,7 @@ min(const XprVector& e) { * \brief Find the minimum of a vector * \ingroup _unary_function */ -template +template inline T min(const Vector& v) { typedef T value_type; @@ -860,7 +860,7 @@ T min(const Vector& v) { * * \since release 1.6.0 */ -template +template inline XprVector< VectorConstReference, diff --git a/tvmet-1.7.1/include/tvmet/VectorImpl.h b/tvmet-1.7.1/include/tvmet/VectorImpl.h index 75a6c44fc..a1a28cfb7 100644 --- a/tvmet-1.7.1/include/tvmet/VectorImpl.h +++ b/tvmet-1.7.1/include/tvmet/VectorImpl.h @@ -36,8 +36,8 @@ namespace tvmet { /* * member operators for i/o */ -template -std::ostream& Vector::print_xpr(std::ostream& os, std::size_t l) const +template +std::ostream& Vector::print_xpr(std::ostream& os, int l) const { os << IndentLevel(l++) << "Vector[" << ops << "]<" << typeid(T).name() << ", " << Size << ">," @@ -48,7 +48,7 @@ std::ostream& Vector::print_xpr(std::ostream& os, std::size_t l) const } -template +template std::ostream& Vector::print_on(std::ostream& os) const { enum { @@ -58,7 +58,7 @@ std::ostream& Vector::print_on(std::ostream& os) const std::streamsize w = IoPrintHelper::width(dispatch(), *this); os << std::setw(0) << "[\n "; - for(std::size_t i = 0; i < (Size - 1); ++i) { + for(int i = 0; i < (Size - 1); ++i) { os << std::setw(w) << m_data[i] << ", "; } os << std::setw(w) << m_data[Size - 1] << "\n]"; @@ -71,7 +71,7 @@ std::ostream& Vector::print_on(std::ostream& os) const * member operators with scalars, per se element wise */ #define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template \ +template \ inline \ Vector& Vector::operator OP (value_type rhs) { \ typedef XprLiteral expr_type; \ @@ -87,9 +87,9 @@ TVMET_IMPLEMENT_MACRO(div_eq, /=) #define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template \ +template \ inline \ -Vector& Vector::operator OP (std::size_t rhs) { \ +Vector& Vector::operator OP (int rhs) { \ typedef XprLiteral expr_type; \ this->M_##NAME(XprVector(expr_type(rhs))); \ return *this; \ @@ -108,7 +108,7 @@ TVMET_IMPLEMENT_MACRO(shr_eq, >>=) * member functions (operators) with vectors, for use with +=,-= ... <<= */ #define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ +template \ template \ inline Vector& \ Vector::M_##NAME (const Vector& rhs) { \ @@ -133,7 +133,7 @@ TVMET_IMPLEMENT_MACRO(shr_eq) * member functions (operators) with expressions, for use width +=,-= ... <<= */ #define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ +template \ template \ inline \ Vector& \ @@ -160,7 +160,7 @@ TVMET_IMPLEMENT_MACRO(shr_eq) * for use with +=,-= ... <<= */ #define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ +template \ template \ inline \ Vector& \ @@ -182,7 +182,7 @@ TVMET_IMPLEMENT_MACRO(div_eq) * for use width +=,-= ... <<= */ #define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ +template \ template \ inline \ Vector& \ diff --git a/tvmet-1.7.1/include/tvmet/VectorOperators.h b/tvmet-1.7.1/include/tvmet/VectorOperators.h index 7eb17b424..97b678117 100644 --- a/tvmet-1.7.1/include/tvmet/VectorOperators.h +++ b/tvmet-1.7.1/include/tvmet/VectorOperators.h @@ -32,7 +32,7 @@ namespace tvmet { *********************************************************/ -template +template inline std::ostream& operator<<(std::ostream& os, const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; @@ -49,12 +49,12 @@ std::ostream& operator<<(std::ostream& os, * Note: per se element wise */ #define TVMET_DECLARE_MACRO(NAME, OP) \ -template \ +template \ Vector& \ operator OP (Vector& lhs, \ const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ Vector& \ operator OP (Vector& lhs, \ const XprVector& rhs) TVMET_CXX_ALWAYS_INLINE; @@ -91,7 +91,7 @@ namespace element_wise { * operator(XprVector, Vector) */ #define TVMET_DECLARE_MACRO(NAME, OP) \ -template \ +template \ XprVector< \ XprBinOp< \ Fcnl_##NAME, \ @@ -103,7 +103,7 @@ XprVector< \ operator OP (const Vector& lhs, \ const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprVector< \ XprBinOp< \ Fcnl_##NAME, \ @@ -115,7 +115,7 @@ XprVector< \ operator OP (const XprVector& lhs, \ const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprVector< \ XprBinOp< \ Fcnl_##NAME, \ @@ -143,7 +143,7 @@ namespace element_wise { * Note: operations +,-,*,/ are per se element wise */ #define TVMET_DECLARE_MACRO(NAME, OP, POD) \ -template \ +template \ XprVector< \ XprBinOp< \ Fcnl_##NAME< T, POD >, \ @@ -155,7 +155,7 @@ XprVector< \ operator OP (const Vector& lhs, \ POD rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprVector< \ XprBinOp< \ Fcnl_##NAME< POD, T>, \ @@ -207,7 +207,7 @@ TVMET_DECLARE_MACRO(div, /, long double) * \todo type promotion */ #define TVMET_DECLARE_MACRO(NAME, OP) \ -template \ +template \ XprVector< \ XprBinOp< \ Fcnl_##NAME< std::complex, std::complex >, \ @@ -219,7 +219,7 @@ XprVector< \ operator OP (const Vector, Sz>& lhs, \ const std::complex& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprVector< \ XprBinOp< \ Fcnl_##NAME< std::complex, std::complex >, \ @@ -252,7 +252,7 @@ TVMET_DECLARE_MACRO(div, /) // per se element wise * Note: operations are per se element wise */ #define TVMET_DECLARE_MACRO(NAME, OP) \ -template \ +template \ XprVector< \ XprBinOp< \ Fcnl_##NAME, \ @@ -264,7 +264,7 @@ XprVector< \ operator OP (const Vector& lhs, \ const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprVector< \ XprBinOp< \ Fcnl_##NAME, \ @@ -276,7 +276,7 @@ XprVector< \ operator OP (const XprVector& lhs, \ const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprVector< \ XprBinOp< \ Fcnl_##NAME, \ @@ -321,7 +321,7 @@ TVMET_DECLARE_MACRO(or, ||) * \todo type promotion */ #define TVMET_DECLARE_MACRO(NAME, OP) \ -template \ +template \ XprVector< \ XprBinOp< \ Fcnl_##NAME< std::complex, std::complex >, \ @@ -333,7 +333,7 @@ XprVector< \ operator OP (const Vector, Sz>& lhs, \ const std::complex& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprVector< \ XprBinOp< \ Fcnl_##NAME< std::complex, std::complex >, \ @@ -366,7 +366,7 @@ TVMET_DECLARE_MACRO(or, ||) * Note: operations are per se element_wise */ #define TVMET_DECLARE_MACRO(NAME, OP, TP) \ -template \ +template \ XprVector< \ XprBinOp< \ Fcnl_##NAME< T, TP >, \ @@ -377,7 +377,7 @@ XprVector< \ > \ operator OP (const Vector& lhs, TP rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprVector< \ XprBinOp< \ Fcnl_##NAME< TP, T>, \ @@ -475,7 +475,7 @@ TVMET_DECLARE_MACRO(or, ||, long double) * Note: per se element wise */ #define TVMET_DECLARE_MACRO(NAME, OP) \ -template \ +template \ XprVector< \ XprUnOp< \ Fcnl_##NAME, \ @@ -501,7 +501,7 @@ TVMET_DECLARE_MACRO(neg, -) * \brief Overload operator for i/o * \ingroup _binary_operator */ -template +template inline std::ostream& operator<<(std::ostream& os, const Vector& rhs) { return rhs.print_on(os); @@ -519,13 +519,13 @@ std::ostream& operator<<(std::ostream& os, const Vector& rhs) { * Note: per se element wise */ #define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template \ +template \ inline Vector& \ operator OP (Vector& lhs, const Vector& rhs) { \ return lhs.M_##NAME(rhs); \ } \ \ -template \ +template \ inline Vector& \ operator OP (Vector& lhs, const XprVector& rhs) { \ return lhs.M_##NAME(rhs); \ @@ -563,7 +563,7 @@ namespace element_wise { * operator(XprVector, Vector) */ #define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -577,7 +577,7 @@ operator OP (const Vector& lhs, const Vector& rhs) { \ return NAME (lhs, rhs); \ } \ \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -591,7 +591,7 @@ operator OP (const XprVector& lhs, const Vector& rhs) { \ return NAME (lhs, rhs); \ } \ \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -621,7 +621,7 @@ namespace element_wise { * Note: operations +,-,*,/ are per se element wise */ #define TVMET_IMPLEMENT_MACRO(NAME, OP, POD) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -635,7 +635,7 @@ operator OP (const Vector& lhs, POD rhs) { \ return NAME (lhs, rhs); \ } \ \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -689,7 +689,7 @@ TVMET_IMPLEMENT_MACRO(div, /, long double) * \todo type promotion */ #define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -704,7 +704,7 @@ operator OP (const Vector, Sz>& lhs, \ return NAME (lhs, rhs); \ } \ \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -741,7 +741,7 @@ TVMET_IMPLEMENT_MACRO(div, /) // per se element wise * Note: operations are per se element wise */ #define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -761,7 +761,7 @@ operator OP (const Vector& lhs, const Vector& rhs) { \ expr_type(lhs.const_ref(), rhs.const_ref())); \ } \ \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -781,7 +781,7 @@ operator OP (const XprVector& lhs, const Vector& rhs) { \ expr_type(lhs, rhs.const_ref())); \ } \ \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -833,7 +833,7 @@ TVMET_IMPLEMENT_MACRO(or, ||) * \todo type promotion */ #define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -853,7 +853,7 @@ operator OP (const Vector, Sz>& lhs, const std::complex& rhs) expr_type(lhs.const_ref(), XprLiteral< std::complex >(rhs))); \ } \ \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -894,7 +894,7 @@ TVMET_IMPLEMENT_MACRO(or, ||) * Note: operations are per se element_wise */ #define TVMET_IMPLEMENT_MACRO(NAME, OP, TP) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -914,7 +914,7 @@ operator OP (const Vector& lhs, TP rhs) { \ expr_type(lhs.const_ref(), XprLiteral< TP >(rhs))); \ } \ \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -1021,7 +1021,7 @@ TVMET_IMPLEMENT_MACRO(or, ||, long double) * Note: per se element wise */ #define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template \ +template \ inline \ XprVector< \ XprUnOp< \ diff --git a/tvmet-1.7.1/include/tvmet/VectorUnaryFunctions.h b/tvmet-1.7.1/include/tvmet/VectorUnaryFunctions.h index b556ac7da..7c01cbf21 100644 --- a/tvmet-1.7.1/include/tvmet/VectorUnaryFunctions.h +++ b/tvmet-1.7.1/include/tvmet/VectorUnaryFunctions.h @@ -35,7 +35,7 @@ namespace tvmet { * unary_function(Vector) */ #define TVMET_DECLARE_MACRO(NAME) \ -template \ +template \ XprVector< \ XprUnOp< \ Fcnl_##NAME, \ @@ -95,7 +95,7 @@ TVMET_DECLARE_MACRO(finite) */ #if defined(TVMET_HAVE_COMPLEX) #define TVMET_DECLARE_MACRO(NAME) \ -template \ +template \ XprVector< \ XprUnOp< \ Fcnl_##NAME< std::complex >, \ @@ -125,7 +125,7 @@ TVMET_DECLARE_MACRO(conj) * unary_function(Vector) */ #define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ +template \ inline \ XprVector< \ XprUnOp< \ @@ -192,7 +192,7 @@ TVMET_IMPLEMENT_MACRO(finite) */ #if defined(TVMET_HAVE_COMPLEX) #define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ +template \ inline \ XprVector< \ XprUnOp< \ diff --git a/tvmet-1.7.1/include/tvmet/config/config-vc71.h b/tvmet-1.7.1/include/tvmet/config/config-vc71.h index b86ad9db6..d79b2fbe3 100644 --- a/tvmet-1.7.1/include/tvmet/config/config-vc71.h +++ b/tvmet-1.7.1/include/tvmet/config/config-vc71.h @@ -220,7 +220,7 @@ #endif /* Define to `unsigned' if does not define. */ -/* #undef _tvmet_size_t */ +/* #undef _tvmet_int */ diff --git a/tvmet-1.7.1/include/tvmet/config/config-vc71.h.in b/tvmet-1.7.1/include/tvmet/config/config-vc71.h.in index e05099984..cf6218a42 100644 --- a/tvmet-1.7.1/include/tvmet/config/config-vc71.h.in +++ b/tvmet-1.7.1/include/tvmet/config/config-vc71.h.in @@ -220,7 +220,7 @@ #endif /* Define to `unsigned' if does not define. */ -/* #undef _tvmet_size_t */ +/* #undef _tvmet_int */ diff --git a/tvmet-1.7.1/include/tvmet/loop/Gemm.h b/tvmet-1.7.1/include/tvmet/loop/Gemm.h index 8d8825aab..41ec66a64 100644 --- a/tvmet-1.7.1/include/tvmet/loop/Gemm.h +++ b/tvmet-1.7.1/include/tvmet/loop/Gemm.h @@ -38,14 +38,14 @@ namespace loop { * \f] * \par Example: * \code - * template + * template * inline * void * prod(const Matrix& lhs, const Matrix& rhs, * Matrix& dest) * { - * for (std::size_t i = 0; i != Rows1; ++i) { - * for (std::size_t j = 0; j != Cols2; ++j) { + * for (int i = 0; i != Rows1; ++i) { + * for (int j = 0; j != Cols2; ++j) { * dest(i, j) = tvmet::loop::gemm().prod(lhs, rhs, i, j); * } * } @@ -54,8 +54,8 @@ namespace loop { * \note The number of rows of rhs matrix have to be equal to cols of lhs matrix. * The result is a (Rows1 x Cols2) matrix. */ -template +template class gemm { gemm(const gemm&); @@ -77,13 +77,13 @@ public: typename E1::value_type, typename E2::value_type >::value_type - prod(const E1& lhs, const E2& rhs, std::size_t i, std::size_t j) { + prod(const E1& lhs, const E2& rhs, int i, int j) { typename PromoteTraits< typename E1::value_type, typename E2::value_type >::value_type sum(0); - std::size_t k(0); - std::size_t n(N); + int k(0); + int n(N); // Duff's device switch(count % 8) { diff --git a/tvmet-1.7.1/include/tvmet/loop/Gemmt.h b/tvmet-1.7.1/include/tvmet/loop/Gemmt.h index 90e3382dd..045773072 100644 --- a/tvmet-1.7.1/include/tvmet/loop/Gemmt.h +++ b/tvmet-1.7.1/include/tvmet/loop/Gemmt.h @@ -38,14 +38,14 @@ namespace loop { * \f] * \par Example: * \code - * template + * template * inline * void * prod(const Matrix& lhs, const Matrix& rhs, * Matrix& dest) * { - * for (std::size_t i = 0; i != Rows1; ++i) { - * for (std::size_t j = 0; j != Rows2; ++j) { + * for (int i = 0; i != Rows1; ++i) { + * for (int j = 0; j != Rows2; ++j) { * dest(i, j) = tvmet::loop::gemmt().prod(lhs, rhs, i, j); * } * } @@ -54,8 +54,8 @@ namespace loop { * \note The number of cols of rhs matrix have to be equal to cols of rhs matrix. * The result is a (Rows1 x Rows2) matrix. */ -template +template class gemmt { gemmt(const gemmt&); @@ -77,13 +77,13 @@ public: typename E1::value_type, typename E2::value_type >::value_type - prod(const E1& lhs, const E2& rhs, std::size_t i, std::size_t j) { + prod(const E1& lhs, const E2& rhs, int i, int j) { typename PromoteTraits< typename E1::value_type, typename E2::value_type >::value_type sum(0); - std::size_t k(0); - std::size_t n(N); + int k(0); + int n(N); // Duff's device switch(count % 8) { diff --git a/tvmet-1.7.1/include/tvmet/loop/Gemtm.h b/tvmet-1.7.1/include/tvmet/loop/Gemtm.h index 797954e89..a91caa011 100644 --- a/tvmet-1.7.1/include/tvmet/loop/Gemtm.h +++ b/tvmet-1.7.1/include/tvmet/loop/Gemtm.h @@ -38,14 +38,14 @@ namespace loop { * \f] * \par Example: * \code - * template + * template * inline * void * prod(const Matrix& lhs, const Matrix& rhs, * Matrix& dest) * { - * for (std::size_t i = 0; i != Cols1; ++i) { - * for (std::size_t j = 0; j != Cols2; ++j) { + * for (int i = 0; i != Cols1; ++i) { + * for (int j = 0; j != Cols2; ++j) { * dest(i, j) = tvmet::loop::gemtm::prod(lhs, rhs, i, j); * } * } @@ -55,8 +55,8 @@ namespace loop { * since lhs matrix 1 is transposed. * The result is a (Cols1 x Cols2) matrix. */ -template +template class gemtm { gemtm(const gemtm&); @@ -78,13 +78,13 @@ public: typename E1::value_type, typename E2::value_type >::value_type - prod(const E1& lhs, const E2& rhs, std::size_t i, std::size_t j) { + prod(const E1& lhs, const E2& rhs, int i, int j) { typename PromoteTraits< typename E1::value_type, typename E2::value_type >::value_type sum(0); - std::size_t k(0); - std::size_t n(N); + int k(0); + int n(N); // Duff's device switch(count % 8) { diff --git a/tvmet-1.7.1/include/tvmet/loop/Gemtv.h b/tvmet-1.7.1/include/tvmet/loop/Gemtv.h index 6c6037638..1584ab6a3 100644 --- a/tvmet-1.7.1/include/tvmet/loop/Gemtv.h +++ b/tvmet-1.7.1/include/tvmet/loop/Gemtv.h @@ -38,19 +38,19 @@ namespace loop { * \f] * \par Example: * \code - * template + * template * inline * void * prod(const Matrix& lhs, const Vector& rhs, * Vector& dest) * { - * for (std::size_t i = 0; i != Cols; ++i) { + * for (int i = 0; i != Cols; ++i) { * dest(i) = tvmet::loop::gemtv().prod(lhs, rhs, i); * } * } * \endcode */ -template +template class gemtv { gemtv(const gemtv&); @@ -72,13 +72,13 @@ public: typename E1::value_type, typename E2::value_type >::value_type - prod(const E1& lhs, const E2& rhs, std::size_t i) { + prod(const E1& lhs, const E2& rhs, int i) { typename PromoteTraits< typename E1::value_type, typename E2::value_type >::value_type sum(0); - std::size_t j(0); - std::size_t n(N); + int j(0); + int n(N); // Duff's device switch(count % 8) { diff --git a/tvmet-1.7.1/include/tvmet/loop/Gemv.h b/tvmet-1.7.1/include/tvmet/loop/Gemv.h index 85bbba263..01118a93d 100644 --- a/tvmet-1.7.1/include/tvmet/loop/Gemv.h +++ b/tvmet-1.7.1/include/tvmet/loop/Gemv.h @@ -38,19 +38,19 @@ namespace loop { * \f] * \par Example: * \code - * template + * template * inline * void * prod(const Matrix& lhs, const Vector& rhs, * Vector& dest) * { - * for (std::size_t i = 0; i != Rows; ++i) { + * for (int i = 0; i != Rows; ++i) { * dest(i) = tvmet::loop::gemv().prod(lhs, rhs, i); * } * } * \endcode */ -template +template class gemv { gemv(const gemv&); @@ -72,13 +72,13 @@ public: typename E1::value_type, typename E2::value_type >::value_type - prod(const E1& lhs, const E2& rhs, std::size_t i) { + prod(const E1& lhs, const E2& rhs, int i) { typename PromoteTraits< typename E1::value_type, typename E2::value_type >::value_type sum(0); - std::size_t j(0); - std::size_t n(N); + int j(0); + int n(N); // Duff's device switch(count % 8) { diff --git a/tvmet-1.7.1/include/tvmet/loop/Matrix.h b/tvmet-1.7.1/include/tvmet/loop/Matrix.h index c3da3b6de..beea9f5fe 100644 --- a/tvmet-1.7.1/include/tvmet/loop/Matrix.h +++ b/tvmet-1.7.1/include/tvmet/loop/Matrix.h @@ -33,7 +33,7 @@ namespace loop { * \class Matrix Matrix.h "tvmet/loop/Matrix.h" * \brief Loop %Matrix class using expression and loop templates. */ -template +template class Matrix { Matrix(const Matrix&); @@ -47,8 +47,8 @@ public: template static inline void assign(E1& lhs, const E2& rhs, const Assign& assign_fn) { - for(std::size_t i = 0; i != Rows; ++i) - for(std::size_t j = 0; j != Cols; ++j) + for(int i = 0; i != Rows; ++i) + for(int j = 0; j != Cols; ++j) assign_fn.apply_on(lhs(i, j), rhs(i, j)); } }; diff --git a/tvmet-1.7.1/include/tvmet/loop/Vector.h b/tvmet-1.7.1/include/tvmet/loop/Vector.h index 73bd641a2..5462ad7a1 100644 --- a/tvmet-1.7.1/include/tvmet/loop/Vector.h +++ b/tvmet-1.7.1/include/tvmet/loop/Vector.h @@ -33,7 +33,7 @@ namespace loop { * \class Vector Vector.h "tvmet/loop/Vector.h" * \brief Loop %Vector class using expression and loop templates. */ -template +template class Vector { Vector(const Vector&); @@ -47,7 +47,7 @@ public: template static inline void assign(E1& lhs, const E2& rhs, const Assign& assign_fn) { - for(std::size_t i = 0; i != Sz; ++i) + for(int i = 0; i != Sz; ++i) assign_fn.apply_on(lhs(i), rhs(i)); } }; diff --git a/tvmet-1.7.1/include/tvmet/meta/Gemm.h b/tvmet-1.7.1/include/tvmet/meta/Gemm.h index 8800d658e..7aad8e354 100644 --- a/tvmet-1.7.1/include/tvmet/meta/Gemm.h +++ b/tvmet-1.7.1/include/tvmet/meta/Gemm.h @@ -40,9 +40,9 @@ namespace meta { * \f] * \note The rows of matrix 2 have to be equal to cols of matrix 1. */ -template +template class gemm { gemm(); @@ -61,7 +61,7 @@ public: typename E1::value_type, typename E2::value_type >::value_type - prod(const E1& lhs, const E2& rhs, std::size_t i, std::size_t j) { + prod(const E1& lhs, const E2& rhs, int i, int j) { return lhs(i, K) * rhs(K, j) + gemm public: template static inline - XprNull prod(const E1&, const E2&, std::size_t, std::size_t) { + XprNull prod(const E1&, const E2&, int, int) { return XprNull(); } }; diff --git a/tvmet-1.7.1/include/tvmet/meta/Gemmt.h b/tvmet-1.7.1/include/tvmet/meta/Gemmt.h index d3c3d6283..a3669be5c 100644 --- a/tvmet-1.7.1/include/tvmet/meta/Gemmt.h +++ b/tvmet-1.7.1/include/tvmet/meta/Gemmt.h @@ -41,9 +41,9 @@ namespace meta { * \note The rows of matrix 2 have to be equal to cols of matrix 1. The result * is a rows1 * cols2 matrix. */ -template +template class gemmt { gemmt(); @@ -62,7 +62,7 @@ public: typename E1::value_type, typename E2::value_type >::value_type - prod(const E1& lhs, const E2& rhs, std::size_t i, std::size_t j) { + prod(const E1& lhs, const E2& rhs, int i, int j) { return lhs(i, K) * rhs(j, K) + gemmt public: template static inline - XprNull prod(const E1&, const E2&, std::size_t, std::size_t) { + XprNull prod(const E1&, const E2&, int, int) { return XprNull(); } }; diff --git a/tvmet-1.7.1/include/tvmet/meta/Gemtm.h b/tvmet-1.7.1/include/tvmet/meta/Gemtm.h index ddd8e38f2..815175d43 100644 --- a/tvmet-1.7.1/include/tvmet/meta/Gemtm.h +++ b/tvmet-1.7.1/include/tvmet/meta/Gemtm.h @@ -43,9 +43,9 @@ namespace meta { * matrix. */ -template +template class gemtm { private: @@ -65,7 +65,7 @@ public: typename E1::value_type, typename E2::value_type >::value_type - prod(const E1& lhs, const E2& rhs, std::size_t i, std::size_t j) { + prod(const E1& lhs, const E2& rhs, int i, int j) { return lhs(K, i) * rhs(K, j) + gemtm public: template static inline - XprNull prod(const E1&, const E2&, std::size_t, std::size_t) { + XprNull prod(const E1&, const E2&, int, int) { return XprNull(); } }; diff --git a/tvmet-1.7.1/include/tvmet/meta/Gemtv.h b/tvmet-1.7.1/include/tvmet/meta/Gemtv.h index dd463394a..93c333687 100644 --- a/tvmet-1.7.1/include/tvmet/meta/Gemtv.h +++ b/tvmet-1.7.1/include/tvmet/meta/Gemtv.h @@ -39,8 +39,8 @@ namespace meta { * M^T\,v * \f] */ -template +template class gemtv { gemtv(); @@ -60,7 +60,7 @@ public: typename E1::value_type, typename E2::value_type >::value_type - prod(const E1& lhs, const E2& rhs, std::size_t j) { + prod(const E1& lhs, const E2& rhs, int j) { return lhs(I, j) * rhs(I) + gemtv::prod(lhs, rhs, j); @@ -82,7 +82,7 @@ class gemtv<0,0,0> public: template static inline - XprNull prod(const E1&, const E2&, std::size_t) { + XprNull prod(const E1&, const E2&, int) { return XprNull(); } }; diff --git a/tvmet-1.7.1/include/tvmet/meta/Gemv.h b/tvmet-1.7.1/include/tvmet/meta/Gemv.h index ae18cf115..fda045f71 100644 --- a/tvmet-1.7.1/include/tvmet/meta/Gemv.h +++ b/tvmet-1.7.1/include/tvmet/meta/Gemv.h @@ -39,8 +39,8 @@ namespace meta { * M\,v * \f] */ -template +template class gemv { gemv(); @@ -60,7 +60,7 @@ public: typename E1::value_type, typename E2::value_type >::value_type - prod(const E1& lhs, const E2& rhs, std::size_t i) { + prod(const E1& lhs, const E2& rhs, int i) { return lhs(i, J) * rhs(J) + gemv::prod(lhs, rhs, i); @@ -82,7 +82,7 @@ class gemv<0,0,0> public: template static inline - XprNull prod(const E1&, const E2&, std::size_t) { + XprNull prod(const E1&, const E2&, int) { return XprNull(); } }; diff --git a/tvmet-1.7.1/include/tvmet/meta/Matrix.h b/tvmet-1.7.1/include/tvmet/meta/Matrix.h index c3ccd8e3e..0764c31da 100644 --- a/tvmet-1.7.1/include/tvmet/meta/Matrix.h +++ b/tvmet-1.7.1/include/tvmet/meta/Matrix.h @@ -36,8 +36,8 @@ namespace meta { * \class Matrix Matrix.h "tvmet/meta/Matrix.h" * \brief Meta %Matrix class using expression and meta templates. */ -template +template class Matrix { Matrix(); diff --git a/tvmet-1.7.1/include/tvmet/meta/Vector.h b/tvmet-1.7.1/include/tvmet/meta/Vector.h index c1189a45f..b9f2c9c63 100644 --- a/tvmet-1.7.1/include/tvmet/meta/Vector.h +++ b/tvmet-1.7.1/include/tvmet/meta/Vector.h @@ -30,7 +30,7 @@ namespace tvmet { /* forwards */ -template class Vector; +template class Vector; namespace meta { @@ -40,7 +40,7 @@ namespace meta { * \class Vector Vector.h "tvmet/meta/Vector.h" * \brief Meta %Vector class using expression templates */ -template +template class Vector { Vector(); diff --git a/tvmet-1.7.1/include/tvmet/util/General.h b/tvmet-1.7.1/include/tvmet/util/General.h index 29454a00f..f6247d4b8 100644 --- a/tvmet-1.7.1/include/tvmet/util/General.h +++ b/tvmet-1.7.1/include/tvmet/util/General.h @@ -27,8 +27,8 @@ /** forward */ namespace tvmet { -template class Matrix; -template class Vector; +template class Matrix; +template class Vector; } namespace tvmet { @@ -45,16 +45,16 @@ namespace util { * \brief General matrix matrix multiplication using loops. * \ingroup _util_function */ -template +template inline void Gemm(const Matrix& m1, const Matrix& m2, Matrix& m3) { - for (std::size_t i = 0; i < Rows; ++i) { - for (std::size_t j = 0; j < Cols; ++j) { + for (int i = 0; i < Rows; ++i) { + for (int j = 0; j < Cols; ++j) { T sum(0); - for (std::size_t k = 0; k < Cols; ++k) { + for (int k = 0; k < Cols; ++k) { sum += m1(i,k) * m2(k,j); } m3(i,j) = sum; @@ -68,15 +68,15 @@ Gemm(const Matrix& m1, const Matrix& m2, * \brief General matrix vector multiplication using loops. * \ingroup _util_function */ -template +template inline void Gemv(const Matrix& m, const Vector& v, Vector& v2) { - for (std::size_t i = 0; i < Rows; ++i){ + for (int i = 0; i < Rows; ++i){ v2(i) = T(0); // clean up before use - for (std::size_t j = 0; j < Cols; ++j) { + for (int j = 0; j < Cols; ++j) { v2(i) += m(i,j) * v(j); } } @@ -88,13 +88,13 @@ Gemv(const Matrix& m, const Vector& v, * \brief General vector vector elementwise multiplication using loop. * \ingroup _util_function */ -template +template inline void Gevvmul(const Vector& v1, const Vector& v2, Vector& v3) { - for(std::size_t i = 0; i < Sz; ++i) + for(int i = 0; i < Sz; ++i) v3(i) = v1(i) * v2(i); } @@ -104,13 +104,13 @@ Gevvmul(const Vector& v1, const Vector& v2, * \brief General vector vector elementwise multiplication using loop. * \ingroup _util_function */ -template +template inline void Gevvadd(const Vector& v1, const Vector& v2, Vector& v3) { - for(std::size_t i = 0; i < Sz; ++i) + for(int i = 0; i < Sz; ++i) v3(i) = v1(i) + v2(i); } diff --git a/tvmet-1.7.1/include/tvmet/xpr/BinOperator.h b/tvmet-1.7.1/include/tvmet/xpr/BinOperator.h index 8efca3249..11ade5eb3 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/BinOperator.h +++ b/tvmet-1.7.1/include/tvmet/xpr/BinOperator.h @@ -68,17 +68,17 @@ public: #endif /** Index operator, evaluates the expression inside. */ - value_type operator()(std::size_t i) const { + value_type operator()(int i) const { return BinOp::apply_on(m_lhs(i), m_rhs(i)); } /** Index operator for arrays/matrices */ - value_type operator()(std::size_t i, std::size_t j) const { + value_type operator()(int i, int j) const { return BinOp::apply_on(m_lhs(i, j), m_rhs(i, 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++) << "XprBinOp[O="<< ops << ", (O1=" << ops_lhs << ", O2=" << ops_rhs << ")]<" << std::endl; diff --git a/tvmet-1.7.1/include/tvmet/xpr/Eval.h b/tvmet-1.7.1/include/tvmet/xpr/Eval.h index edd68f338..7ed92161b 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/Eval.h +++ b/tvmet-1.7.1/include/tvmet/xpr/Eval.h @@ -77,17 +77,17 @@ public: public: //access /** index operator for vectors. */ - value_type operator()(std::size_t i) const { + value_type operator()(int i) const { return m_expr1(i) ? m_expr2(i) : m_expr3(i); } /** index operator for matrizes. */ - value_type operator()(std::size_t i, std::size_t j) const { + value_type operator()(int i, int j) const { return m_expr1(i, j) ? m_expr2(i, j) : m_expr3(i, 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++) << "XprEval[" << ops << ", (" << ops_expr1 << ", " << ops_expr2 << ", " << ops_expr3 << ")]<" diff --git a/tvmet-1.7.1/include/tvmet/xpr/Identity.h b/tvmet-1.7.1/include/tvmet/xpr/Identity.h index 3e7113f1e..7b13fa6b6 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/Identity.h +++ b/tvmet-1.7.1/include/tvmet/xpr/Identity.h @@ -20,7 +20,7 @@ namespace tvmet { * \since release 1.6.0 * \sa identity */ -template +template struct XprIdentity : public TvmetBase< XprIdentity > { @@ -38,12 +38,12 @@ public: public: /** access by index. */ - value_type operator()(std::size_t i, std::size_t j) const { + value_type operator()(int i, int j) const { return i==j ? 1 : 0; } 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++) << "XprIdentity[O="<< ops << ")]<" << std::endl; diff --git a/tvmet-1.7.1/include/tvmet/xpr/Literal.h b/tvmet-1.7.1/include/tvmet/xpr/Literal.h index f88f0ac03..85d9c79c0 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/Literal.h +++ b/tvmet-1.7.1/include/tvmet/xpr/Literal.h @@ -63,13 +63,13 @@ public: #endif /** Index operator, gives the value for vectors. */ - value_type operator()(std::size_t) const { return m_data; } + value_type operator()(int) const { return m_data; } /** Index operator for arrays/matrices. */ - value_type operator()(std::size_t, std::size_t) const { return m_data; } + value_type operator()(int, int) const { return m_data; } 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++) << "XprLiteral[O=" << ops << "]," << std::endl; diff --git a/tvmet-1.7.1/include/tvmet/xpr/MMProduct.h b/tvmet-1.7.1/include/tvmet/xpr/MMProduct.h index d11c4dca1..3b0df5f93 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/MMProduct.h +++ b/tvmet-1.7.1/include/tvmet/xpr/MMProduct.h @@ -39,8 +39,8 @@ namespace tvmet { * \f] * \note The Rows2 has to be equal to Cols1. */ -template +template class XprMMProduct : public TvmetBase< XprMMProduct > { @@ -83,7 +83,7 @@ public: private: /** Wrapper for meta gemm. */ static inline - value_type do_gemm(dispatch, const E1& lhs, const E2& rhs, std::size_t i, std::size_t j) { + value_type do_gemm(dispatch, const E1& lhs, const E2& rhs, int i, int j) { return meta::gemm::prod(lhs, rhs, i, j); @@ -91,19 +91,19 @@ private: /** Wrapper for loop gemm. */ static inline - value_type do_gemm(dispatch, const E1& lhs, const E2& rhs, std::size_t i, std::size_t j) { + value_type do_gemm(dispatch, const E1& lhs, const E2& rhs, int i, int j) { return loop::gemm::prod(lhs, rhs, i, j); } public: /** index operator for arrays/matrices */ - value_type operator()(std::size_t i, std::size_t j) const { + value_type operator()(int i, int j) const { TVMET_RT_CONDITION((i < Rows1) && (j < Cols2), "XprMMProduct Bounce Violation") return do_gemm(dispatch(), m_lhs, m_rhs, i, 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++) << "XprMMProduct[" << (use_meta ? "M" : "L") << ", O=" << ops diff --git a/tvmet-1.7.1/include/tvmet/xpr/MMProductTransposed.h b/tvmet-1.7.1/include/tvmet/xpr/MMProductTransposed.h index fcd864415..df5d04971 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/MMProductTransposed.h +++ b/tvmet-1.7.1/include/tvmet/xpr/MMProductTransposed.h @@ -40,8 +40,8 @@ namespace tvmet { * \note The Rows2 has to be equal to Cols1. * The result is a (Cols2 x Rows1) matrix. */ -template +template class XprMMProductTransposed : public TvmetBase< XprMMProductTransposed > { @@ -83,7 +83,7 @@ public: private: /** Wrapper for meta gemm. */ static inline - value_type do_gemm(dispatch, const E1& lhs, const E2& rhs, std::size_t i, std::size_t j) { + value_type do_gemm(dispatch, const E1& lhs, const E2& rhs, int i, int j) { return meta::gemm::prod(lhs, rhs, i, j); @@ -91,19 +91,19 @@ private: /** Wrapper for loop gemm. */ static inline - value_type do_gemm(dispatch, const E1& lhs, const E2& rhs, std::size_t i, std::size_t j) { + value_type do_gemm(dispatch, const E1& lhs, const E2& rhs, int i, int j) { return loop::gemm::prod(lhs, rhs, i, j); } public: /** index operator for arrays/matrices */ - value_type operator()(std::size_t i, std::size_t j) const { + value_type operator()(int i, int j) const { TVMET_RT_CONDITION((i < Cols2) && (j < Rows1), "XprMMProductTransposed Bounce Violation") return do_gemm(dispatch(), m_lhs, m_rhs, j, i); } 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++) << "XprMMProductTransposed[" << (use_meta ? "M" : "L") << ", O=" << ops diff --git a/tvmet-1.7.1/include/tvmet/xpr/MMtProduct.h b/tvmet-1.7.1/include/tvmet/xpr/MMtProduct.h index c2580ffbb..528eff78c 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/MMtProduct.h +++ b/tvmet-1.7.1/include/tvmet/xpr/MMtProduct.h @@ -40,8 +40,8 @@ namespace tvmet { * \note The number of cols of rhs matrix have to be equal to cols of rhs matrix. * The result is a (Rows1 x Rows2) matrix. */ -template +template class XprMMtProduct : public TvmetBase< XprMMtProduct > { @@ -85,7 +85,7 @@ public: private: /** Wrapper for meta gemm. */ static inline - value_type do_gemmt(dispatch, const E1& lhs, const E2& rhs, std::size_t i, std::size_t j) { + value_type do_gemmt(dispatch, const E1& lhs, const E2& rhs, int i, int j) { return meta::gemmt::prod(lhs, rhs, i, j); @@ -93,19 +93,19 @@ private: /** Wrapper for loop gemm. */ static inline - value_type do_gemmt(dispatch, const E1& lhs, const E2& rhs, std::size_t i, std::size_t j) { + value_type do_gemmt(dispatch, const E1& lhs, const E2& rhs, int i, int j) { return loop::gemmt::prod(lhs, rhs, i, j); } public: /** index operator for arrays/matrices */ - value_type operator()(std::size_t i, std::size_t j) const { + value_type operator()(int i, int j) const { TVMET_RT_CONDITION((i < Rows1) && (j < Rows2), "XprMMtProduct Bounce Violation") return do_gemmt(dispatch(), m_lhs, m_rhs, i, 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++) << "XprMMtProduct[" << (use_meta ? "M" : "L") << ", O=" << ops 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 XprMVProduct : public TvmetBase< XprMVProduct > @@ -81,27 +81,27 @@ public: private: /** Wrapper for meta gemm. */ static inline - value_type do_gemv(dispatch, const E1& lhs, const E2& rhs, std::size_t j) { + value_type do_gemv(dispatch, const E1& lhs, const E2& rhs, int j) { return meta::gemv::prod(lhs, rhs, j); } /** Wrapper for loop gemm. */ static inline - value_type do_gemv(dispatch, const E1& lhs, const E2& rhs, std::size_t j) { + value_type do_gemv(dispatch, const E1& lhs, const E2& rhs, int j) { return loop::gemv::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(), 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 diff --git a/tvmet-1.7.1/include/tvmet/xpr/Matrix.h b/tvmet-1.7.1/include/tvmet/xpr/Matrix.h index 928dab931..c31189c3d 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/Matrix.h +++ b/tvmet-1.7.1/include/tvmet/xpr/Matrix.h @@ -31,7 +31,7 @@ namespace tvmet { /* forwards */ -template class Matrix; +template class Matrix; /** * \class XprMatrix Matrix.h "tvmet/xpr/Matrix.h" @@ -46,7 +46,7 @@ template class Matrix; * actually implements the expression. * \note leave the CCtors non-explicit to allow implicit type conversation. */ -template +template class XprMatrix : public TvmetBase< XprMatrix > { @@ -86,7 +86,7 @@ public: #endif /** access by index. */ - value_type operator()(std::size_t i, std::size_t j) const { + value_type operator()(int i, int j) const { TVMET_RT_CONDITION((i < Rows) && (j < Cols), "XprMatrix Bounce Violation") return m_expr(i, j); } @@ -116,7 +116,7 @@ public: } 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++) << "XprMatrix[" << (use_meta ? "M" : "L") << ", O=" << ops << "]<" diff --git a/tvmet-1.7.1/include/tvmet/xpr/MatrixBinaryFunctions.h b/tvmet-1.7.1/include/tvmet/xpr/MatrixBinaryFunctions.h index 71dae56b6..69d742fac 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/MatrixBinaryFunctions.h +++ b/tvmet-1.7.1/include/tvmet/xpr/MatrixBinaryFunctions.h @@ -35,7 +35,7 @@ namespace tvmet { * binary_function(XprMatrix, XprMatrix) */ #define TVMET_DECLARE_MACRO(NAME) \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME, \ @@ -65,7 +65,7 @@ TVMET_DECLARE_MACRO(pow) * binary_function(XprMatrix, POD) */ #define TVMET_DECLARE_MACRO(NAME, TP) \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME, \ @@ -129,7 +129,7 @@ TVMET_DECLARE_MACRO(pow, long double) * binary_function(XprMatrix, std::complex<>) */ #define TVMET_DECLARE_MACRO(NAME) \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME >, \ @@ -164,7 +164,7 @@ TVMET_DECLARE_MACRO(yn) * binary_function(XprMatrix, XprMatrix) */ #define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -202,7 +202,7 @@ TVMET_IMPLEMENT_MACRO(pow) * binary_function(XprMatrix, POD) */ #define TVMET_IMPLEMENT_MACRO(NAME, TP) \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -274,7 +274,7 @@ TVMET_IMPLEMENT_MACRO(pow, long double) * binary_function(XprMatrix, std::complex<>) */ #define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ diff --git a/tvmet-1.7.1/include/tvmet/xpr/MatrixCol.h b/tvmet-1.7.1/include/tvmet/xpr/MatrixCol.h index 9d2214fb8..01153a2de 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/MatrixCol.h +++ b/tvmet-1.7.1/include/tvmet/xpr/MatrixCol.h @@ -31,7 +31,7 @@ namespace tvmet { * \class XprMatrixCol MatrixCol.h "tvmet/xpr/MatrixCol.h" * \brief Expression on matrix used for access on the column vector. */ -template +template class XprMatrixCol : public TvmetBase< XprMatrixCol > { @@ -50,7 +50,7 @@ public: public: /** Constructor. */ - explicit XprMatrixCol(const E& e, std::size_t no) + explicit XprMatrixCol(const E& e, int no) : m_expr(e), m_col(no) { TVMET_RT_CONDITION(no < Cols, "XprMatrixCol Bounce Violation") @@ -63,13 +63,13 @@ public: { } #endif - value_type operator()(std::size_t i) const { + value_type operator()(int i) const { TVMET_RT_CONDITION(i < Rows, "XprMatrixCol Bounce Violation") return m_expr(i, m_col); } 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++) << "XprMatrixCol[O=" << ops << ", (O=" << ops_expr << ")]<" << std::endl; @@ -82,7 +82,7 @@ public: // debugging Xpr parse tree private: const E m_expr; - const std::size_t m_col; + const int m_col; }; diff --git a/tvmet-1.7.1/include/tvmet/xpr/MatrixDiag.h b/tvmet-1.7.1/include/tvmet/xpr/MatrixDiag.h index 48f262c57..106478613 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/MatrixDiag.h +++ b/tvmet-1.7.1/include/tvmet/xpr/MatrixDiag.h @@ -31,7 +31,7 @@ namespace tvmet { * \class XprMatrixDiag MatrixDiag.h "tvmet/xpr/MatrixDiag.h" * \brief Expression on matrix used for access on the diagonal vector. */ -template +template class XprMatrixDiag : public TvmetBase< XprMatrixDiag > { @@ -62,13 +62,13 @@ public: #endif /** index operator for arrays/matrizes */ - value_type operator()(std::size_t i) const { + value_type operator()(int i) const { TVMET_RT_CONDITION(i < Sz, "XprMatrixDiag Bounce Violation") return m_expr(i, i); } 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++) << "XprMatrixDiag[O=" << ops << ", (O=" << ops_expr << ")]<" << std::endl; diff --git a/tvmet-1.7.1/include/tvmet/xpr/MatrixFunctions.h b/tvmet-1.7.1/include/tvmet/xpr/MatrixFunctions.h index 40a3bde1b..aae74512c 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/MatrixFunctions.h +++ b/tvmet-1.7.1/include/tvmet/xpr/MatrixFunctions.h @@ -28,13 +28,13 @@ namespace tvmet { /* forwards */ -template class Matrix; -template class Vector; -template class XprVector; +template class Matrix; +template class Vector; +template class XprVector; template class XprMatrixTranspose; -template class XprMatrixDiag; -template class XprMatrixRow; -template class XprMatrixCol; +template class XprMatrixDiag; +template class XprMatrixRow; +template class XprMatrixCol; /********************************************************* @@ -51,7 +51,7 @@ template class XprMatrixCol; * function(XprMatrix, XprMatrix) */ #define TVMET_DECLARE_MACRO(NAME) \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME, \ @@ -79,7 +79,7 @@ namespace element_wise { * Note: - operations +,-,*,/ are per se element wise */ #define TVMET_DECLARE_MACRO(NAME, POD) \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME, \ @@ -91,7 +91,7 @@ XprMatrix< \ NAME (const XprMatrix& lhs, \ POD rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME< POD, typename E::value_type>, \ @@ -143,7 +143,7 @@ TVMET_DECLARE_MACRO(div, long double) * \todo type promotion */ #define TVMET_DECLARE_MACRO(NAME) \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME >, \ @@ -155,7 +155,7 @@ XprMatrix< \ NAME (const XprMatrix& lhs, \ const std::complex& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME< std::complex, typename E::value_type>, \ @@ -182,8 +182,8 @@ TVMET_DECLARE_MACRO(div) *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -template +template XprMatrix< XprMMProduct< XprMatrix, Rows1, Cols1, // M1(Rows1, Cols1) @@ -195,8 +195,8 @@ prod(const XprMatrix& lhs, const XprMatrix& rhs) TVMET_CXX_ALWAYS_INLINE; -template +template XprMatrix< XprMMProductTransposed< XprMatrix, Rows1, Cols1, // M1(Rows1, Cols1) @@ -208,8 +208,8 @@ trans_prod(const XprMatrix& lhs, const XprMatrix& rhs) TVMET_CXX_ALWAYS_INLINE; -template // Rows2 = Rows1 +template // Rows2 = Rows1 XprMatrix< XprMtMProduct< XprMatrix, Rows1, Cols1, // M1(Rows1, Cols1) @@ -221,8 +221,8 @@ MtM_prod(const XprMatrix& lhs, const XprMatrix& rhs) TVMET_CXX_ALWAYS_INLINE; -template // Cols2 = Cols1 +template // Cols2 = Cols1 XprMatrix< XprMMtProduct< XprMatrix, Rows1, Cols1, // M1(Rows1, Cols1) @@ -239,7 +239,7 @@ MMt_prod(const XprMatrix& lhs, *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -template XprVector< XprMVProduct< @@ -257,7 +257,7 @@ prod(const XprMatrix& lhs, *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -template +template XprMatrix< XprMatrixTranspose< XprMatrix @@ -268,13 +268,13 @@ trans(const XprMatrix& rhs) TVMET_CXX_ALWAYS_INLINE; #if 0 // XXX needs declaration of meta::Matrix::trace -template +template typename NumericTraits::sum_type trace(const XprMatrix& m)TVMET_CXX_ALWAYS_INLINE; #endif -template +template XprVector< XprMatrixRow< XprMatrix, @@ -283,10 +283,10 @@ XprVector< Cols > row(const XprMatrix& m, - std::size_t no) TVMET_CXX_ALWAYS_INLINE; + int no) TVMET_CXX_ALWAYS_INLINE; -template +template XprVector< XprMatrixCol< XprMatrix, @@ -294,10 +294,10 @@ XprVector< >, Rows > -col(const XprMatrix& m, std::size_t no) TVMET_CXX_ALWAYS_INLINE; +col(const XprMatrix& m, int no) TVMET_CXX_ALWAYS_INLINE; -template +template XprVector< XprMatrixDiag< XprMatrix, @@ -322,7 +322,7 @@ diag(const XprMatrix& m) TVMET_CXX_ALWAYS_INLINE; * function(XprMatrix, XprMatrix) */ #define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -358,7 +358,7 @@ namespace element_wise { * Note: - operations +,-,*,/ are per se element wise */ #define TVMET_IMPLEMENT_MACRO(NAME, POD) \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -378,7 +378,7 @@ NAME (const XprMatrix& lhs, POD rhs) { \ expr_type(lhs, XprLiteral< POD >(rhs))); \ } \ \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -438,7 +438,7 @@ TVMET_IMPLEMENT_MACRO(div, long double) * \todo type promotion */ #define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -459,7 +459,7 @@ NAME (const XprMatrix& lhs, \ expr_type(lhs, XprLiteral< std::complex >(rhs))); \ } \ \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -505,8 +505,8 @@ TVMET_IMPLEMENT_MACRO(div) * \note The numer of Rows2 has to be equal to Cols1. * \ingroup _binary_function */ -template +template inline XprMatrix< XprMMProduct< @@ -534,8 +534,8 @@ prod(const XprMatrix& lhs, const XprMatrix& * \note The numer of Rows2 has to be equal to Cols1. * \ingroup _binary_function */ -template +template inline XprMatrix< XprMMProductTransposed< @@ -565,8 +565,8 @@ trans_prod(const XprMatrix& lhs, const XprMatrix // Rows2 = Rows1 +template // Rows2 = Rows1 inline XprMatrix< XprMtMProduct< @@ -590,8 +590,8 @@ MtM_prod(const XprMatrix& lhs, const XprMatrix // Cols2 = Cols1 +template // Cols2 = Cols1 inline XprMatrix< XprMMtProduct< @@ -619,7 +619,7 @@ MMt_prod(const XprMatrix& lhs, const XprMatrix inline XprVector< @@ -648,7 +648,7 @@ prod(const XprMatrix& lhs, const XprVector& rhs) { * \brief Transpose an expression matrix. * \ingroup _unary_function */ -template +template inline XprMatrix< XprMatrixTranspose< @@ -675,7 +675,7 @@ trans(const XprMatrix& rhs) { * \sum_{k = 0}^{Sz-1} m(k, k) * \f] */ -template +template inline typename NumericTraits::sum_type trace(const XprMatrix& m) { @@ -685,11 +685,11 @@ trace(const XprMatrix& m) { /** - * \fn row(const XprMatrix& m, std::size_t no) + * \fn row(const XprMatrix& m, int no) * \brief Returns a row vector of the given matrix. * \ingroup _binary_function */ -template +template inline XprVector< XprMatrixRow< @@ -698,7 +698,7 @@ XprVector< >, Cols > -row(const XprMatrix& m, std::size_t no) { +row(const XprMatrix& m, int no) { typedef XprMatrixRow< XprMatrix, Rows, Cols @@ -709,11 +709,11 @@ row(const XprMatrix& m, std::size_t no) { /** - * \fn col(const XprMatrix& m, std::size_t no) + * \fn col(const XprMatrix& m, int no) * \brief Returns a column vector of the given matrix. * \ingroup _binary_function */ -template +template inline XprVector< XprMatrixCol< @@ -722,7 +722,7 @@ XprVector< >, Rows > -col(const XprMatrix& m, std::size_t no) { +col(const XprMatrix& m, int no) { typedef XprMatrixCol< XprMatrix, Rows, Cols @@ -737,7 +737,7 @@ col(const XprMatrix& m, std::size_t no) { * \brief Returns the diagonal vector of the given square matrix. * \ingroup _unary_function */ -template +template inline XprVector< XprMatrixDiag< diff --git a/tvmet-1.7.1/include/tvmet/xpr/MatrixOperators.h b/tvmet-1.7.1/include/tvmet/xpr/MatrixOperators.h index 485f6e9df..5576860e9 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/MatrixOperators.h +++ b/tvmet-1.7.1/include/tvmet/xpr/MatrixOperators.h @@ -46,7 +46,7 @@ namespace tvmet { * size [varg]. */ #define TVMET_DECLARE_MACRO(NAME, OP) \ -template \ XprMatrix< \ XprBinOp< \ @@ -74,7 +74,7 @@ namespace element_wise { * Note: operations +,-,*,/ are per se element wise */ #define TVMET_DECLARE_MACRO(NAME, OP, POD) \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME, \ @@ -86,7 +86,7 @@ XprMatrix< \ operator OP (const XprMatrix& lhs, \ POD rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME, \ @@ -138,7 +138,7 @@ TVMET_DECLARE_MACRO(div, /, long double) * \todo type promotion */ #define TVMET_DECLARE_MACRO(NAME, OP) \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME >, \ @@ -150,7 +150,7 @@ XprMatrix< \ operator OP (const XprMatrix& lhs, \ const std::complex& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME, typename E::value_type>, \ @@ -183,8 +183,8 @@ TVMET_DECLARE_MACRO(div, /) * \ingroup _binary_operator * \sa prod(XprMatrix lhs, XprMatrix rhs) */ -template +template XprMatrix< XprMMProduct< XprMatrix, Rows1, Cols1, // M1(Rows1, Cols1) @@ -207,7 +207,7 @@ operator*(const XprMatrix& lhs, * \ingroup _binary_operator * \sa prod(XprMatrix lhs, XprVector rhs) */ -template XprVector< XprMVProduct< @@ -230,7 +230,7 @@ operator*(const XprMatrix& lhs, * Note: operations are per se element wise */ #define TVMET_DECLARE_MACRO(NAME, OP) \ -template \ XprMatrix< \ XprBinOp< \ @@ -275,7 +275,7 @@ TVMET_DECLARE_MACRO(or, ||) * \todo type promotion */ #define TVMET_DECLARE_MACRO(NAME, OP) \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME >, \ @@ -287,7 +287,7 @@ XprMatrix< \ operator OP (const XprMatrix& lhs, \ const std::complex& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME, typename E::value_type>, \ @@ -320,7 +320,7 @@ TVMET_DECLARE_MACRO(or, ||) * Note: operations are per se element wise */ #define TVMET_DECLARE_MACRO(NAME, OP, TP) \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME, \ @@ -332,7 +332,7 @@ XprMatrix< \ operator OP (const XprMatrix& lhs, \ TP rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprMatrix< \ XprBinOp< \ Fcnl_##NAME, \ @@ -431,7 +431,7 @@ TVMET_DECLARE_MACRO(or, ||, long double) * Note: per se element wise */ #define TVMET_DECLARE_MACRO(NAME, OP) \ -template \ +template \ XprMatrix< \ XprUnOp< \ Fcnl_##NAME, \ @@ -468,7 +468,7 @@ TVMET_DECLARE_MACRO(neg, -) * size [varg]. */ #define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template \ inline \ XprMatrix< \ @@ -499,7 +499,7 @@ namespace element_wise { * Note: operations +,-,*,/ are per se element wise */ #define TVMET_IMPLEMENT_MACRO(NAME, OP, POD) \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -513,7 +513,7 @@ operator OP (const XprMatrix& lhs, POD rhs) { \ return NAME (lhs, rhs); \ } \ \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -567,7 +567,7 @@ TVMET_IMPLEMENT_MACRO(div, /, long double) * \todo type promotion */ #define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -582,7 +582,7 @@ operator OP (const XprMatrix& lhs, \ return NAME (lhs, rhs); \ } \ \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -618,8 +618,8 @@ TVMET_IMPLEMENT_MACRO(div, /) * \ingroup _binary_operator * \sa prod(XprMatrix lhs, XprMatrix rhs) */ -template +template inline XprMatrix< XprMMProduct< @@ -644,7 +644,7 @@ operator*(const XprMatrix& lhs, const XprMatrix lhs, XprVector rhs) */ -template inline XprVector< @@ -669,7 +669,7 @@ operator*(const XprMatrix& lhs, const XprVector& rhs) * Note: operations are per se element wise */ #define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template \ inline \ XprMatrix< \ @@ -722,7 +722,7 @@ TVMET_IMPLEMENT_MACRO(or, ||) * \todo type promotion */ #define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -743,7 +743,7 @@ operator OP (const XprMatrix& lhs, \ expr_type(lhs, XprLiteral< std::complex >(rhs))); \ } \ \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -785,7 +785,7 @@ TVMET_IMPLEMENT_MACRO(or, ||) * Note: operations are per se element wise */ #define TVMET_IMPLEMENT_MACRO(NAME, OP, TP) \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -805,7 +805,7 @@ operator OP (const XprMatrix& lhs, TP rhs) { \ expr_type(lhs, XprLiteral< TP >(rhs))); \ } \ \ -template \ +template \ inline \ XprMatrix< \ XprBinOp< \ @@ -913,7 +913,7 @@ TVMET_IMPLEMENT_MACRO(or, ||, long double) * Note: per se element wise */ #define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template \ +template \ inline \ XprMatrix< \ XprUnOp< \ diff --git a/tvmet-1.7.1/include/tvmet/xpr/MatrixRow.h b/tvmet-1.7.1/include/tvmet/xpr/MatrixRow.h index d79d8f462..8da0bbb0b 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/MatrixRow.h +++ b/tvmet-1.7.1/include/tvmet/xpr/MatrixRow.h @@ -31,7 +31,7 @@ namespace tvmet { * \class XprMatrixRow MatrixRow.h "tvmet/xpr/MatrixRow.h" * \brief Expression on matrix used for access on the row vector. */ -template +template class XprMatrixRow : public TvmetBase< XprMatrixRow > { @@ -50,7 +50,7 @@ public: public: /** Constructor. */ - explicit XprMatrixRow(const E& e, std::size_t no) + explicit XprMatrixRow(const E& e, int no) : m_expr(e), m_row(no) { TVMET_RT_CONDITION(no < Rows, "XprMatrixRow Bounce Violation") @@ -63,13 +63,13 @@ public: { } #endif - value_type operator()(std::size_t j) const { + value_type operator()(int j) const { TVMET_RT_CONDITION(j < Cols, "XprMatrixRow Bounce Violation") return m_expr(m_row, 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++) << "XprMatrixRow[O=" << ops << ", (O=" << ops_expr << ")]<" << std::endl; @@ -82,7 +82,7 @@ public: // debugging Xpr parse tree private: const E m_expr; - const std::size_t m_row; + const int m_row; }; diff --git a/tvmet-1.7.1/include/tvmet/xpr/MatrixTranspose.h b/tvmet-1.7.1/include/tvmet/xpr/MatrixTranspose.h index 87d4b9ce5..c51df513e 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/MatrixTranspose.h +++ b/tvmet-1.7.1/include/tvmet/xpr/MatrixTranspose.h @@ -62,10 +62,10 @@ public: /** index operator for arrays/matrices. This simple swap the index access for transpose. */ - value_type operator()(std::size_t i, std::size_t j) const { return m_expr(j, i); } + value_type operator()(int i, int j) const { return m_expr(j, i); } 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++) << "XprMatrixTranspose[O=" << ops << ", (O=" << ops_expr << ")]<" << std::endl; diff --git a/tvmet-1.7.1/include/tvmet/xpr/MatrixUnaryFunctions.h b/tvmet-1.7.1/include/tvmet/xpr/MatrixUnaryFunctions.h index b36b436fd..5a3a899ef 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/MatrixUnaryFunctions.h +++ b/tvmet-1.7.1/include/tvmet/xpr/MatrixUnaryFunctions.h @@ -36,7 +36,7 @@ namespace tvmet { * unary_function(XprMatrix) */ #define TVMET_DECLARE_MACRO(NAME) \ -template \ +template \ inline \ XprMatrix< \ XprUnOp< \ @@ -101,7 +101,7 @@ TVMET_DECLARE_MACRO(finite) * unary_function(XprMatrix) */ #define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ +template \ inline \ XprMatrix< \ XprUnOp< \ diff --git a/tvmet-1.7.1/include/tvmet/xpr/MtMProduct.h b/tvmet-1.7.1/include/tvmet/xpr/MtMProduct.h index e462b0b9f..733ec9817 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/MtMProduct.h +++ b/tvmet-1.7.1/include/tvmet/xpr/MtMProduct.h @@ -41,8 +41,8 @@ namespace tvmet { * since lhs matrix 1 is transposed. * The result is a (Cols1 x Cols2) matrix. */ -template +template class XprMtMProduct : public TvmetBase< XprMtMProduct > { @@ -84,7 +84,7 @@ public: private: /** Wrapper for meta gemm. */ static inline - value_type do_gemtm(dispatch, const E1& lhs, const E2& rhs, std::size_t i, std::size_t j) { + value_type do_gemtm(dispatch, const E1& lhs, const E2& rhs, int i, int j) { return meta::gemtm::prod(lhs, rhs, i, j); @@ -92,20 +92,20 @@ private: /** Wrapper for loop gemm. */ static inline - value_type do_gemtm(dispatch, const E1& lhs, const E2& rhs, std::size_t i, std::size_t j) { + value_type do_gemtm(dispatch, const E1& lhs, const E2& rhs, int i, int j) { return loop::gemtm::prod(lhs, rhs, i, j); } public: /** index operator for arrays/matrices */ - value_type operator()(std::size_t i, std::size_t j) const { + value_type operator()(int i, int j) const { TVMET_RT_CONDITION((i < Cols1) && (j < Cols2), "XprMtMProduct Bounce Violation") return do_gemtm(dispatch(), m_lhs, m_rhs, i, 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++) << "XprMtMProduct[" << (use_meta ? "M" : "L") << ", O=" << ops diff --git a/tvmet-1.7.1/include/tvmet/xpr/MtVProduct.h b/tvmet-1.7.1/include/tvmet/xpr/MtVProduct.h index b33ffd2e9..2f592d8f3 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/MtVProduct.h +++ b/tvmet-1.7.1/include/tvmet/xpr/MtVProduct.h @@ -38,7 +38,7 @@ namespace tvmet { * M^T\,v * \f] */ -template class XprMtVProduct : public TvmetBase< XprMtVProduct > @@ -81,26 +81,26 @@ public: private: /** Wrapper for meta gemm. */ static inline - value_type do_gemtv(dispatch, const E1& lhs, const E2& rhs, std::size_t i) { + value_type do_gemtv(dispatch, const E1& lhs, const E2& rhs, int i) { return meta::gemtv::prod(lhs, rhs, i); } /** Wrapper for loop gemm. */ static inline - value_type do_gemtv(dispatch, const E1& lhs, const E2& rhs, std::size_t i) { + value_type do_gemtv(dispatch, const E1& lhs, const E2& rhs, int i) { return loop::gemtv::prod(lhs, rhs, i); } 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 < Cols , "XprMtVProduct Bounce Violation") return do_gemtv(dispatch(), 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++) << "XprMtVProduct[O=" << ops << ", (O1=" << ops_lhs << ", O2=" << ops_rhs << ")]<" << std::endl; diff --git a/tvmet-1.7.1/include/tvmet/xpr/Null.h b/tvmet-1.7.1/include/tvmet/xpr/Null.h index 2a752fb92..68396f445 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/Null.h +++ b/tvmet-1.7.1/include/tvmet/xpr/Null.h @@ -40,7 +40,7 @@ public: explicit XprNull() { } 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) << "XprNull[O=0]" << std::endl; } }; diff --git a/tvmet-1.7.1/include/tvmet/xpr/UnOperator.h b/tvmet-1.7.1/include/tvmet/xpr/UnOperator.h index a6b50ee06..3c4b87f49 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/UnOperator.h +++ b/tvmet-1.7.1/include/tvmet/xpr/UnOperator.h @@ -64,17 +64,17 @@ public: #endif /** Index operator, evaluates the expression inside. */ - value_type operator()(std::size_t i) const { + value_type operator()(int i) const { return UnOp::apply_on(m_expr(i)); } /** index operator for arrays/matrices. */ - value_type operator()(std::size_t i, std::size_t j) const { + value_type operator()(int i, int j) const { return UnOp::apply_on(m_expr(i, 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++) << "XprUnOp[O="<< ops << ", (O=" << ops_expr << ")]<" << std::endl; diff --git a/tvmet-1.7.1/include/tvmet/xpr/Vector.h b/tvmet-1.7.1/include/tvmet/xpr/Vector.h index b3c2e9a2d..6416c648a 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/Vector.h +++ b/tvmet-1.7.1/include/tvmet/xpr/Vector.h @@ -31,7 +31,7 @@ namespace tvmet { /* forwards */ -template class Vector; +template class Vector; /** * \class XprVector Vector.h "tvmet/xpr/Vector.h" @@ -46,7 +46,7 @@ template class Vector; * actually implements the expression. * \note leave the Ctors non-explicit to allow implicit type conversation. */ -template +template class XprVector : public TvmetBase< XprVector > { XprVector(); @@ -83,13 +83,13 @@ public: #endif /** const index operator for vectors. */ - value_type operator()(std::size_t i) const { + value_type operator()(int i) const { TVMET_RT_CONDITION(i < Size, "XprVector Bounce Violation") return m_expr(i); } /** const index operator for vectors. */ - value_type operator[](std::size_t i) const { + value_type operator[](int i) const { return this->operator()(i); } @@ -118,7 +118,7 @@ public: } 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++) << "XprVector[" << (use_meta ? "M" : "L") << ", O=" << ops << "]<" diff --git a/tvmet-1.7.1/include/tvmet/xpr/VectorBinaryFunctions.h b/tvmet-1.7.1/include/tvmet/xpr/VectorBinaryFunctions.h index 1f39adf85..86419515f 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/VectorBinaryFunctions.h +++ b/tvmet-1.7.1/include/tvmet/xpr/VectorBinaryFunctions.h @@ -36,7 +36,7 @@ namespace tvmet { * binary_function(XprVector, XprVector) */ #define TVMET_DECLARE_MACRO(NAME) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -67,7 +67,7 @@ TVMET_DECLARE_MACRO(polar) * binary_function(XprVector, POD) */ #define TVMET_DECLARE_MACRO(NAME, TP) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -132,7 +132,7 @@ TVMET_DECLARE_MACRO(pow, long double) * binary_function(XprVector, std::complex<>) */ #define TVMET_DECLARE_MACRO(NAME) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -167,7 +167,7 @@ TVMET_DECLARE_MACRO(pow) * binary_function(XprVector, XprVector) */ #define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -205,7 +205,7 @@ TVMET_IMPLEMENT_MACRO(polar) * binary_function(XprVector, POD) */ #define TVMET_IMPLEMENT_MACRO(NAME, TP) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -277,7 +277,7 @@ TVMET_IMPLEMENT_MACRO(pow, long double) * binary_function(XprVector, std::complex<>) */ #define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ diff --git a/tvmet-1.7.1/include/tvmet/xpr/VectorFunctions.h b/tvmet-1.7.1/include/tvmet/xpr/VectorFunctions.h index c4516cde5..e108d7af2 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/VectorFunctions.h +++ b/tvmet-1.7.1/include/tvmet/xpr/VectorFunctions.h @@ -28,7 +28,7 @@ namespace tvmet { /* forwards */ -template class Vector; +template class Vector; /********************************************************* @@ -45,7 +45,7 @@ template class Vector; * function(XprVector, XprVector) */ #define TVMET_DECLARE_MACRO(NAME) \ -template \ +template \ XprVector< \ XprBinOp< \ Fcnl_##NAME, \ @@ -73,7 +73,7 @@ namespace element_wise { * Note: - operations +,-,*,/ are per se element wise */ #define TVMET_DECLARE_MACRO(NAME, POD) \ -template \ +template \ XprVector< \ XprBinOp< \ Fcnl_##NAME< typename E::value_type, POD >, \ @@ -85,7 +85,7 @@ XprVector< \ NAME (const XprVector& lhs, \ POD rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprVector< \ XprBinOp< \ Fcnl_##NAME< POD, typename E::value_type>, \ @@ -137,7 +137,7 @@ TVMET_DECLARE_MACRO(div, long double) * \todo type promotion */ #define TVMET_DECLARE_MACRO(NAME) \ -template \ +template \ XprVector< \ XprBinOp< \ Fcnl_##NAME< typename E::value_type, std::complex >, \ @@ -149,7 +149,7 @@ XprVector< \ NAME (const XprVector& lhs, \ const std::complex& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ XprVector< \ XprBinOp< \ Fcnl_##NAME< std::complex, typename E::value_type>, \ @@ -176,17 +176,17 @@ TVMET_DECLARE_MACRO(div) *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -template +template typename NumericTraits::sum_type sum(const XprVector& v) TVMET_CXX_ALWAYS_INLINE; -template +template typename NumericTraits::sum_type product(const XprVector& v) TVMET_CXX_ALWAYS_INLINE; -template +template typename PromoteTraits< typename E1::value_type, typename E2::value_type @@ -195,13 +195,13 @@ dot(const XprVector& lhs, const XprVector& rhs) TVMET_CXX_ALWAYS_INLINE; -template +template typename PromoteTraits::value_type dot(const Vector& lhs, const XprVector& rhs) TVMET_CXX_ALWAYS_INLINE; -template +template typename PromoteTraits::value_type dot(const XprVector& lhs, const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; @@ -233,17 +233,17 @@ cross(const XprVector& lhs, const Vector& rhs) TVMET_CXX_ALWAYS_INLINE; -template +template typename NumericTraits::sum_type norm1(const XprVector& v) TVMET_CXX_ALWAYS_INLINE; -template +template typename NumericTraits::sum_type norm2(const XprVector& v) TVMET_CXX_ALWAYS_INLINE; -template +template XprVector< XprBinOp< Fcnl_div, @@ -264,7 +264,7 @@ normalize(const XprVector& v) TVMET_CXX_ALWAYS_INLINE; * function(XprVector, XprVector) */ #define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -299,7 +299,7 @@ namespace element_wise { * Note: - operations +,-,*,/ are per se element wise */ #define TVMET_IMPLEMENT_MACRO(NAME, POD) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -319,7 +319,7 @@ NAME (const XprVector& lhs, POD rhs) { \ expr_type(lhs, XprLiteral< POD >(rhs))); \ } \ \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -379,7 +379,7 @@ TVMET_IMPLEMENT_MACRO(div, long double) * \todo type promotion */ #define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -399,7 +399,7 @@ NAME (const XprVector& lhs, const std::complex& rhs) { \ expr_type(lhs, XprLiteral< std::complex >(rhs))); \ } \ \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -444,7 +444,7 @@ TVMET_IMPLEMENT_MACRO(div) * \sum_{i = 0}^{Sz-1} v[i] * \f] */ -template +template inline typename NumericTraits::sum_type sum(const XprVector& v) { @@ -462,7 +462,7 @@ sum(const XprVector& v) { * \prod_{i = 0}^{Sz - 1} v[i] * \f] */ -template +template inline typename NumericTraits::sum_type product(const XprVector& v) { @@ -482,7 +482,7 @@ product(const XprVector& v) { * where lhs is a column vector and rhs is a row vector, both vectors * have the same dimension. */ -template +template inline typename PromoteTraits< typename E1::value_type, @@ -505,7 +505,7 @@ dot(const XprVector& lhs, const XprVector& rhs) { * where lhs is a column vector and rhs is a row vector, both vectors * have the same dimension. */ -template +template inline typename PromoteTraits::value_type dot(const Vector& lhs, const XprVector& rhs) { @@ -525,7 +525,7 @@ dot(const Vector& lhs, const XprVector& rhs) { * where lhs is a column vector and rhs is a row vector, both vectors * have the same dimension. */ -template +template inline typename PromoteTraits::value_type dot(const XprVector& lhs, const Vector& rhs) { @@ -611,7 +611,7 @@ cross(const Vector& lhs, const XprVector& rhs) { * |Vector v| = |v| = \sum_{i=0}^{Sz-1}\,|v[i]| * \f] */ -template +template inline typename NumericTraits::sum_type norm1(const XprVector& v) { @@ -632,7 +632,7 @@ norm1(const XprVector& v) { * * \note The internal cast for Vector avoids warnings on sqrt. */ -template +template inline typename NumericTraits::sum_type norm2(const XprVector& v) { @@ -652,7 +652,7 @@ norm2(const XprVector& v) { * \frac{Vector v}{\sqrt{ \sum_{i=0}^{Sz-1}\,v[i]^2 }} * \f] */ -template +template inline XprVector< XprBinOp< diff --git a/tvmet-1.7.1/include/tvmet/xpr/VectorOperators.h b/tvmet-1.7.1/include/tvmet/xpr/VectorOperators.h index d0e613d90..673a1915c 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/VectorOperators.h +++ b/tvmet-1.7.1/include/tvmet/xpr/VectorOperators.h @@ -42,7 +42,7 @@ namespace tvmet { * operator(XprVector, XprVector) */ #define TVMET_DECLARE_MACRO(NAME, OP) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -71,7 +71,7 @@ namespace element_wise { * Note: operations +,-,*,/ are per se element wise */ #define TVMET_DECLARE_MACRO(NAME, OP, POD) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -84,7 +84,7 @@ XprVector< \ operator OP (const XprVector& lhs, \ POD rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -136,7 +136,7 @@ TVMET_DECLARE_MACRO(div, /, long double) * Note: operations +,-,*,/ are per se element wise */ #define TVMET_DECLARE_MACRO(NAME, OP) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -149,7 +149,7 @@ XprVector< \ operator OP (const XprVector& lhs, \ const std::complex& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -181,7 +181,7 @@ TVMET_DECLARE_MACRO(div, /) // per se element wise * operator(XprVector, XprVector) */ #define TVMET_DECLARE_MACRO(NAME, OP) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -223,7 +223,7 @@ TVMET_DECLARE_MACRO(or, ||) * Note: operations are per se element_wise */ #define TVMET_DECLARE_MACRO(NAME, OP, TP) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -236,7 +236,7 @@ XprVector< \ operator OP (const XprVector& lhs, \ TP rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -330,7 +330,7 @@ TVMET_DECLARE_MACRO(not_eq, !=, long double) * \todo type promotion */ #define TVMET_DECLARE_MACRO(NAME, OP) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -343,7 +343,7 @@ XprVector< \ operator OP (const XprVector& lhs, \ const std::complex& rhs) TVMET_CXX_ALWAYS_INLINE; \ \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -380,7 +380,7 @@ TVMET_DECLARE_MACRO(or, ||) * Unary Operator on XprVector */ #define TVMET_DECLARE_MACRO(NAME, OP) \ -template \ +template \ inline \ XprVector< \ XprUnOp< \ @@ -413,7 +413,7 @@ TVMET_DECLARE_MACRO(neg, -) * operator(XprVector, XprVector) */ #define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -444,7 +444,7 @@ namespace element_wise { * Note: operations +,-,*,/ are per se element wise */ #define TVMET_IMPLEMENT_MACRO(NAME, OP, POD) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -458,7 +458,7 @@ operator OP (const XprVector& lhs, POD rhs) { \ return NAME (lhs, rhs); \ } \ \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -511,7 +511,7 @@ TVMET_IMPLEMENT_MACRO(div, /, long double) * Note: operations +,-,*,/ are per se element wise */ #define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -526,7 +526,7 @@ operator OP (const XprVector& lhs, \ return NAME (lhs, rhs); \ } \ \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -560,7 +560,7 @@ TVMET_IMPLEMENT_MACRO(div, /) // per se element wise * operator(XprVector, XprVector) */ #define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -609,7 +609,7 @@ TVMET_IMPLEMENT_MACRO(or, ||) * Note: operations are per se element_wise */ #define TVMET_IMPLEMENT_MACRO(NAME, OP, TP) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -629,7 +629,7 @@ operator OP (const XprVector& lhs, TP rhs) { \ expr_type(lhs, XprLiteral< TP >(rhs))); \ } \ \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -730,7 +730,7 @@ TVMET_IMPLEMENT_MACRO(not_eq, !=, long double) * \todo type promotion */ #define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -751,7 +751,7 @@ operator OP (const XprVector& lhs, \ expr_type(lhs, XprLiteral< std::complex >(rhs))); \ } \ \ -template \ +template \ inline \ XprVector< \ XprBinOp< \ @@ -796,7 +796,7 @@ TVMET_IMPLEMENT_MACRO(or, ||) * Unary Operator on XprVector */ #define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template \ +template \ inline \ XprVector< \ XprUnOp< \ diff --git a/tvmet-1.7.1/include/tvmet/xpr/VectorUnaryFunctions.h b/tvmet-1.7.1/include/tvmet/xpr/VectorUnaryFunctions.h index 37bad0891..0f72eac16 100644 --- a/tvmet-1.7.1/include/tvmet/xpr/VectorUnaryFunctions.h +++ b/tvmet-1.7.1/include/tvmet/xpr/VectorUnaryFunctions.h @@ -35,7 +35,7 @@ namespace tvmet { * unary_function(XprVector) */ #define TVMET_DECLARE_MACRO(NAME) \ -template \ +template \ inline \ XprVector< \ XprUnOp< \ @@ -100,7 +100,7 @@ TVMET_DECLARE_MACRO(finite) * unary_function(XprVector) */ #define TVMET_IMPLEMENT_MACRO(NAME) \ -template \ +template \ inline \ XprVector< \ XprUnOp< \ diff --git a/tvmet-1.7.1/tests/swap.cc b/tvmet-1.7.1/tests/swap.cc index 8d4d01d3d..85003f2d1 100644 --- a/tvmet-1.7.1/tests/swap.cc +++ b/tvmet-1.7.1/tests/swap.cc @@ -16,7 +16,7 @@ using namespace std; NS_TVMET_BEGIN -template +template class MetaSwap // later, should be MetaVector { private: @@ -47,7 +47,7 @@ public: * \fun swap * \brief swaps to vector expressions XprVector */ -template +template inline void swap(XprVector e1, XprVector e2) { MetaSwap::swap(e1, e2); @@ -57,7 +57,7 @@ void swap(XprVector e1, XprVector e2) { * \fun swap * \brief swaps to vector */ -template +template inline void swap(Vector& lhs, Vector& rhs) { swap(lhs.asXpr(), rhs.asXpr()); @@ -68,11 +68,11 @@ void swap(Vector& lhs, Vector& rhs) { * \fun swap2 * \brief swaps to vector expressions XprVector */ -template +template inline void swap2(XprVector e1, XprVector e2) { // loops are faster than meta templates - for(size_t i = 0; i < Sz; ++i) + for(int i = 0; i < Sz; ++i) std::swap(e1[i], e2[i]); } @@ -80,11 +80,11 @@ void swap2(XprVector e1, XprVector e2) { * \fun swap2 * \brief swaps to vector */ -template +template inline void swap2(Vector& lhs, Vector& rhs) { // loops are faster than meta templates - for(size_t i = 0; i < Sz; ++i) + for(int i = 0; i < Sz; ++i) std::swap(lhs[i], rhs[i]); } @@ -126,11 +126,11 @@ int main() { cout << "\nSwap Vectors\n\n"; cout << v1 << endl; cout << v2 << endl; - for(size_t i = 0; i < LOOPS; ++i) + for(int i = 0; i < LOOPS; ++i) test_meta_swap(v1, v2); cout << v1 << endl; cout << v2 << endl; - for(size_t i = 0; i < LOOPS; ++i) + for(int i = 0; i < LOOPS; ++i) test_loop_swap(v1, v2); cout << v1 << endl; cout << v2 << endl; diff --git a/tvmet-1.7.1/tests/t.cc b/tvmet-1.7.1/tests/t.cc index 0f473e3cb..7c97618a1 100644 --- a/tvmet-1.7.1/tests/t.cc +++ b/tvmet-1.7.1/tests/t.cc @@ -7,7 +7,7 @@ using std::endl; struct separator { std::ostream& print_on(std::ostream& os) const { - for(std::size_t i = 0; i < 63; ++i) os << "-"; + for(int i = 0; i < 63; ++i) os << "-"; return os; } }; diff --git a/tvmet-1.7.1/testsuite/TestConstruction.h b/tvmet-1.7.1/testsuite/TestConstruction.h index 5e0342460..2df7be4b5 100644 --- a/tvmet-1.7.1/testsuite/TestConstruction.h +++ b/tvmet-1.7.1/testsuite/TestConstruction.h @@ -119,7 +119,7 @@ void TestConstruction::vector_ctor1() { T data[] = {1,2,3}; - std::size_t sz = sizeof(data)/sizeof(T); + int sz = sizeof(data)/sizeof(T); T* first = data; T* last = data + sz; @@ -129,14 +129,14 @@ TestConstruction::vector_ctor1() { } /* - * Vector (InputIterator first, std::size_t sz) + * Vector (InputIterator first, int sz) */ template void TestConstruction::vector_ctor2() { T data[] = {1,2,3}; - std::size_t sz = sizeof(data)/sizeof(T); + int sz = sizeof(data)/sizeof(T); T* first = data; vector_type v(first, sz); @@ -220,7 +220,7 @@ TestConstruction::matrix_ctor1() { 2,5,8, 3,6,9 }; - std::size_t sz = sizeof(data)/sizeof(T); + int sz = sizeof(data)/sizeof(T); T* first = data; T* last = data + sz; @@ -230,7 +230,7 @@ TestConstruction::matrix_ctor1() { } /* - * Matrix (InputIterator first, std::size_t sz) + * Matrix (InputIterator first, int sz) */ template void @@ -239,7 +239,7 @@ TestConstruction::matrix_ctor2() { 2,5,8, 3,6,9 }; - std::size_t sz = sizeof(data)/sizeof(T); + int sz = sizeof(data)/sizeof(T); T* first = data; matrix_type m(first, sz); diff --git a/tvmet-1.7.1/testsuite/TestUnloops.h b/tvmet-1.7.1/testsuite/TestUnloops.h index 36830dee5..1d021109d 100644 --- a/tvmet-1.7.1/testsuite/TestUnloops.h +++ b/tvmet-1.7.1/testsuite/TestUnloops.h @@ -110,9 +110,9 @@ void TestUnloops::mv_product(const LHS& A, const RHS& B, RES& X) { N = RHS::Size // is Vector }; - for (std::size_t i = 0; i < M; i++){ + for (int i = 0; i < M; i++){ value_type sum(0); - for (std::size_t j = 0; j < N; j++){ + for (int j = 0; j < N; j++){ sum += A(i, j) * B(j); } X(i) = sum; @@ -132,10 +132,10 @@ void TestUnloops::mm_product(const LHS& A, const RHS& B, RES& X) { K = RHS::Rows }; - for (std::size_t i = 0; i < M; ++i) { - for (std::size_t j = 0; j < N; ++j) { + for (int i = 0; i < M; ++i) { + for (int j = 0; j < N; ++j) { value_type sum(0); - for (std::size_t k = 0; k < K; ++k) { + for (int k = 0; k < K; ++k) { sum += A(i, k) * B(k, j); } X(i, j) = sum; @@ -156,10 +156,10 @@ void TestUnloops::mtm_product(const LHS& A, const RHS& B, RES& X) { K = RHS::Rows }; - for (std::size_t i = 0; i < N; i++){ - for (std::size_t j = 0; j < N; j++){ + for (int i = 0; i < N; i++){ + for (int j = 0; j < N; j++){ value_type sum(0); - for (std::size_t k = 0; k < K; k++){ + for (int k = 0; k < K; k++){ sum += A(k, i) * B(k, j); } X(i, j) = sum; @@ -180,10 +180,10 @@ void TestUnloops::mmt_product(const LHS& A, const RHS& B, RES& X) { K = LHS::Cols }; - for (std::size_t i = 0;i < N; i++){ - for (std::size_t j = 0;j < N; j++){ + for (int i = 0;i < N; i++){ + for (int j = 0;j < N; j++){ value_type sum(0); - for (std::size_t k = 0;k < N; k++){ + for (int k = 0;k < N; k++){ sum += A(i, k)*A(j, k); } X(i, j) = sum;