Opened 8 years ago

Closed 7 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:


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

Attachments (0)

Change History (1)

comment:1 Changed 7 years ago by anonymous

Resolution: fixed
Status: newclosed

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

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Gunter.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.