Re: [julia-users] Re: possibility to define a type that is subtype of more than one supertype

2016-04-04 Thread Mauro
My Traits.jl package hasn't seen much love recently. It should work fine (within its limitation of being experimental) for 0.4 but I'm not sure I'll find the time to update it to 0.5 when the time comes. There is also https://github.com/mauro3/SimpleTraits.jl which is (+/-) just macro-sugar for "

[julia-users] Re: Julia is a great idea, but it disqualifies itself for a big portion of its potential consumers

2016-04-04 Thread DNF
Typo, I meant to type: Python 3.5 a[i*len(a)//n:(i+1)*len(a)//n] Julia: a[1+i*end÷n:(i+1)end÷n] I'm just learning Python, and must say I find indexing in Python to be very awkward compared to Julia or Matlab. Do you have any suggestion for how I should do this in Python? a[[1; 4; 7:2:15]] So f

[julia-users] Re: Julia is a great idea, but it disqualifies itself for a big portion of its potential consumers

2016-04-04 Thread DNF
On Saturday, April 2, 2016 at 1:55:55 PM UTC+2, Spiritus Pap wrote: > > A simple example why it makes my *life hard*: Assume there is an array of > size 100, and i want to take the i_th portion of it out of n. This is a > common scenario for research-code, at least for me and my friends. > In py

Re: [julia-users] Re: Julia is a great idea, but it disqualifies itself for a big portion of its potential consumers

2016-04-04 Thread Tomas Lycken
There are only 6 uses of // outside of rationals.jl in base (4 of those are in mpfr.jl), compared to 187 uses of div, and 22 uses of ÷. (that’s uses, not definitions, exports, documentation, although the ratios are very similar). Looking at packages, it seems also that div is used frequently,

[julia-users] Re: enforcing homogeneity of vector elements in function signature

2016-04-04 Thread Jeffrey Sarnoff
If I understand your question, you want to accept e.g. both [Foo{Int,2}((1,2)), Foo{Int,2)((2,3))] and [Foo{Int,2}((1,2)), Foo{Int,3)((2,3,4)) ] and then do something with them, and you want to reject e.g. [Foo{Int,2((1,2)), Foo{Float64,2}((2.0,3.0))]. Having two method signatures that

[julia-users] Re: enforcing homogeneity of vector elements in function signature

2016-04-04 Thread Tomas Lycken
The reason you’re getting that method error is because of type parameter invariance - in short, even though F <: Foo{T}, we *don’t* have Vector{F} <: Vector{Foo{T}}. Until triangular dispatch lands, defining

Re: [julia-users] "Number of packages that depend on this package" at http://pkg.julialang.org/ - which ones?

2016-04-04 Thread Patrick Kofod Mogensen
Thank you. Unsure about the discrepancy. Could be because the pkg.julialang.org is a few weeks old, but maybe not. On Tuesday, April 5, 2016 at 12:31:39 AM UTC+2, Tim Holy wrote: > > Pkg.dependents should do it. To get both direct and indirect dependents, > you > can do this: > > julia> sold =

[julia-users] Re: Small packages?

2016-04-04 Thread Jeffrey Sarnoff
Julia allows you to have submodules; you can collect some of your tiny packages into MyUtilityPackages (sketched, not run) module MyUtilityPackages module StringUtilities export stringfunction function stringfunction .. end end module IntegerUtilities export i

[julia-users] Small packages?

2016-04-04 Thread Eric Forgy
Hi, I've been working with Julia for a little while now and notice that I'm starting to develop a number of very small packages that I use and reuse all the time. I was curious about your opinions on publishing very small "utility" packages? For example, I am consider making a very tiny packag

Re: [julia-users] Re: Julia is a great idea, but it disqualifies itself for a big portion of its potential consumers

2016-04-04 Thread Scott Jones
On Monday, April 4, 2016 at 7:27:40 AM UTC-4, Stefan Karpinski wrote: > > Number does not imply or assume commutativity. The Quaternions package > provides a Quaternion type which is a subtype of Number. Rational, however, > only allows integer numerators and denominators. Since integer > mult

Re: [julia-users] "Number of packages that depend on this package" at http://pkg.julialang.org/ - which ones?

2016-04-04 Thread Tim Holy
Pkg.dependents should do it. To get both direct and indirect dependents, you can do this: julia> sold = Set(); s = Pkg.dependents("ParserCombinator") 3-element Array{AbstractString,1}: "LightGraphs" "QDXML" "LispSyntax" julia> sold = Set(); s = Set(Pkg.dependents("ParserCombinator")) S

Re: [julia-users] dispatch slowdown when iterating over array with abstract values

2016-04-04 Thread Yichao Yu
On Apr 4, 2016 1:36 PM, "Cedric St-Jean" wrote: > > I'm not a compiler dev, but here's how I understand it: > Sorry forgot to reply > > On Sunday, April 3, 2016 at 6:32:17 PM UTC-4, Greg Plowman wrote: >> >> It seems to me that slowness of dynamic dispatch and type instability are orthogonal

Re: [julia-users] Re: Julia is a great idea, but it disqualifies itself for a big portion of its potential consumers

2016-04-04 Thread Zheng Wendell
Yes, let's return to the OP. Note that what the author *really wants* is to get the i-th potion of an array. Either integer division or 0-based alone can't solve this problem. a[i*100/n : (i+1)*100/n] needs both features. As Eric puts it, user-written code can be as efficient as the built-in code.

[julia-users] iterating over a vector of inhomogeneous elements

2016-04-04 Thread Davide Lasagna
Hi all, Look at the following code: using Benchmarks const Nf = 1_000_000 immutable PolygonalFace{T, N} points::NTuple{N, UInt32} area::T end @inline area(p::PolygonalFace) = p.area function make_abstract_faces(Nf) faces = PolygonalFace{Float64}[] for i = 1:Nf N = ran

[julia-users] "Number of packages that depend on this package" at http://pkg.julialang.org/ - which ones?

2016-04-04 Thread Patrick Kofod Mogensen
Is it possible to find the packages that depend on a package shown at http://pkg.julialang.org/ ? For example, 13 packages depend on ParserCombinator, but which ones?

Re: [julia-users] Re: regression from 0.43 to 0.5dev, and back to 0.43 on fedora23

2016-04-04 Thread Milan Bouchet-Valat
Le lundi 04 avril 2016 à 10:36 -0700, Johannes Wagner a écrit : > hey guys, > so attached you find text files with @code_native output for the > instructions  > - r * x[1,:] > - cis(imexp) > - sum(imexp) * sum(conj(imexp)) > > for julia 0.5.  > > Hardware I run on is a Haswell i5 machine, a Haswe

[julia-users] Re: enforcing homogeneity of vector elements in function signature

2016-04-04 Thread Davide Lasagna
Thanks, yes, I have tried this, but did not mention what happens. For the signature you suggest, you get a `MethodError` in the case the vector `x` is homogeneous in both parameters. Look at this code type Foo{T, N} a::NTuple{N, T} end function make_homogeneous_Foos(M) fs = Foo{Float64

[julia-users] Re: enforcing homogeneity of vector elements in function signature

2016-04-04 Thread John Myles White
Vector{Foo{T}}? On Monday, April 4, 2016 at 1:25:46 PM UTC-7, Davide Lasagna wrote: > > Hi all, > > Consider the following example code > > type Foo{T, N} > a::NTuple{N, T} > end > > function make_Foos(M) > fs = Foo{Float64}[] > for i = 1:M > N = rand(1:2) > f = Foo{Fl

Re: [julia-users] I need some advise about File IO in Julia

2016-04-04 Thread Diego Javier Zea
Hi! Finally, I have a PDB and PDBML (xml) parser in the *PDB module* of *MIToS *(the *documentation* is in *http://mitos.leloir.org.ar* ). Best, El lunes, 14 de marzo de 2016, 15:49:44 (UTC-3), Joe Greener escribió: > > Just

[julia-users] enforcing homogeneity of vector elements in function signature

2016-04-04 Thread Davide Lasagna
Hi all, Consider the following example code type Foo{T, N} a::NTuple{N, T} end function make_Foos(M) fs = Foo{Float64}[] for i = 1:M N = rand(1:2) f = Foo{Float64, N}(ntuple(i->0.0, N)) push!(fs, f) end fs end function bar{F<:Foo}(x::Vector{F}) p

[julia-users] ANN: MIToS v1.0 Released

2016-04-04 Thread Diego Javier Zea
Hi All, We've released the 1.0 version of *MIToS *! Changes are documented in the NEWS.md file. This version includes a new module: *Pfam*. It integrates Information, MSA, PDB and SIFTS modules fo

Re: [julia-users] Doing linear algebra on nested subarrays ... quickly

2016-04-04 Thread Kristoffer Carlsson
Allocating 2^1, 2^2, ..., 2^N is still only allocating 2^(N+1). Depending on how large N you have, it might very well be worth copying.

Re: [julia-users] Doing linear algebra on nested subarrays ... quickly

2016-04-04 Thread Tim Holy
It does if isa(A, StridedVecOrMat), they have unit stride along the first dimension, and the element type is supported by BLAS (Float32, Float64, Complex64, Complex128). These are all simply restrictions of BLAS, not limitations of julia. When those don't hold, there are at least cache-optimize

Re: [julia-users] Doing linear algebra on nested subarrays ... quickly

2016-04-04 Thread Gregor Robinson
Yep. But, as far as I can tell, BLAS doesn't play with SubMatrix. On Monday, April 4, 2016 at 6:11:52 AM UTC-6, Tim Holy wrote: > > Have you tried `sub`? > > --Tim >

Re: [julia-users] dispatch slowdown when iterating over array with abstract values

2016-04-04 Thread Cedric St-Jean
I'm not a compiler dev, but here's how I understand it: On Sunday, April 3, 2016 at 6:32:17 PM UTC-4, Greg Plowman wrote: > > It seems to me that slowness of dynamic dispatch and type instability are > orthogonal. > I mean is dynamic dispatch inherently slow, or is it slow because it > involves

Re: [julia-users] Re: regression from 0.43 to 0.5dev, and back to 0.43 on fedora23

2016-04-04 Thread Johannes Wagner
hey guys, so attached you find text files with @code_native output for the instructions - r * x[1,:] - cis(imexp) - sum(imexp) * sum(conj(imexp)) for julia 0.5. Hardware I run on is a Haswell i5 machine, a Haswell i7 machine, and a IvyBridge i5 machine. Turned out on an Haswell i5 machine the

Re: [julia-users] Re: Julia is a great idea, but it disqualifies itself for a big portion of its potential consumers

2016-04-04 Thread Tomas Lycken
It’s also entirely possible to create a macro that lets / do what you (the OP) want. @integer_division begin # in here, 5 / 2 == 2 end Basically, you’d just traverse the AST recursively and switch all calls to / for calls to div. (I admit, though I wouldn’t want to do it myself, nor wo

Re: [julia-users] MethodError: '+' has no method matching +(::DateTime, ::Int64)

2016-04-04 Thread Jacob Quinn
Sorry, I should have been more clear. I was trying to express that perhaps we should document these previously-internal methods so that they are actually a part of the official interface/exported. They're not unsafe or anything and people may actually have a use for these, so maybe we should just

Re: [julia-users] MethodError: '+' has no method matching +(::DateTime, ::Int64)

2016-04-04 Thread Milan Bouchet-Valat
Le lundi 04 avril 2016 à 10:27 -0600, Jacob Quinn a écrit : > Hmmm.yeah, it's not ideal, I guess. Dates.day(::Integer) is > indeed an internal method that takes the # of Rata Die days (i.e. the > value of Int(Date(2015,1,1))) and returns the day of the month for > that Rata Die. It might be wor

Re: [julia-users] MethodError: '+' has no method matching +(::DateTime, ::Int64)

2016-04-04 Thread Jacob Quinn
Hmmm.yeah, it's not ideal, I guess. Dates.day(::Integer) is indeed an internal method that takes the # of Rata Die days (i.e. the value of Int(Date(2015,1,1))) and returns the day of the month for that Rata Die. It might be worth documenting so that it's more clear what's going on when people s

Re: [julia-users] julia-emacs ...

2016-04-04 Thread Stefan Karpinski
No worries. The repo is very new and could probably stand to have some more instructions. On Mon, Apr 4, 2016 at 10:08 AM, Andrea Pagnani wrote: > Ok ... so just a > > git clone https://github.com/JuliaLang/julia-emacs > > makes the job + changing the path of where the julia-mode.el is in the >

Re: [julia-users] MethodError: '+' has no method matching +(::DateTime, ::Int64)

2016-04-04 Thread Josh Langsfeld
Shouldn’t Dates.day(1) be the MethodError here? It calls what appears to be an internal calculation method that happens to have the same name as the exported and documented method. On Monday, April 4, 2016 at 11:21:47 AM UTC-4, Jacob Quinn wrote: Dates.day is the accessor funciton, returning

[julia-users] Re: dispatch slowdown when iterating over array with abstract values

2016-04-04 Thread Tim Wheeler
Thank you for everyone's comments. To summarize, the slow version needs to perform memory allocation to protect itself against potential type instability should future types and associated evaluate function be defined, whereas the 'fast' version is protected from this and the compiler can optimi

Re: [julia-users] WARNING: Base.String is deprecated [Help defining my own "String"]

2016-04-04 Thread Eric Forgy
On Monday, April 4, 2016 at 11:32:23 PM UTC+8, Milan Bouchet-Valat wrote: > > Even if that's a bug, calling a type String isn't a great idea given > that it's going to be the new name for ASCIIString/UTF8String in Base. > Better choose something more explicit. > I hear you, but I do want types

Re: [julia-users] WARNING: Base.String is deprecated [Help defining my own "String"]

2016-04-04 Thread Milan Bouchet-Valat
Le lundi 04 avril 2016 à 10:54 -0400, Yichao Yu a écrit : > On Mon, Apr 4, 2016 at 10:53 AM, Yichao Yu wrote: > > > > On Mon, Apr 4, 2016 at 10:27 AM, Eric Forgy wrote: > > > > > > Hello, > > > > > > I am doing some work trying to get Julia to play nice with .NET and want > > > to > > > defin

Re: [julia-users] WARNING: Base.String is deprecated [Help defining my own "String"]

2016-04-04 Thread Eric Forgy
On Monday, April 4, 2016 at 10:54:42 PM UTC+8, Yichao Yu wrote: > > Just tried it on master and this looks like a bug. Please file this on > the issue tracker. > Ok. Thanks for looking into it Yichao. https://github.com/JuliaLang/julia/issues/15760

Re: [julia-users] MethodError: '+' has no method matching +(::DateTime, ::Int64)

2016-04-04 Thread Jacob Quinn
Dates.day is the accessor funciton, returning the day of month for a Date/DateTime. Dates.Day is the Period type representing the span of one day. So you'll want something like: now() + Dates.Day(1) -Jacob On Mon, Apr 4, 2016 at 5:48 AM, Josh wrote: > When trying to increment and decrement

[julia-users] Re: QuantLib in Julia: JQuantLib (very very alpha stage at this point!)

2016-04-04 Thread Christopher Alexander
Hello all, I just wanted to provide an update on this package. I haven't officially registered it yet (I still have more work I want to do, and I need to add more tests), but there have been significant updates in the past month. I've added QuantLib's Monte Carlo simulation features, as well

Re: [julia-users] WARNING: Base.String is deprecated [Help defining my own "String"]

2016-04-04 Thread Eric Forgy
Hi Yichao, > On 4 Apr 2016, at 10:53 PM, Yichao Yu wrote: > Do you define your own `String` type in `MyModule` that is different > from `Base.String`. Yeah. I just left the office and in a taxi, but this is it: type String{T<:AbstractString} value::T End

Re: [julia-users] WARNING: Base.String is deprecated [Help defining my own "String"]

2016-04-04 Thread Yichao Yu
On Mon, Apr 4, 2016 at 10:53 AM, Yichao Yu wrote: > On Mon, Apr 4, 2016 at 10:27 AM, Eric Forgy wrote: >> Hello, >> >> I am doing some work trying to get Julia to play nice with .NET and want to >> define some Julia types corresponding to the Entity Data Model. >> >> So far everything is good, bu

Re: [julia-users] WARNING: Base.String is deprecated [Help defining my own "String"]

2016-04-04 Thread Yichao Yu
On Mon, Apr 4, 2016 at 10:27 AM, Eric Forgy wrote: > Hello, > > I am doing some work trying to get Julia to play nice with .NET and want to > define some Julia types corresponding to the Entity Data Model. > > So far everything is good, but I am getting irritating deprecation warnings > about Base

[julia-users] WARNING: Base.String is deprecated [Help defining my own "String"]

2016-04-04 Thread Eric Forgy
Hello, I am doing some work trying to get Julia to play nice with .NET and want to define some Julia types corresponding to the Entity Data Model . So far everything is good, but I am getting irritating deprecation warnings about Base.Str

Re: [julia-users] julia-emacs ...

2016-04-04 Thread Andrea Pagnani
Ok ... so just a git clone https://github.com/JuliaLang/julia-emacs makes the job + changing the path of where the julia-mode.el is in the .emacs file. Thanks, and sorry for the noise. A On Monday, April 4, 2016 at 11:21:41 AM UTC+2, Stefan Karpinski wrote: > > The julia-emacs repo is not a J

[julia-users] Re: Read External file data

2016-04-04 Thread tannirind
Thank you Fred for your cooperation BR, On Monday, April 4, 2016 at 3:59:03 PM UTC+2, Fred wrote: > > Hi, > > Of course it is possible : > > https://en.wikibooks.org/wiki/Introducing_Julia/Working_with_text_files > > You can read data frames to : > > https://dataframesjl.readthedocs.org/en/lates

[julia-users] Re: Read External file data

2016-04-04 Thread Fred
Hi, Of course it is possible : https://en.wikibooks.org/wiki/Introducing_Julia/Working_with_text_files You can read data frames to : https://dataframesjl.readthedocs.org/en/latest/io.html

Re: [julia-users] Apache Arrow/Feather

2016-04-04 Thread Tamas Papp
https://github.com/JuliaStats/Feather.jl On Mon, Apr 04 2016, Michael Turok wrote: > Any thoughts here on the efforts to build a unified dataframe format > between R and Python via Apache Arrow (and Feather?) > > Regards, > Michael

Re: [julia-users] Apache Arrow/Feather

2016-04-04 Thread Stefan Karpinski
There's been some discussion on julia-dev: https://groups.google.com/forum/#!topic/julia-dev/qRtkiBAbM9w https://groups.google.com/forum/#!topic/julia-dev/pFJS4oxKAFE On Mon, Apr 4, 2016 at 9:32 AM, Michael Turok wrote: > Any thoughts here on the efforts to build a unified dataframe format > be

[julia-users] MethodError: '+' has no method matching +(::DateTime, ::Int64)

2016-04-04 Thread Josh
When trying to increment and decrement dates I get the method error stated above. For example with: now() + Dates.day(1) I get the error: *ERROR: MethodError: `+` has no method matching +(::DateTime, ::Int64)* Closest candidates are: +(::Any, ::Any, *::Any*, *::Any...*) +(*::Int64*, ::I

[julia-users] Re: possibility to define a type that is subtype of more than one supertype

2016-04-04 Thread Hans-Peter
Not possible. See this issue where it has been discussed: https://github.com/JuliaLang/julia/issues/5. I think traits (mauro3/Traits.jl) could be helpful for you (just a guess, don't know trait specifics atm)

[julia-users] Apache Arrow/Feather

2016-04-04 Thread Michael Turok
Any thoughts here on the efforts to build a unified dataframe format between R and Python via Apache Arrow (and Feather?) Regards, Michael

[julia-users] Re: possibility to define a type that is subtype of more than one supertype

2016-04-04 Thread Jason Merrill
It is not currently possible for a type to have multiple direct supertypes. You might be interested in the Traits package: https://github.com/mauro3/Traits.jl If you don't want to add a dependency, you can use the "traits trick" directly, which seems to have first been described here: https://

[julia-users] Read External file data

2016-04-04 Thread tannirind
How we can read data from external file using julia? Tank you for your time. Best Regards, Tanveer Iqbal

[julia-users] possibility to define a type that is subtype of more than one supertype

2016-04-04 Thread Martin Kuzma
Hi, since abstract types cant have any fields I think of them as interfaces. I want to specify that a type is subtype of more than one supertype. I tried this: abstract A abstract B type T <: A, B end But I cant do that. Is it even possible to do? Am I using a wrong syntax? Martin.

Re: [julia-users] Doing linear algebra on nested subarrays ... quickly

2016-04-04 Thread Tim Holy
Have you tried `sub`? --Tim On Sunday, April 03, 2016 04:54:58 PM Gregor Robinson wrote: > I'm working on a problem where I do linear algebra on progressively larger > n by n submatrices in the upper-left of a (potentially large) N by N > matrix. If I'm using a plain ol' dense matrix, the linear

Re: [julia-users] Re: Julia is a great idea, but it disqualifies itself for a big portion of its potential consumers

2016-04-04 Thread Stefan Karpinski
Number does not imply or assume commutativity. The Quaternions package provides a Quaternion type which is a subtype of Number. Rational, however, only allows integer numerators and denominators. Since integer multiplication is commutative, rational multiplication is too. But I still think it best

Re: [julia-users] Re: Julia is a great idea, but it disqualifies itself for a big portion of its potential consumers

2016-04-04 Thread Jeffrey Sarnoff
Since supertype(Number) == Any, the most abstract number-like entity that Julia has to offer with the current hierarchy is Number. Most packages I have seen that implement number-like types which are outside of the Reals use Number as their supertype. This is more helpful, generally, than hav

Re: [julia-users] Re: Julia is a great idea, but it disqualifies itself for a big portion of its potential consumers

2016-04-04 Thread Sheehan Olver
Rational is currently restricted to numbers: Rational{T<:Number}. I’m assuming Number implicitly means commutative number (i.e., not Quaternion). > On 4 Apr 2016, at 8:55 PM, Tim Holy wrote: > > On Sunday, April 03, 2016 09:28:28 AM Scott Jones wrote: >> With \\, would you worry a

Re: [julia-users] Re: Julia is a great idea, but it disqualifies itself for a big portion of its potential consumers

2016-04-04 Thread Tim Holy
On Sunday, April 03, 2016 09:28:28 AM Scott Jones wrote: > With \\, would you worry about confusion from the fact that in a \\ b, a is > > > in > > the denominator? Especially if it gets called the "integer division > > operator." > > It might confuse some of the mathematicians, used to a \ b as

Re: [julia-users] Re: Julia is a great idea, but it disqualifies itself for a big portion of its potential consumers

2016-04-04 Thread Sheehan Olver
Why not just add a shortcut in your editor that automatically expands \\ to *÷?* On Monday, April 4, 2016 at 7:12:44 PM UTC+10, Scott Jones wrote: > > > > On Sunday, April 3, 2016 at 12:09:35 PM UTC-4, Tim Holy wrote: >> >> Indexing with // is a bit undesirable because 6//3 gets simplified to >>

Re: [julia-users] julia-emacs ...

2016-04-04 Thread Stefan Karpinski
The julia-emacs repo is not a Julia package – the julia package manager doesn't install emacs modes. The julia-emacs repo has some brief instruction on how to install the mode: https://github.com/JuliaLang/julia-emacs#install. On Mon, Apr 4, 2016 at 5:02 AM, Andrea Pagnani wrote: > Dear all, > >

Re: [julia-users] Re: Julia is a great idea, but it disqualifies itself for a big portion of its potential consumers

2016-04-04 Thread Scott Jones
On Sunday, April 3, 2016 at 12:09:35 PM UTC-4, Tim Holy wrote: > > Indexing with // is a bit undesirable because 6//3 gets simplified to 2//1 > upon > construction, and there's no reason to pay the cost of that operation. > That was Eric's idea - I was strictly talking about integer division,

Re: [julia-users] Re: Julia is a great idea, but it disqualifies itself for a big portion of its potential consumers

2016-04-04 Thread Scott Jones
On Sunday, April 3, 2016 at 12:20:44 PM UTC-4, Stefan Karpinski wrote: > > I question the alleged ubiquity of integer division. This is not an > operation I find myself needing all that often. Of course, everyone's > programming needs are different, but I just don't find myself wanting the > int

[julia-users] Doing linear algebra on nested subarrays ... quickly

2016-04-04 Thread Gregor Robinson
I'm working on a problem where I do linear algebra on progressively larger n by n submatrices in the upper-left of a (potentially large) N by N matrix. If I'm using a plain ol' dense matrix, the linear algebra takes place 30 times faster when I plug it into BLAS compared to a (fairly naive, tbh

[julia-users] julia-emacs ...

2016-04-04 Thread Andrea Pagnani
Dear all, I discovered that emacs support that after #15694 has its own repository. After a Pkg.update() in 0.5 I tried: Pkg.add("julia-emacs") #no success Pkg.clone("https://github.com/JuliaLang/julia-emacs";) #no success Pkg.clone("https://g

Re: [julia-users] List comprehension for 1 <= i < j <= 4

2016-04-04 Thread Tomas Lycken
If this is something you do often, you could create a custom iterator that would allow you to do l = [(i,j) for (i,j) in DiagonalIterator(1:4, i -> i+1:4)] This would require defining a type DiagonalIterator with a constructor with that signature, as well as methods for start, next, done and

Re: [julia-users] Re: performace of loops Julia vs Blas

2016-04-04 Thread Igor Cerovsky
Thank you all for suggestions and troubleshooting. I'll try 0.4.5 Julia version later, post results. On Thursday, 24 March 2016 14:31:29 UTC+1, Yichao Yu wrote: > > On Thu, Mar 24, 2016 at 9:26 AM, Erik Schnetter > wrote: > > Using only SSE2 instead of AVX is slower by a factor of two. > > >

Re: [julia-users] Re: dispatch on type of tuple from ...

2016-04-04 Thread Tamas Papp
This is a neat solution, thanks! But I still think that there is a corner case for which there is no syntax, so I filed #15758. Best, Tamas On Mon, Apr 04 2016, via julia-users wrote: > I saw your repost on julia-dev, but replying here. > > m2 won't work because it expects a series of tuple arg