Skip to content

Commit

Permalink
add sized ctr, make add operators public
Browse files Browse the repository at this point in the history
  • Loading branch information
greole committed Jan 22, 2025
1 parent 20cfd68 commit 2301d19
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion include/ginkgo/core/base/combination.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,19 @@ class Combination : public EnableLinOp<Combination<ValueType>>,
using value_type = ValueType;
using transposed_type = Combination<ValueType>;

/**
* Creates an empty linear combination with given size.
*
* @param exec Executor associated to the linear combination
*/
explicit Combination(std::shared_ptr<const Executor> exec,
const gko::dim<2>& size)
: EnableLinOp<Combination>(exec)
{
this->set_size(size);
}


/**
* Returns a list of coefficients of the combination.
*
Expand Down Expand Up @@ -91,7 +104,6 @@ class Combination : public EnableLinOp<Combination<ValueType>>,
*/
Combination(Combination&&);

protected:
void add_operators() {}

template <typename... Rest>
Expand All @@ -112,6 +124,7 @@ class Combination : public EnableLinOp<Combination<ValueType>>,
add_operators(std::forward<Rest>(rest)...);
}

protected:
/**
* Creates an empty linear combination (0x0 operator).
*
Expand Down

0 comments on commit 2301d19

Please sign in to comment.