@@ -2868,6 +2868,14 @@ Cube<eT>::Cube(const eOpCube<T1, eop_type>& X)
28682868
28692869 init_cold ();
28702870
2871+ if (is_same_type<eop_type, eop_pow>::value)
2872+ {
2873+ constexpr bool eT_non_int = is_non_integral<eT>::value;
2874+
2875+ if ( X.aux == eT (2 ) ) { eop_square::apply (*this , reinterpret_cast < const eOpCube<T1 , eop_square>& >(X)); return ; }
2876+ if (eT_non_int && (X.aux == eT (0.5 ))) { eop_sqrt::apply (*this , reinterpret_cast < const eOpCube<T1 , eop_sqrt >& >(X)); return ; }
2877+ }
2878+
28712879 eop_type::apply (*this , X);
28722880 }
28732881
@@ -2890,6 +2898,14 @@ Cube<eT>::operator=(const eOpCube<T1, eop_type>& X)
28902898
28912899 init_warm (X.get_n_rows (), X.get_n_cols (), X.get_n_slices ());
28922900
2901+ if (is_same_type<eop_type, eop_pow>::value)
2902+ {
2903+ constexpr bool eT_non_int = is_non_integral<eT>::value;
2904+
2905+ if ( X.aux == eT (2 ) ) { eop_square::apply (*this , reinterpret_cast < const eOpCube<T1 , eop_square>& >(X)); return *this ; }
2906+ if (eT_non_int && (X.aux == eT (0.5 ))) { eop_sqrt::apply (*this , reinterpret_cast < const eOpCube<T1 , eop_sqrt >& >(X)); return *this ; }
2907+ }
2908+
28932909 eop_type::apply (*this , X);
28942910
28952911 return *this ;
@@ -2912,6 +2928,14 @@ Cube<eT>::operator+=(const eOpCube<T1, eop_type>& X)
29122928
29132929 if (bad_alias) { const Cube<eT> tmp (X); return (*this ).operator +=(tmp); }
29142930
2931+ if (is_same_type<eop_type, eop_pow>::value)
2932+ {
2933+ constexpr bool eT_non_int = is_non_integral<eT>::value;
2934+
2935+ if ( X.aux == eT (2 ) ) { eop_square::apply_inplace_plus (*this , reinterpret_cast < const eOpCube<T1 , eop_square>& >(X)); return *this ; }
2936+ if (eT_non_int && (X.aux == eT (0.5 ))) { eop_sqrt::apply_inplace_plus (*this , reinterpret_cast < const eOpCube<T1 , eop_sqrt >& >(X)); return *this ; }
2937+ }
2938+
29152939 eop_type::apply_inplace_plus (*this , X);
29162940
29172941 return *this ;
@@ -2934,6 +2958,14 @@ Cube<eT>::operator-=(const eOpCube<T1, eop_type>& X)
29342958
29352959 if (bad_alias) { const Cube<eT> tmp (X); return (*this ).operator -=(tmp); }
29362960
2961+ if (is_same_type<eop_type, eop_pow>::value)
2962+ {
2963+ constexpr bool eT_non_int = is_non_integral<eT>::value;
2964+
2965+ if ( X.aux == eT (2 ) ) { eop_square::apply_inplace_minus (*this , reinterpret_cast < const eOpCube<T1 , eop_square>& >(X)); return *this ; }
2966+ if (eT_non_int && (X.aux == eT (0.5 ))) { eop_sqrt::apply_inplace_minus (*this , reinterpret_cast < const eOpCube<T1 , eop_sqrt >& >(X)); return *this ; }
2967+ }
2968+
29372969 eop_type::apply_inplace_minus (*this , X);
29382970
29392971 return *this ;
@@ -2956,6 +2988,14 @@ Cube<eT>::operator%=(const eOpCube<T1, eop_type>& X)
29562988
29572989 if (bad_alias) { const Cube<eT> tmp (X); return (*this ).operator %=(tmp); }
29582990
2991+ if (is_same_type<eop_type, eop_pow>::value)
2992+ {
2993+ constexpr bool eT_non_int = is_non_integral<eT>::value;
2994+
2995+ if ( X.aux == eT (2 ) ) { eop_square::apply_inplace_schur (*this , reinterpret_cast < const eOpCube<T1 , eop_square>& >(X)); return *this ; }
2996+ if (eT_non_int && (X.aux == eT (0.5 ))) { eop_sqrt::apply_inplace_schur (*this , reinterpret_cast < const eOpCube<T1 , eop_sqrt >& >(X)); return *this ; }
2997+ }
2998+
29592999 eop_type::apply_inplace_schur (*this , X);
29603000
29613001 return *this ;
@@ -2978,6 +3018,14 @@ Cube<eT>::operator/=(const eOpCube<T1, eop_type>& X)
29783018
29793019 if (bad_alias) { const Cube<eT> tmp (X); return (*this ).operator /=(tmp); }
29803020
3021+ if (is_same_type<eop_type, eop_pow>::value)
3022+ {
3023+ constexpr bool eT_non_int = is_non_integral<eT>::value;
3024+
3025+ if ( X.aux == eT (2 ) ) { eop_square::apply_inplace_div (*this , reinterpret_cast < const eOpCube<T1 , eop_square>& >(X)); return *this ; }
3026+ if (eT_non_int && (X.aux == eT (0.5 ))) { eop_sqrt::apply_inplace_div (*this , reinterpret_cast < const eOpCube<T1 , eop_sqrt >& >(X)); return *this ; }
3027+ }
3028+
29813029 eop_type::apply_inplace_div (*this , X);
29823030
29833031 return *this ;
0 commit comments