Boost logo

Ublas :

Subject: Re: [ublas] todo list
From: Marco Guazzone (marco.guazzone_at_[hidden])
Date: 2010-07-24 17:40:41


On Sat, Jul 24, 2010 at 11:14 PM, Jesse Perla <jesseperla_at_[hidden]> wrote:
> Matwey V. Kornilov <matwey.kornilov <at> gmail.com> writes:
>> This is for memory economy. When we want to solve linear set Ax=y by means
>> of SVD decomposition we write
>
> 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

Cheers,

-- Marco