From d28ddd31bb6cebae019863d131725159ade6f30a Mon Sep 17 00:00:00 2001
From: Pratik Nayak <pratikvn@protonmail.com>
Date: Mon, 9 Oct 2023 23:12:59 +0200
Subject: [PATCH] Remove create_multivector_view

---
 core/matrix/batch_dense.cpp                | 32 ----------------------
 core/test/matrix/batch_dense.cpp           |  7 -----
 include/ginkgo/core/matrix/batch_dense.hpp | 20 ++------------
 3 files changed, 2 insertions(+), 57 deletions(-)

diff --git a/core/matrix/batch_dense.cpp b/core/matrix/batch_dense.cpp
index b948a2c3afc..da092a20229 100644
--- a/core/matrix/batch_dense.cpp
+++ b/core/matrix/batch_dense.cpp
@@ -64,38 +64,6 @@ GKO_REGISTER_OPERATION(advanced_apply, batch_dense::advanced_apply);
 }  // namespace dense
 
 
-template <typename ValueType>
-std::unique_ptr<gko::batch::MultiVector<ValueType>>
-Dense<ValueType>::create_multi_vector_view()
-{
-    auto exec = this->get_executor();
-    auto num_batch_items = this->get_num_batch_items();
-    auto num_rows = this->get_common_size()[0];
-    auto stride = this->get_common_size()[1];
-    auto mvec = MultiVector<ValueType>::create(
-        exec, this->get_size(),
-        make_array_view(exec, num_batch_items * num_rows * stride,
-                        this->get_values()));
-    return mvec;
-}
-
-
-template <typename ValueType>
-std::unique_ptr<const gko::batch::MultiVector<ValueType>>
-Dense<ValueType>::create_const_multi_vector_view() const
-{
-    auto exec = this->get_executor();
-    auto num_batch_items = this->get_num_batch_items();
-    auto num_rows = this->get_common_size()[0];
-    auto stride = this->get_common_size()[1];
-    auto mvec = MultiVector<ValueType>::create_const(
-        exec, this->get_size(),
-        make_const_array_view(exec, num_batch_items * num_rows * stride,
-                              this->get_const_values()));
-    return mvec;
-}
-
-
 template <typename ValueType>
 std::unique_ptr<gko::matrix::Dense<ValueType>>
 Dense<ValueType>::create_view_for_item(size_type item_id)
diff --git a/core/test/matrix/batch_dense.cpp b/core/test/matrix/batch_dense.cpp
index 36fc3f2ee4a..316312bd68f 100644
--- a/core/test/matrix/batch_dense.cpp
+++ b/core/test/matrix/batch_dense.cpp
@@ -138,13 +138,6 @@ TYPED_TEST(Dense, CanCreateDenseItemView)
 }
 
 
-TYPED_TEST(Dense, CanCreateMultiVectorView)
-{
-    GKO_ASSERT_BATCH_MTX_NEAR(this->mtx->create_multi_vector_view(), this->mvec,
-                              0.0);
-}
-
-
 TYPED_TEST(Dense, CanBeCopied)
 {
     auto mtx_copy = gko::batch::matrix::Dense<TypeParam>::create(this->exec);
diff --git a/include/ginkgo/core/matrix/batch_dense.hpp b/include/ginkgo/core/matrix/batch_dense.hpp
index 932c52edfc5..50f8fe39727 100644
--- a/include/ginkgo/core/matrix/batch_dense.hpp
+++ b/include/ginkgo/core/matrix/batch_dense.hpp
@@ -106,22 +106,6 @@ class Dense final : public EnableBatchLinOp<Dense<ValueType>>,
 
     void move_to(Dense<next_precision<ValueType>>* result) override;
 
-    /**
-     * Creates a mutable view (of MultiVector type) of the data owned by the
-     * matrix::Dense object. Does not perform any deep copies, but only
-     * returns a view of the underlying data.
-     *
-     * @return  a MultiVector object with a view of the data from the batch
-     * dense matrix.
-     */
-    std::unique_ptr<MultiVector<value_type>> create_multi_vector_view();
-
-    /**
-     * @copydoc create_const_multi_vector_view()
-     */
-    std::unique_ptr<const MultiVector<value_type>>
-    create_const_multi_vector_view() const;
-
     /**
      * Creates a mutable view (of gko::matrix::Dense type) of one item of the
      * batch::matrix::Dense<value_type> object. Does not perform any deep
@@ -234,8 +218,8 @@ class Dense final : public EnableBatchLinOp<Dense<ValueType>>,
      *       significantly more memory efficient than the non-constant version,
      *       so always prefer this version.
      */
-    const value_type* get_const_values_for_item(
-        size_type batch_id) const noexcept
+    const value_type* get_const_values_for_item(size_type batch_id) const
+        noexcept
     {
         GKO_ASSERT(batch_id < this->get_num_batch_items());
         return values_.get_const_data() +