message: provide initial guess for composition operators
diff: @@ -39,7 +39,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  #include <ginkgo/core/matrix/dense.hpp>
  +#include "core/components/fill_array.hpp"
  +
  +
  namespace gko {
  +namespace composition {
  +
  +
  +GKO_REGISTER_OPERATION(fill_array, components::fill_array);
  +
  +
  +} // namespace composition
  template <typename ValueType>
  @@ -77,7 +87,8 @@ std::unique_ptr<LinOp> apply_inner_operators(
  // swap in and out
  auto in = std::move(out);
  // build new intermediate vector
  - out_dim[0] = operators[i]->get_size()[0];
  + auto op_size = operators[i]->get_size();
  + out_dim[0] = op_size[0];
  auto out_size = out_dim[0] * num_rhs;
  auto out_data =
  data + (reversed_storage ? storage_size - out_size : size_type{});
  @@ -85,6 +96,17 @@ std::unique_ptr<LinOp> apply_inner_operators(
  out = Dense::create(exec, out_dim,
  Array<ValueType>::view(exec, out_size, out_data),
  num_rhs);
  + // for operators with initial guess: set initial guess
  + if (operators[i]->apply_uses_initial_guess()) {
  + if (op_size[0] == op_size[1]) {
  + // square matrix: we can use the previous output
  + exec->copy(out_size, in->get_const_values(), out->get_values());
  + } else {
  + // rectangular matrix: we can't do better than zeros
  + exec->run(composition::make_fill_array(
  + out->get_values(), zero<ValueType>(), out_size));
  + }
  + }
  // apply operator
  operators[i]->apply(lend(in), lend(out));
  }
  