|
Ublas : |
Subject: Re: [ublas] todo list
From: Paul Leopardi (paul.leopardi_at_[hidden])
Date: 2010-07-25 00:44:29
Hi all,
On Sunday 25 July 2010 07:40:41 Marco Guazzone wrote:
> On Sat, Jul 24, 2010 at 11:14 PM, Jesse Perla <jesseperla_at_[hidden]> wrote:
> > Let me throw out a crazy suggestion. �One cool thing about matlab is
> > overloading of the '\' operator. �You can then solve: A x = B
> > by writing:
> > x = B\A;
> >
> > Can we do something like this overloading the '/' operator?
> > �matrix<double> A;
> > �vector<double> B;
> > �auto x = B / A;
> >
> > And to solve in place:
> > �B /= A;
> >
> > To specify different algorithms, you could add in tags around the rhs,
> > which could then be detected in the '/' overload and the appropriate
> > algorithm used.
> >
> > auto x = B / ublas::svd(A);
>
> IMHO, I would avoid this type of overload since this is confusing for
> MATLAB users since MATLAB also have "/" which is different from "\".
> See here for "/"
> http://www.mathworks.com/access/helpdesk/help/techdoc/ref/mrdivide.html
>
> and here for "\"
> http://www.mathworks.com/access/helpdesk/help/techdoc/ref/mldivide.html
Exactly. So if we decide to overload "/" it must work like Matlab's "/", *not*
like "\", and be properly documented so that I does not surprise its users in
any way.
Best, Paul