Add sized ctor and public add_operator to Combination
This PR makes the Combination::add_operators member public so that operators can be added after constructing a combination matrix. Additionally, a new constructor is added so that an empty combination can be created first and additional operators are added later.
Can you describe a use case for this? Combination creation is pretty lightweight, so I am hesitant to add more complexity there.
Sure and maybe there is a better way to do it. On the OGL side I have std::vector<gko::LinOp> of local and non_local linops representing local and non_local interfaces for Distributed::Matrix. Probably, I could also use this ctr
explicit Combination(CoefficientIterator coefficient_begin,
CoefficientIterator coefficient_end,
OperatorIterator operator_begin,
OperatorIterator operator_end)
but there are cases (after repartitioning) where operator_begin==operator_end thus it would throw.
Making the empty case work seems sensible, except for the fact that we don't have anything to base the size on then. BTW ctr is kind of a misleading abbreviation, it could be counter or constructor.
Error: The following files need to be formatted:
common/cuda_hip/components/merging.hpp
common/cuda_hip/components/searching.hpp
common/cuda_hip/factorization/lu_kernels.cpp
common/cuda_hip/factorization/par_ilut_filter_kernels.hpp
common/cuda_hip/factorization/par_ilut_spgeam_kernels.cpp
common/cuda_hip/matrix/dense_kernels.cpp
core/config/stop_config.cpp
core/config/trisolver_config.hpp
core/factorization/par_ic.cpp
core/factorization/par_ict.cpp
core/factorization/par_ilu.cpp
core/factorization/par_ilut.cpp
core/preconditioner/gauss_seidel.cpp
core/preconditioner/isai.cpp
core/preconditioner/sor.cpp
core/solver/bicg.cpp
core/solver/bicgstab.cpp
core/solver/cb_gmres.cpp
core/solver/cg.cpp
core/solver/cgs.cpp
core/solver/direct.cpp
core/solver/fcg.cpp
core/solver/gcr.cpp
core/solver/idr.cpp
core/solver/lower_trs.cpp
core/solver/upper_trs.cpp
core/test/config/factorization.cpp
core/test/config/multigrid.cpp
cuda/components/cooperative_groups.cuh
cuda/test/components/cooperative_groups.cu
dpcpp/components/cooperative_groups.dp.hpp
dpcpp/components/merging.dp.hpp
dpcpp/components/searching.dp.hpp
dpcpp/factorization/par_ict_kernels.dp.cpp
dpcpp/factorization/par_ilut_filter_kernels.hpp.inc
dpcpp/factorization/par_ilut_spgeam_kernel.dp.cpp
dpcpp/factorization/par_ilut_sweep_kernel.dp.cpp
dpcpp/test/components/cooperative_groups.dp.cpp
hip/test/components/cooperative_groups.hip.cpp
include/ginkgo/core/base/combination.hpp
include/ginkgo/core/factorization/ic.hpp
include/ginkgo/core/factorization/ilu.hpp
include/ginkgo/core/solver/multigrid.hpp
reference/test/factorization/ic_kernels.cpp
reference/test/factorization/ilu_kernels.cpp
You can find a formatting patch under Artifacts here or run format! if you have write access to Ginkgo