Re: [julia-users] Re: Constructing matrices

2015-02-26 Thread Bill Hart
Yeah, but that's nothing to do with the syntax. After all: julia> [1, 2, 3] === [1, 2, 3] false julia> [1; 2; 3] === [1; 2; 3] false On 26 February 2015 at 19:55, Luis Benet wrote: > Just a tiny little note on: > > [1; 2; 3] is precisely the same thing as [1, 2, 3] >> > > julia> [1; 2; 3] ==

Re: [julia-users] Re: Constructing matrices

2015-02-26 Thread Luis Benet
Just a tiny little note on: [1; 2; 3] is precisely the same thing as [1, 2, 3] > julia> [1; 2; 3] == [1,2,3] true julia> [1; 2; 3] === [1,2,3] false Luis

Re: [julia-users] Re: Constructing matrices

2015-02-24 Thread Bill Hart
Sorry, I wrote 0D array, when I actually meant 0xn or nx0 arrays, (which my colleague and I agree should be 2D). On 25 February 2015 at 01:10, Bill Hart wrote: > > > On 25 February 2015 at 00:18, Matt Bauman wrote: > >> I don't understand the distinction you're making between "flat arrays" >> a

Re: [julia-users] Re: Constructing matrices

2015-02-24 Thread Bill Hart
On 25 February 2015 at 00:18, Matt Bauman wrote: > I don't understand the distinction you're making between "flat arrays" and > "column matrices." Internally, the vectors and matrices are laid out > identically >

Re: [julia-users] Re: Constructing matrices

2015-02-24 Thread Matt Bauman
I don't understand the distinction you're making between "flat arrays" and "column matrices." Internally, the vectors and matrices are laid out identically , with the exception that there ar

Re: [julia-users] Re: Constructing matrices

2015-02-24 Thread Bill Hart
This might not be a trivial change. Presumably its done this way so that functions like linear solving do not take a column matrix as one of its inputs (which maybe has a relatively inefficient representation?), but so that they can take a flat array as input, which does have an efficient represent

Re: [julia-users] Re: Constructing matrices

2015-02-24 Thread Kevin Squire
I (think I) would be in favor of changing [1; 2; 3] to mean a 1-column matrix. Arguments against? Kevin On Tue, Feb 24, 2015 at 11:45 AM, Bill Hart wrote: > Julia distinguishes between them at the level of types, yes. I was talking > about the syntax for creating them. There they become confla

Re: [julia-users] Re: Constructing matrices

2015-02-24 Thread Bill Hart
Julia distinguishes between them at the level of types, yes. I was talking about the syntax for creating them. There they become conflated. [1; 2; 3] is precisely the same thing as [1, 2, 3] Sorry for not being clearer about that. It's clear this is done intentionally, not accidentally. It's jus

Re: [julia-users] Re: Constructing matrices

2015-02-24 Thread David P. Sanders
El martes, 24 de febrero de 2015, 8:18:28 (UTC-6), Bill Hart escribió: > > The specific use case where I hit this as a problem is in wrapping > external libraries like flint and pari, which unlike julia do not conflate > 1xn matrices with flat arrays. > > However, I have just realised that Juli

Re: [julia-users] Re: Constructing matrices

2015-02-24 Thread Bill Hart
The specific use case where I hit this as a problem is in wrapping external libraries like flint and pari, which unlike julia do not conflate 1xn matrices with flat arrays. However, I have just realised that Julia only conflates column vectors with flat arrays, not row vectors. Therefore I can ov

Re: [julia-users] Re: Constructing matrices

2015-02-24 Thread Jiahao Chen
> > Clearly Julia wants to deliberately conflate row and column vectors, which > is fine if you aren't working with an algorithm that depends on the > individual dimensions of your matrices, and you aren't interfacing to an > external library. > Could you elaborate on what you mean here? As part o

[julia-users] Re: Constructing matrices

2015-02-24 Thread Bill Hart
Thanks. The hvcat is somewhat awkward as a matrix syntax. But from your hint I also see that [[1]'; 2; 3] or [1 2 3]' works. That's a bit ugly, but workable for now. I really wish the semicolon had been reserved for terminating the row of a matrix. Clearly Julia wants to deliberately conflate r

[julia-users] Re: Constructing matrices

2015-02-23 Thread Pablo Zubieta
Yeah, I have never thought of that, but it seems kind of confusing. You can do julia> hvcat(1, 1, 2, 3) 3x1 Array{Int64,2}: 1 2 3 julia> hvcat(1, 1, 2, 3)'' == hvcat(1, 1, 2, 3) true Greetings.