--- /dev/null
+Fix: FullMatrix can now be packed into std::vector and unpacked from it using std::copy and the begin() and end() iterators
+<br>
+(Reza Rastak, 2019/05/24)
const value_type &
value() const;
+ /**
+ * Conversion operator that returns a constant reference to the element
+ */
+ operator const value_type &() const;
+
/**
* Return the row of the current entry.
*/
*/
value_type &
value() const;
+
+ /**
+ * Conversion operator that returns a reference to the element
+ */
+ operator value_type &();
};
/**
+ template <typename TableType, bool Constness, Storage storage_order>
+ inline AccessorBase<TableType, Constness, storage_order>::
+ operator const value_type &() const
+ {
+ assert_valid_linear_index();
+ return this->container->values[linear_index];
+ }
+
+
+
template <typename TableType, bool Constness, Storage storage_order>
inline typename AccessorBase<TableType, Constness, storage_order>::size_type
AccessorBase<TableType, Constness, storage_order>::row() const
+ template <typename TableType, Storage storage_order>
+ inline Accessor<TableType, false, storage_order>::operator value_type &()
+ {
+ this->assert_valid_linear_index();
+ return this->container->values[this->linear_index];
+ }
+
+
+
template <typename TableType, bool Constness, Storage storage_order>
inline Iterator<TableType, Constness, storage_order>::Iterator(
const Accessor<TableType, Constness, storage_order> &a)
--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2005 - 2018 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE.md at
+// the top level directory of deal.II.
+//
+// ---------------------------------------------------------------------
+
+// Copying from a matrix into std::vector and vice versa using iterators
+
+#include <deal.II/lac/full_matrix.h>
+
+#include "../tests.h"
+
+int
+main()
+{
+ initlog();
+
+ dealii::FullMatrix<double> A(3, 4);
+ std::iota(A.begin(), A.end(), 1.0);
+
+ deallog << "A =" << std::endl;
+ A.print(deallog);
+
+ std::vector<double> v(A.n_elements());
+ std::copy(A.begin(), A.end(), v.begin());
+ deallog << "v = " << std::endl;
+ deallog << v << std::endl;
+
+ dealii::FullMatrix<double> B(A.m(), A.n());
+ std::copy(v.cbegin(), v.cend(), B.begin());
+ deallog << "B =" << std::endl;
+ A.print(deallog);
+
+ return 0;
+}
\ No newline at end of file
--- /dev/null
+
+DEAL::A =
+DEAL::1.0 2.0 3.0 4.0
+DEAL::5.0 6.0 7.0 8.0
+DEAL::9.0 10. 11. 12.
+DEAL::v =
+DEAL::1.00000 2.00000 3.00000 4.00000 5.00000 6.00000 7.00000 8.00000 9.00000 10.0000 11.0000 12.0000
+DEAL::B =
+DEAL::1.0 2.0 3.0 4.0
+DEAL::5.0 6.0 7.0 8.0
+DEAL::9.0 10. 11. 12.