message: use as for copying and fix call to get_num_nonzeros
diff: #include "core/base/exception_helpers.hpp"
  +#include "core/base/executor.hpp"
  +#include "core/base/utils.hpp"
  namespace gko {
  @@ -11,24 +13,14 @@ namespace matrix {
  template <typename ValueType, typename IndexType>
  void Csr<ValueType, IndexType>::copy_from(const LinOp *other)
  {
  - auto convertible_to_csr =
  - dynamic_cast<const ConvertibleTo<Csr<ValueType, IndexType>> *>(other);
  - if (convertible_to_csr == nullptr) {
  - throw NOT_SUPPORTED(other);
  - }
  - convertible_to_csr->convert_to(this);
  + as<ConvertibleTo<Csr<ValueType, IndexType>>>(other)->convert_to(this);
  }
  template <typename ValueType, typename IndexType>
  void Csr<ValueType, IndexType>::copy_from(std::unique_ptr<LinOp> other)
  {
  - auto convertible_to_csr =
  - dynamic_cast<ConvertibleTo<Csr<ValueType, IndexType>> *>(other.get());
  - if (convertible_to_csr == nullptr) {
  - throw NOT_SUPPORTED(other);
  - }
  - convertible_to_csr->move_to(this);
  + as<ConvertibleTo<Csr<ValueType, IndexType>>>(other.get())->move_to(this);
  }
  @@ -70,7 +62,7 @@ template <typename ValueType, typename IndexType>
  void Csr<ValueType, IndexType>::convert_to(Csr *other) const
  {
  other->set_dimensions(this->get_num_rows(), this->get_num_cols(),
  - this->get_num_nonzeros());
  + this->get_num_stored_elements());
  other->values_ = values_;
  other->col_idxs_ = col_idxs_;
  other->row_ptrs_ = row_ptrs_;
  @@ -81,7 +73,7 @@ template <typename ValueType, typename IndexType>
  void Csr<ValueType, IndexType>::move_to(Csr *other)
  {
  other->set_dimensions(this->get_num_rows(), this->get_num_cols(),
  - this->get_num_nonzeros());
  + this->get_num_stored_elements());
  other->values_ = std::move(values_);
  other->col_idxs_ = std::move(col_idxs_);
  other->row_ptrs_ = std::move(row_ptrs_);
  