Hi again,
Am Sonntag, 6. April 2014 01:33:16 UTC+2 schrieb Cristóvão Duarte Sousa:
Since julia aims at technical problems, with lots of linear algebra, it
> makes some sense to use * for matrix multiplication (everyday linear
> algebra) and use something else (.* borrowed from Matlab) to the less
> common matrix element-wise multiplication.
> What operation does `A*B` looks like to a scientist/engineer? I'm pretty
> sure it clearly is a linear algebra matrix multiplication.
>
I wouldn't say that element-wise matrix multiplication are less common,
especially in image processing.
The one desire to write A*B for matrix multiplication (and the tendency to
MatLab in this case), introduces some shortcomings:
Who want's to write A .+ B ?
On the other hand, e.g. A .& B does even not exist.
And according to this logic, shouldn't I then write e.g. ".sin(A)"?
(Also note that division does not look like the inverse operation of
multiplication, since e.g. A=[1 2 3]; B=[1, 2, 4]; A*B/B == A returns
false.)
I would always expected that those operation +,-,*,/,>, &,sin,... are just
vectorised (i.e. element-wise), which is in my eyes the simplest form of
generalisation.
For those who dislike the current notation, I have quick and dirty work
around (which the devs likely do not recommend):
.*, * = *, .*
and now it works like this:
A = [1 2 3]
A * A
1x3 Array{Int64,2}:
1 4 9
(and also for the "inplace" operator:
A *= A
1x3 Array{Int64,2}:
1 4 9
). This is a cool feature of Julia.
Am Freitag, 4. April 2014 00:45:37 UTC+2 schrieb [email protected]
> - length => len
>
To give an answer to myself:
len = length
Am Freitag, 4. April 2014 00:45:37 UTC+2 schrieb [email protected]:Hi
> Julia users,
> - array indexing: introduce with negative number -1,-2,... (instead of or
> additionally to end, end-1)
>
No comments on that?
Am Sonntag, 6. April 2014 10:57:35 UTC+2 schrieb Mikael Simberg:
> Just an idea: I don't know how common this use would be in code, but a < b
> (without the dot) could be used to compare if array b dominates a i.e. all
> elements of b are strictly greater than a. Likewise for >, <= and >=. This
> is certainly used as mathematical notation and they're currently not
> defined in Julia and could be implemented more efficiently than the
> element-wise comparisons.
>
I like this idea to introduce an operator for "strictly greater than".
Friedrich