Hi Philippe,

Philippe Tillet <phil.til...@gmail.com>
writes:
> One thing I really like in Matlab is the operator.* , but well it doesn't
> exist in general purpose languages :P

Yes -- I don't know why there's no such thing as a special extension
keyboard with mathematical symbols.. and then language support for them
all. I'd love an outer product operator, or an integral operator..

> I think that operator* is mostly convenient for nested expressions.
> However, since nested expressions often introduce temporaries that are
> particularly expensive, I think that defining operator* may lead to bad
> performance, leading some user to not realize that they are creating a lot
> temporaries when they write i.e. A = B*C*D*E  , while A = prod(B,
> prod(C,prod(D,E))) is much more explicit in this regard. However, chosing
> elementwise product for operator* would be super misleading in the case of
> the matrix product (if someone writes A = B*C and ends up with some
> elementwise product, he will be wtf'ed !).

OK, so no elementwise product operator. But there's no problem with
temporaries in Python, if A*B*C*D == Prod(Prod(Prod(A, B), C), D) and
the scheduler is designed not to create any temporaries in executing the
expression: and, because I overload the operator, that should be
precisely what happens (wherever the scheduler operation is defined).

> Basically, i would personally leave all operator*(matrix,matrix),
> operator*(matrix,vector) and operator*(vector,vector) undefined, but it's
> just my personal opinion :) i'm not experienced with python and it might be
> a great disappointment for the userbase if our syntax is too verbose (if
> they are writing in python, they probably care a lot about verbosity!)

Yeah, that's the thing. It would be mathematically consistent to leave
them all undefined, but I think pragmatism and convenience should win
over interface consistency here. So, rather than just say, "there is no
operator *, you must be explicit" -- I'd rather say, "do what feels
natural". And most of the time, it'll be right, I think; otherwise,
it'll still be easy to be explicit.

Of course, if anyone thinks I think wrongly, then they should say say --
that is why I sent out my post, after all.


Best,

T


------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
ViennaCL-devel mailing list
ViennaCL-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viennacl-devel

Reply via email to