From ad6d09c610a89863c0030808a8cb95a134af7ce9 Mon Sep 17 00:00:00 2001 From: Tobias Leibner <tobias.leibner@googlemail.com> Date: Fri, 2 Nov 2018 14:19:33 +0100 Subject: [PATCH] [container] fix merge errors --- .gitsuper | 4 +-- dune/xt/la/algorithms/qr.hh | 1 - dune/xt/la/container/eigen/dense.hh | 7 +++-- dune/xt/la/container/eigen/sparse.hh | 39 ++++++++++++---------------- dune/xt/la/solver.hh | 14 +++++----- 5 files changed, 29 insertions(+), 36 deletions(-) diff --git a/.gitsuper b/.gitsuper index dda9fae06..67bc1d4b3 100644 --- a/.gitsuper +++ b/.gitsuper @@ -18,7 +18,7 @@ status = 1a3bcab04b011a5d6e44f9983cae6ff89fa695e8 bin (heads/master) 3e3f3bf06e21cbbf3c0a559891b44c6f5d987d0f dune-xt-data (heads/master) +c7f781a6ad3a5a98cf4228ae7e0e8062855be36b dune-xt-functions (heads/new-master) +de39cd531607388f0ff3b6887d381e6a4bab2207 dune-xt-grid (heads/new-master) - +6671bff784151981aec51f3f40b4f36167fbe6a8 dune-xt-la (heads/match-dune-gdt-refactor) + +efabd8b7931ae1b5a0af1450a13ddb19a19881a9 dune-xt-la (heads/match-dune-gdt-refactor) 09d0378f616b94d68bcdd9fc6114813181849ec0 scripts (heads/master) commit = 11b7c1b7e4cc360ec97f4f88684d02264f0e309a @@ -115,7 +115,7 @@ commit = de39cd531607388f0ff3b6887d381e6a4bab2207 [submodule.dune-xt-la] remote = git@github.com:dune-community/dune-xt-la.git status = 2424627f0ad5de7e4aaa5e7f48bc2a02414d95a1 .vcsetup (heads/master) -commit = 6671bff784151981aec51f3f40b4f36167fbe6a8 +commit = efabd8b7931ae1b5a0af1450a13ddb19a19881a9 [submodule.scripts] remote = https://github.com/wwu-numerik/scripts.git diff --git a/dune/xt/la/algorithms/qr.hh b/dune/xt/la/algorithms/qr.hh index 8e26cb65d..d30a1c3bc 100644 --- a/dune/xt/la/algorithms/qr.hh +++ b/dune/xt/la/algorithms/qr.hh @@ -377,7 +377,6 @@ private: static typename M::template MatrixTypeTemplate<M::static_rows, M::static_rows> calculate_q_explicitly(const MatrixType& QR, const VectorType& tau) { - using W = typename Common::VectorAbstraction<typename V::template VectorTypeTemplate<M::static_rows>>; const size_t num_rows = M::rows(QR); const size_t num_cols = M::cols(QR); auto ret = eye_matrix<typename M::template MatrixTypeTemplate<M::static_rows, M::static_rows>>( diff --git a/dune/xt/la/container/eigen/dense.hh b/dune/xt/la/container/eigen/dense.hh index 3615b00e7..fc32c11dd 100644 --- a/dune/xt/la/container/eigen/dense.hh +++ b/dune/xt/la/container/eigen/dense.hh @@ -298,8 +298,8 @@ public: EigenMappedDenseVector(const ThisType& other) : BaseType(other) { - backend_ = std::make_shared<BackendType>(new ScalarType[other.size()], - internal::boost_numeric_cast<EIGEN_size_t>(other.size())); + backend_ = + std::make_shared<BackendType>(new ScalarType[other.size()], Common::numeric_cast<EIGEN_size_t>(other.size())); backend_->operator=(other.backend()); } @@ -406,8 +406,7 @@ public: const size_t cc, const SparsityPatternDefault& /*pattern*/, const size_t num_mutexes = 1) - : backend_(new BackendType(internal::boost_numeric_cast<EIGEN_size_t>(rr), - internal::boost_numeric_cast<EIGEN_size_t>(cc))) + : backend_(new BackendType(Common::numeric_cast<EIGEN_size_t>(rr), Common::numeric_cast<EIGEN_size_t>(cc))) , mutexes_(std::make_unique<MutexesType>(num_mutexes)) { backend_->setZero(); diff --git a/dune/xt/la/container/eigen/sparse.hh b/dune/xt/la/container/eigen/sparse.hh index ffb5bc7f2..d1680c38e 100644 --- a/dune/xt/la/container/eigen/sparse.hh +++ b/dune/xt/la/container/eigen/sparse.hh @@ -108,8 +108,8 @@ public: const size_t cc, const SparsityPatternDefault& pattern_in, const size_t num_mutexes = 1) - : backend_(std::make_shared<BackendType>(internal::boost_numeric_cast<EIGEN_size_t>(rr), - internal::boost_numeric_cast<EIGEN_size_t>(cc))) + : backend_( + std::make_shared<BackendType>(Common::numeric_cast<EIGEN_size_t>(rr), Common::numeric_cast<EIGEN_size_t>(cc))) , mutexes_(std::make_unique<MutexesType>(num_mutexes)) { if (rr > 0 && cc > 0) { @@ -306,15 +306,13 @@ public: { internal::LockGuard DUNE_UNUSED(lock)(*mutexes_, ii, rows()); assert(these_are_valid_indices(ii, jj)); - backend().coeffRef(internal::boost_numeric_cast<EIGEN_size_t>(ii), - internal::boost_numeric_cast<EIGEN_size_t>(jj)) += value; + backend().coeffRef(Common::numeric_cast<EIGEN_size_t>(ii), Common::numeric_cast<EIGEN_size_t>(jj)) += value; } void set_entry(const size_t ii, const size_t jj, const ScalarType& value) { assert(these_are_valid_indices(ii, jj)); - backend().coeffRef(internal::boost_numeric_cast<EIGEN_size_t>(ii), internal::boost_numeric_cast<EIGEN_size_t>(jj)) = - value; + backend().coeffRef(Common::numeric_cast<EIGEN_size_t>(ii), Common::numeric_cast<EIGEN_size_t>(jj)) = value; } ScalarType get_entry(const size_t ii, const size_t jj) const @@ -329,7 +327,7 @@ public: if (ii >= rows()) DUNE_THROW(Common::Exceptions::index_out_of_range, "Given ii (" << ii << ") is larger than the rows of this (" << rows() << ")!"); - backend().row(internal::boost_numeric_cast<EIGEN_size_t>(ii)) *= ScalarType(0); + backend().row(Common::numeric_cast<EIGEN_size_t>(ii)) *= ScalarType(0); } void clear_col(const size_t jj) @@ -337,14 +335,13 @@ public: if (jj >= cols()) DUNE_THROW(Common::Exceptions::index_out_of_range, "Given jj (" << jj << ") is larger than the cols of this (" << cols() << ")!"); - for (size_t row = 0; internal::boost_numeric_cast<EIGEN_size_t>(row) < backend().outerSize(); ++row) { - for (typename BackendType::InnerIterator row_it(backend(), internal::boost_numeric_cast<EIGEN_size_t>(row)); - row_it; + for (size_t row = 0; Common::numeric_cast<EIGEN_size_t>(row) < backend().outerSize(); ++row) { + for (typename BackendType::InnerIterator row_it(backend(), Common::numeric_cast<EIGEN_size_t>(row)); row_it; ++row_it) { const size_t col = row_it.col(); if (col == jj) { - backend().coeffRef(internal::boost_numeric_cast<EIGEN_size_t>(row), - internal::boost_numeric_cast<EIGEN_size_t>(jj)) = ScalarType(0); + backend().coeffRef(Common::numeric_cast<EIGEN_size_t>(row), Common::numeric_cast<EIGEN_size_t>(jj)) = + ScalarType(0); break; } else if (col > jj) break; @@ -363,9 +360,8 @@ public: if (!these_are_valid_indices(ii, ii)) DUNE_THROW(Common::Exceptions::index_out_of_range, "Diagonal entry (" << ii << ", " << ii << ") is not contained in the sparsity pattern!"); - backend().row(internal::boost_numeric_cast<EIGEN_size_t>(ii)) *= ScalarType(0); - backend().coeffRef(internal::boost_numeric_cast<EIGEN_size_t>(ii), internal::boost_numeric_cast<EIGEN_size_t>(ii)) = - ScalarType(1); + backend().row(Common::numeric_cast<EIGEN_size_t>(ii)) *= ScalarType(0); + backend().coeffRef(Common::numeric_cast<EIGEN_size_t>(ii), Common::numeric_cast<EIGEN_size_t>(ii)) = ScalarType(1); } // ... unit_row(...) void unit_col(const size_t jj) @@ -376,18 +372,17 @@ public: if (jj >= rows()) DUNE_THROW(Common::Exceptions::index_out_of_range, "Given jj (" << jj << ") is larger than the rows of this (" << rows() << ")!"); - for (size_t row = 0; internal::boost_numeric_cast<EIGEN_size_t>(row) < backend().outerSize(); ++row) { - for (typename BackendType::InnerIterator row_it(backend(), internal::boost_numeric_cast<EIGEN_size_t>(row)); - row_it; + for (size_t row = 0; Common::numeric_cast<EIGEN_size_t>(row) < backend().outerSize(); ++row) { + for (typename BackendType::InnerIterator row_it(backend(), Common::numeric_cast<EIGEN_size_t>(row)); row_it; ++row_it) { const size_t col = row_it.col(); if (col == jj) { if (col == row) - backend().coeffRef(internal::boost_numeric_cast<EIGEN_size_t>(row), - internal::boost_numeric_cast<EIGEN_size_t>(col)) = ScalarType(1); + backend().coeffRef(Common::numeric_cast<EIGEN_size_t>(row), Common::numeric_cast<EIGEN_size_t>(col)) = + ScalarType(1); else - backend().coeffRef(internal::boost_numeric_cast<EIGEN_size_t>(row), - internal::boost_numeric_cast<EIGEN_size_t>(jj)) = ScalarType(0); + backend().coeffRef(Common::numeric_cast<EIGEN_size_t>(row), Common::numeric_cast<EIGEN_size_t>(jj)) = + ScalarType(0); break; } else if (col > jj) break; diff --git a/dune/xt/la/solver.hh b/dune/xt/la/solver.hh index 6b54f70b2..ef6683dfd 100644 --- a/dune/xt/la/solver.hh +++ b/dune/xt/la/solver.hh @@ -177,14 +177,14 @@ typename std::enable_if<is_matrix<M>::value, Solver<M>>::type make_solver(const //} -template <class M, class V> -typename VectorInterface<V>::derived_type -solve(const MatrixInterface<M>& A, - const VectorInterface<V>& b, - const Common::Configuration& opts = SolverOptions<typename MatrixInterface<M>::derived_type>::options()) +template <class M, class V, class S> +typename VectorInterface<V, S>::derived_type +solve(const MatrixInterface<M, S>& A, + const VectorInterface<V, S>& b, + const Common::Configuration& opts = SolverOptions<typename MatrixInterface<M, S>::derived_type>::options()) { - typename VectorInterface<V>::derived_type x(A.cols(), 0.); - Solver<typename MatrixInterface<M>::derived_type> solver(A.as_imp()); + typename VectorInterface<V, S>::derived_type x(A.cols(), 0.); + Solver<typename MatrixInterface<M, S>::derived_type> solver(A.as_imp()); solver.apply(b.as_imp(), x, opts); return x; } -- GitLab