Opened 13 years ago

Closed 12 years ago

#3514 closed Feature Requests (fixed)

enable support for complex @ int

Reported by: Gunter Owned by: Gunter
Milestone: Boost 1.42.0 Component: uBLAS
Version: Boost 1.40.0 Severity: Optimization
Keywords: Cc:

Description

enable basic operators for mixed types:

  • c+i; i+c; i-c; c-i; i*c; c*i; i/c; c/i;

The implementation should be roughly like

template<R> std::complex<R> operator+ (int in1, const std::complex<R>& in2 ){
    return typename std::complex<R>::value_type(in1) + in2;
}

plus a carefully chosen enable_if to avoid "ambigous overload" errors when R is int

Change History (1)

comment:1 by anonymous, 12 years ago

Resolution: fixed
Status: newclosed

it's an old bug but now this is possible with ublas.

Note: See TracTickets for help on using tickets.