This repository was archived by the owner on Jan 26, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,13 +83,15 @@ namespace x {
8383 case LOGADDEXP :
8484 return operatorx<A>::mk_tx_ (a_ptr, xt::log (xt::exp (a) + xt::exp (b)));
8585 case LOGICAL_AND :
86- // return operatorx<A>::mk_tx_(a_ptr, a && b );
86+ return operatorx<A>::mk_tx_ (a_ptr, xt::cast< bool >(a) && xt::cast< bool >(b) );
8787 case LOGICAL_OR :
88- // return operatorx<A>::mk_tx_(a_ptr, a || b );
88+ return operatorx<A>::mk_tx_ (a_ptr, xt::cast< bool >(a) || xt::cast< bool >(b) );
8989 case LOGICAL_XOR :
90- // return operatorx<A>::mk_tx_(a_ptr, xt::not_equal(!a, !b));
91- // FIXME
92- throw std::runtime_error (" Binary operation not implemented" );
90+ {
91+ auto ba = xt::cast<bool >(a);
92+ auto bb = xt::cast<bool >(b);
93+ return operatorx<A>::mk_tx_ (a_ptr, (b || a) && xt::not_equal (ba, bb));
94+ }
9395 }
9496 if constexpr (std::is_integral<A>::value && std::is_integral<typename T2 ::value_type>::value) {
9597 switch (bop) {
You can’t perform that action at this time.
0 commit comments