From 7985c35454be2626a69ace34f03959eda9612d0a Mon Sep 17 00:00:00 2001 From: Chris Elrod Date: Sat, 10 Feb 2024 02:32:48 -0500 Subject: [PATCH] simplify `promote_shape` to always set `AbstractVector`s to `RowVector`s --- include/Math/ArrayOps.hpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/include/Math/ArrayOps.hpp b/include/Math/ArrayOps.hpp index f2c1888..719c326 100644 --- a/include/Math/ArrayOps.hpp +++ b/include/Math/ArrayOps.hpp @@ -108,14 +108,9 @@ template } template [[gnu::always_inline]] constexpr auto promote_shape(const A &a, const B &b) { - if constexpr (ColVector && RowVector) { - return CartesianIndex( - std::integral_constant{}, - check_sizes(unwrapRow(a.numRow()), unwrapCol(b.numCol()))); - } else if constexpr (RowVector && ColVector) { - return CartesianIndex( - std::integral_constant{}, - check_sizes(unwrapRow(b.numRow()), unwrapCol(a.numCol()))); + if constexpr (AbstractVector && AbstractVector) { + return CartesianIndex(std::integral_constant{}, + check_sizes(a.size(), b.size())); } else { auto sa = shape(a); // broadcasting static sizes is awkward, as it can prevent propogating