[julia-users] How does promote_op work?

2016-09-22 Thread Sheehan Olver
The subject says it all: it looks like one can override promote_op to support the following behaviour: *julia> **import Base.+* *julia> **immutable Foo end* WARNING: Method definition (::Type{Main.Foo})() in module Main at REPL[5]:1 overwritten at REPL[10]:1. *julia> **+(a::Foo,b::Foo) = 1

[julia-users] Re: How does promote_op work?

2016-09-23 Thread Sheehan Olver
the operation you are doing is > most likely not type stable. So instead of specializing it you could try to > remove any type instabilities in the method definitions over your types. > > On Friday, September 23, 2016 at 5:35:05 AM UTC+2, Sheehan Olver wrote: >> >> >>

Re: [julia-users] Re: How does promote_op work?

2016-09-23 Thread Sheehan Olver
uses > the types of each element to build the array. When there are no elements it > doesn't know what type to choose. > > On Friday, September 23, 2016 at 11:47:11 PM UTC+2, Sheehan Olver wrote: > OK, here's a better example of the issue: in the following code I would want

[julia-users] Good iOS keyboard for Julia?

2016-10-23 Thread Sheehan Olver
Anyone know of a good iPhone/iPad keyboard for typing out Julia and Markdown code? I think I just want a regular keyboard with extra rows with common keys like `, $, ^, 0…9, etc. I found "SciKey" but it doesn't look like it does everything on one screen. "Markdown Keyboard" looks better, but

[julia-users] Re: 3D plot (Plots)

2016-10-29 Thread Sheehan Olver
surface(x,y,z) (or maybe surface(x,y,z')). Note that if x and y are matrices (so non-rectangular grid), then I think only the pyplot and glvisualize backends will work. On Sunday, October 30, 2016 at 10:06:04 AM UTC+11, digxx wrote: > > is it possible to somehow 3d plot the following input?

[julia-users] Re: Fast vector element-wise multiplication

2016-11-01 Thread Sheehan Olver
Should this be added to a package? I imagine if the arrays are on the GPU (AFArrays) then the operation could be much faster, and having a consistent name would be helpful. On Wednesday, October 7, 2015 at 1:28:29 AM UTC+11, Lionel du Peloux wrote: > > Dear all, > > I'm looking for the fastest

Re: [julia-users] Re: Fast vector element-wise multiplication

2016-11-01 Thread Sheehan Olver
update of A scaled by B (Tomas' solution). > >> On Tuesday, November 1, 2016 at 4:39:15 PM UTC-7, Sheehan Olver wrote: >> Should this be added to a package? I imagine if the arrays are on the GPU >> (AFArrays) then the operation could be much faster, and having a consi

Re: [julia-users] Re: Fast vector element-wise multiplication

2016-11-01 Thread Sheehan Olver
nderstand it, the .* will fuse, but the .= will not (until 0.6?), so A >> will be rebound to a newly allocated array. If my understanding is wrong >> I'd love to know. There have been many times in the last few days that I >> would have used it... >> >>> On Tue

Re: [julia-users] Re: Fast vector element-wise multiplication

2016-11-02 Thread Sheehan Olver
t to call a vectorized GPU > function which will do the computation in parallel on the GPU. ArrayFire's > mathematical operations are already overloaded to do this, but I don't think > they can fuse. > > On Tuesday, November 1, 2016 at 8:06:12 PM UTC-7, Sheehan Olver wr

[julia-users] unsafe_wrap from a pointer from a Julia array

2016-11-15 Thread Sheehan Olver
In some high performance code I want to convert an 2 x n `Matrix{Float64}` to a n long `Matrix{Vec{2,Float64}}`with no memory allocation (both types will store memory in the same order). The following works: *v=rand(2,100)* *w=unsafe_wrap(Vector{Vec{2,Float64}},* *reinterpret(Ptr{V

Re: [julia-users] Re: unsafe_wrap from a pointer from a Julia array

2016-11-16 Thread Sheehan Olver
93,0.266559⟩ > > >> Den onsdag 16 november 2016 kl. 05:52:14 UTC+1 skrev Sheehan Olver: >> >> In some high performance code I want to convert an 2 x n `Matrix{Float64}` >> to a n long `Matrix{Vec{2,Float64}}`with no memory allocation (both types >> will s

Re: [julia-users] Re: unsafe_wrap from a pointer from a Julia array

2016-11-16 Thread Sheehan Olver
25⟩ > Float64⟨0.874891,0.400077⟩ > Float64⟨0.874593,0.266559⟩ > > > Den onsdag 16 november 2016 kl. 05:52:14 UTC+1 skrev Sheehan Olver: > > In some high performance code I want to convert an 2 x n `Matrix{Float64}` to > a n long `Matrix{Vec{2,Float64}}`with no memory allocation

Re: [julia-users] Re: unsafe_wrap from a pointer from a Julia array

2016-11-16 Thread Sheehan Olver
Though that code works too for FixedSizeArrays > On 17 Nov. 2016, at 8:53 am, Sheehan Olver wrote: > > Oh wait, I was referring to Vec from FixedSizeArrays.jl , not from SIMD > > >> On 16 Nov. 2016, at 6:39 pm, Gunnar Farnebäck > <mailto:gun...@lysator.liu.se&g

[julia-users] disable @inbounds in tests?

2015-01-18 Thread Sheehan Olver
Is there a way to disable @inbounds in tests? I made a change that's causing a segfault, and can't figure out where the error is.

Re: [julia-users] disable @inbounds in tests?

2015-01-18 Thread Sheehan Olver
If I’m still getting a segfault, what else could it be? > On 18 Jan 2015, at 9:53 pm, Isaiah Norton wrote: > > julia --check-bounds=yes > > On Sun, Jan 18, 2015 at 11:37 PM, Sheehan Olver <mailto:dlfivefi...@gmail.com>> wrote: > Is there a way to dis

Re: [julia-users] disable @inbounds in tests?

2015-01-19 Thread Sheehan Olver
Hmm, never managed to get a short piece of code but the culprit was function ultraint{T<:Number}(v::Vector{T}) cat(1, zero(T), v./[1:length(v)]) end Rewriting this seems to have fixed the issue… > On 19 Jan 2015, at 12:05 am, Jiahao Chen wrote: > > In general, a useful strategy is to ma

[julia-users] Elegant way of dealing with evaluating on branch cuts of sqrt(z-1).*sqrt(z+1) ?

2015-02-12 Thread Sheehan Olver
For z < -1 the branch cuts cancel and the function should be equivalent to -sqrt(z^2-1) (the only non-removeable branch cut is along [-1,1]), but in Julia it is not defined. I'm wondering if there is a special function in Julia that can take care of this, or is the only solution to write my o

Re: [julia-users] Elegant way of dealing with evaluating on branch cuts of sqrt(z-1).*sqrt(z+1) ?

2015-02-12 Thread Sheehan Olver
ificial Intelligence Laboratory > > On Thu, Feb 12, 2015 at 10:05 PM, Sheehan Olver <mailto:dlfivefi...@gmail.com>> wrote: > > For z < -1 the branch cuts cancel and the function should be equivalent to > -sqrt(z^2-1) (the only non-removeable branch cut is along [-1,1

Re: [julia-users] Elegant way of dealing with evaluating on branch cuts of sqrt(z-1).*sqrt(z+1) ?

2015-02-12 Thread Sheehan Olver
(domain(f))) A=Derivative()-f*differentiate(f)/(f^2-1) linsolve([B,A],sqrtx2(first(f));tolerance=length(f)*10E-15) end > On 13 Feb 2015, at 3:11 pm, Sheehan Olver wrote: > > thanks! Will take a look. > > For my own case I realized I could avoid the issue by solvin

[julia-users] Is it OK (stylistically) to override missing Base functionality in a package?

2015-02-25 Thread Sheehan Olver
I'm wondering if overrides that only involve Base types to implement missing functionality is considered bad form. For example, the following is convenient for getting the real type of a Complex: Base.real{T<:Real}(::Type{Complex{T}})=T Base.real{T<:Real}(::Type{T})=T But I suppose

Re: [julia-users] Is it OK (stylistically) to override missing Base functionality in a package?

2015-02-25 Thread Sheehan Olver
I think this is a case where I know the answer but pretending I don’t :) > On 26 Feb 2015, at 6:06 pm, Ivar Nesje wrote: > > We have seen quite a few instances where Base functions were extended with > methods without restriction to non-Base types, and it caused problems when > Julia was upd

Re: [julia-users] Is it OK (stylistically) to override missing Base functionality in a package?

2015-02-25 Thread Sheehan Olver
Maybe a better alternative is to create an internal function with the same name: real(v…)=Base.real(v…) real{T<:Real}(::Type{Complex{T}})=T real{T<:Real}(::Type{T})=T This will avoid the override leaking from the package. > On 26 Feb 2015, at 6:07 pm, Shee

[julia-users] Override ' but not ctranspose?

2015-02-28 Thread Sheehan Olver
Is it possible to override just ' without overriding ctranspose? I want to use f' to mean differentiation but leave ctranspose(f) to mean conjugate transpose. (Current alternative is to use conj(f.') which I guess is not so bad.)

Re: [julia-users] Override ' but not ctranspose?

2015-03-01 Thread Sheehan Olver
That's too bad. I'd be in favour of having an intermediate definition (Base.tick maybe?) that could be overridden without overriding ctranspose too..I can file an issue unless there's a good argument against that Sent from my iPhone > On 2 Mar 2015, at 9:04 am, Steven G. Johnson wrote: > > N

[julia-users] How to get template value of abstract type?

2015-03-03 Thread Sheehan Olver
Suppose I have abstract Foo{T} immutable Foo1{T} <:Foo{T} end immutable Foo2{T} <:Foo{T} end How can I write a function that returns T given the type? E.g.: I want to do Base.eltype(::Type{Foo{T}})=T But this won't work for eltype(Foo1{T})

Re: [julia-users] How to get template value of abstract type?

2015-03-03 Thread Sheehan Olver
Beautiful!! Now to rewrite the 100 for loops I made over every possible choice of T :) > On 4 Mar 2015, at 2:01 pm, Keno Fischer wrote: > > Base.eltype{T<:Foo}(::Type{T})=T.parameters[1] > > should work > > On Tue, Mar 3, 2015 at 9:58 PM, Sheehan

Re: [julia-users] How to get template value of abstract type?

2015-03-03 Thread Sheehan Olver
er possible type definitions, > such as > > type Foo2 <: Foo{Int}; end > > or > > type Foo3{A, T} <: Foo{T}; end > > > On Tue, Mar 3, 2015 at 10:03 PM Sheehan Olver <mailto:dlfivefi...@gmail.com>> wrote: > > Beautiful!! Now to rewr

[julia-users] L1 Minimization?

2015-03-05 Thread Sheehan Olver
Are there any packages that can do L1 minimization? I want to do something like min ||Lx||_1 subject to ||x||_2=1

Re: [julia-users] Re: L1 Minimization?

2015-03-05 Thread Sheehan Olver
Hmm, maybe I’m posing the wrong problem then… I wanted a fast way to calculate the null space of a sparse matrix, where the basis spanning the null space is also sparse. And the dimension of the vector space is in the millions. > On 6 Mar 2015, at 4:51 am, Iain Dunning wrote: >

Re: [julia-users] Re: L1 Minimization?

2015-03-07 Thread Sheehan Olver
No reason. Thanks for the suggestion! On Saturday, March 7, 2015 at 3:26:00 AM UTC+11, Steven G. Johnson wrote: > > > > On Thursday, March 5, 2015 at 4:58:10 PM UTC-5, Sheehan Olver wrote: >> >> >> Hmm, maybe I’m posing the wrong problem then… I wanted a fast

[julia-users] Re: Function roots() in package Polynomial

2015-03-11 Thread Sheehan Olver
Thought I'd do a self-plug and mention that you can do this and other polynomial manipulations in ApproxFun.jl (which uses a colleague matrix and gets 10 digits accuracy for this example): using ApproxFun f=Fun(x->prod([1.0:20.0]-x),[0,20],21) roots(f) On Tuesday, May 6, 2014 at 6:14:44 AM UTC+

[julia-users] Plotting table of numbers in Gadfly?

2015-03-12 Thread Sheehan Olver
I have a table of numbers that I want to line plot in Gadfly: i.e., each column corresponds to values of a function. Is this possible without creating a DataFrame?

Re: [julia-users] Plotting table of numbers in Gadfly?

2015-03-13 Thread Sheehan Olver
(x=xgrid, y=data[i, :], Geom.line, > Theme(default_color=cm[i])) for i=1:nrows]..., > Guide.manual_color_key("row id", ["row $i" for i=1:nrows], cm), > ) > > Thanks, > > Jiahao Chen > Staff Research Scientist > MIT Computer Science and Artifici

Re: [julia-users] Plotting table of numbers in Gadfly?

2015-03-14 Thread Sheehan Olver
ithub.com/dcjones/Gadfly.jl/issues/563 > <https://github.com/dcjones/Gadfly.jl/issues/563> > > The desire for a separate plotting semantics is indicative of some > shortcoming. So I hope we can resolve that, and there won't be a need to wrap > Gadfly. > > > On Frida

[julia-users] Parallel performance test question

2015-03-17 Thread Sheehan Olver
Hi, I've created the following to test the performance of parallel processing on our departments server. But the @everywhere isn't working because "ERROR: k not defined". What's wrong? And any advice on improving the test? (Right now for small n there is little benefit for > 12 processes,

Re: [julia-users] Parallel performance test question

2015-03-18 Thread Sheehan Olver
> is > for p in procs() > @spawnat p blas_set_num_threads(k) > end > > 2015-03-17 23:19 GMT-04:00 Sheehan Olver : >> Hi, >> >> I've created the following to test the performance of parallel processing on >> our departments server. But the @everyw

[julia-users] Re: ApproxFun Boundary Conditions

2015-03-21 Thread Sheehan Olver
It's expanding f1-f4 as bivariate functions on [-1,1]^2, but instead you want to expand them as univariate functions on [-1,1]: d = Interval()^2 f1 = Fun(x->0) f2 = Fun(x->1 / ((1 + x)^2 + 1)) f3 = Fun(y->y / (1 + y^2)) f4 = Fun(y->y / (4 + y^2)) u = [dirichlet(d),lap(d)]\[f1,f2,f3,f4] On S

Re: [julia-users] Re: ApproxFun Boundary Conditions

2015-03-22 Thread Sheehan Olver
4/ApproxFun/src/PDE/pdesolve.jl:138 > > > I am not clear which domains are incompatible. > > Dominic Steinitz > domi...@steinitz.org <mailto:domi...@steinitz.org> > http://idontgetoutmuch.wordpress.com <http://idontgetoutmuch.wordpress.com/> > On 22 Mar 2015, at 02:25, Sheehan Olve

[julia-users] Re: Rationale behind @-sign for macro usage?

2015-03-22 Thread Sheehan Olver
I quite like this comment from the Stack Exchange :) "Julia programmers are "special" in a way that other programmers aren't. An obsessive preoccupation with the @ sign is only the beginning. Beware. – Sam Axe yesterday

Re: [julia-users] Rationale behind @-sign for macro usage?

2015-03-22 Thread Sheehan Olver
;Kevin > > On Sunday, March 22, 2015, Sheehan Olver <mailto:dlfivefi...@gmail.com>> wrote: > I quite like this comment from the Stack Exchange :) > > "Julia programmers are "special" in a way that other programmers aren't. An > obsessive preoccu

Re: [julia-users] Re: ApproxFun Boundary Conditions

2015-03-23 Thread Sheehan Olver
package. > > Dominic Steinitz > domi...@steinitz.org <mailto:domi...@steinitz.org> > http://idontgetoutmuch.wordpress.com <http://idontgetoutmuch.wordpress.com/> > On 22 Mar 2015, at 09:25, Sheehan Olver <mailto:dlfivefi...@gmail.com>> wrote: > >> Yo

[julia-users] How to test argument types available on a Function?

2015-03-27 Thread Sheehan Olver
I want to takes a user input a function that can be defined to take either a (1) scalar (2) two arguments or (3) a tuple. Then I want to determine which category the user input (1,2 or 3) is in. The user input can either be an anonymous function or a define function. Right now I do this w

Re: [julia-users] How to test argument types available on a Function?

2015-03-27 Thread Sheehan Olver
In ApproxFun, a user supplied function is approximated. the approximation depends on whether the function is univariate or bivariate Sent from my iPad > On 28 Mar 2015, at 4:49 pm, Toivo Henningsson wrote: > > The method_exists function would probably be a slightly cleaner way to do > this

Re: [julia-users] How to test argument types available on a Function?

2015-03-28 Thread Sheehan Olver
It currently works like this, which does work with f(x)=x, f(x,y) = x+y: try f(0) catch try f(0,0) catch f((0,0)) end end This code is meant for REPL usage primarily, and so the convenience of typing just Fun(f) is worth having such

Re: [julia-users] How to test argument types available on a Function?

2015-03-28 Thread Sheehan Olver
Great, thanks! It looks like applicable doesn’t work on anonymous functions, which seems like a bug. I guess I’ll file a ticket. > On 29 Mar 2015, at 7:47 am, Miles Lubin wrote: > > Take a look at applicable(). > > On Saturday, March 28, 2015 at 4:30:09 PM UTC-4

Re: [julia-users] How to test argument types available on a Function?

2015-03-28 Thread Sheehan Olver
:20 am, Toivo Henningsson wrote: > > How about having an optional ndims argument at least, for non-REPL usage? > > On Sat, Mar 28, 2015 at 9:30 PM, Sheehan Olver <mailto:dlfivefi...@gmail.com>> wrote: > It currently works like this, which does work with f(x)=x, f(x,y) =

Re: [julia-users] How to test argument types available on a Function?

2015-03-28 Thread Sheehan Olver
Hmm, this is surprising, how can you tell the difference between anonymous and named functions? g=x->x^2 foo(x,y)=1 typeof(g)==typeof(foo) #true > On 29 Mar 2015, at 7:50 am, Sheehan Olver wrote: > > > Great, thanks! It looks like applicable doesn’t work on anonymo

[julia-users] Re: Why is Gadfly so slow when plotting it's first plot?

2015-03-29 Thread Sheehan Olver
I think it's purposely slow, just to annoy Julia developers into implementing a system that saves compiles from previous sessions 😀 On Sunday, March 29, 2015 at 12:00:28 AM UTC+11, Steven Sagaert wrote: > > Hi, > I use Gadfly to create simple barplots & save them as SVG. Since this is > for usa

Re: [julia-users] How to test argument types available on a Function?

2015-03-29 Thread Sheehan Olver
, > --Tim > > On Sunday, March 29, 2015 09:06:05 AM Sheehan Olver wrote: >> Hmm, this is surprising, how can you tell the difference between anonymous >> and named functions? >> >> g=x->x^2 >> foo(x,y)=1 >> typeof(g)==typeof(foo) #true >> >

[julia-users] Weird promotion bug

2015-03-29 Thread Sheehan Olver
I have a weird bug in the promotion system where promote_type(a,b) is not equal to promote_type(b,a). It looks like the function call on line 101 of promotion.jl for one ordering is being called even though a≠b. a and b are different template variable choices of the same type. @code_typed

Re: [julia-users] Weird promotion bug

2015-03-29 Thread Sheehan Olver
l{Float64} instead of just Interval (which resolves to Interval{T<:Number}). > On 30 Mar 2015, at 11:42 am, Sheehan Olver wrote: > > > > I have a weird bug in the promotion system where promote_type(a,b) is not > equal to promote_type(b,a). It looks like the function call

[julia-users] Usage of floating point template arguments with many different values

2015-04-07 Thread Sheehan Olver
In Julia v0.4 its possible to do the following *immutable Foo{a} end* *Foo{0.1}()* *Foo{0.2}()* Is it bad performance-wise if the parameter a takes many different values? I.e. what's the growth in "complexity" of Julia as the number of types increases? (Ignoring the cost of recompiling co

[julia-users] Re: calling Julia from Mathematica

2015-04-07 Thread Sheehan Olver
I would be very interested in this. At the moment I get by with routines to pass arrays between the two: tomm(A::Array)=writecsv("/tmp/juliatomm.csv",A) frommm()=readcsv("/tmp/mmtojulia.csv") FromJulia[]:=Import["/tmp/juliatomm.csv"] ToJulia[A]:=Export["/tmp/mmtojulia.csv", A] On Friday, Apri

Re: [julia-users] Usage of floating point template arguments with many different values

2015-04-07 Thread Sheehan Olver
The current problem is f=Fun(x->x^2,Chebyshev(Interval(a,b))) represents a function on [a,b] as type Fun{Float64,Chebyshev}. But sometimes one needs to convert numbers to functions a la convert(typeof(f),5) e.g., as part of creating the vector [f,5]. Since the parame

Re: [julia-users] Usage of floating point template arguments with many different values

2015-04-08 Thread Sheehan Olver
5, at 6:41 am, Steven G. Johnson wrote: > > > >> On Tuesday, April 7, 2015 at 5:53:09 PM UTC-4, Sheehan Olver wrote: >> >> The current problem is >> >> f=Fun(x->x^2,Chebyshev(Interval(a,b))) >> >> represents a function on

[julia-users] 0.4: why is floor(Integer,x) recommended in place of ifloor but round(Int,x) recommended in place of int?

2015-04-09 Thread Sheehan Olver
Below deprecation warnings seem inconsistent. Is there something I'm missing? PS Not sure the "right" procedure for a possible git-issue that I'm not sure is actually an issue: should I just file the issue and let it be closed if its not a bug, or post on julia-users first to double check?

[julia-users] Re: GPU-ODE

2015-04-09 Thread Sheehan Olver
What about CUDA.jl (not updated for a year) and OenCL.jl (updated 3 months ago)? I have no experience with either, so am just curious whether or not these are not usable. On Saturday, April 4, 2015 at 5:49:56 PM UTC+11, Viral Shah wrote: > > Do you mean writing ODE solvers in Julia that run o

[julia-users] Re: ApproxFun First Order PDE Question

2015-04-12 Thread Sheehan Olver
You have too many boundary conditions: dirichlet conditions on a rectangle defaults to conditions on all 4 sides. Imposing on just the left side gives an answer: d = domain(Fun(identity,[0.0,1.0])) f = Fun(x->exp(-x^2),d) D = Derivative(d) L = 2.0D⊗I+I⊗D u = [ldirichlet(d)⊗I,L]\[f] though you

[julia-users] 0.4: How to do (Int...)

2015-04-18 Thread Sheehan Olver
I used to have a type definition as a tuple of ints of variable length immutable foo d::(Int...) end In the latest 0.4 I tried to do Tuple{Int...} but it doesn't work.What should I do? (Maybe the answer is just change to Vector{Int}?)

Re: [julia-users] Re: 0.4: How to do (Int...)

2015-04-18 Thread Sheehan Olver
Cool! Is there a way to specify exactly the number? I actually know the number of args as a templated variable, so would want to do: immutable Foo{n} d::Tuple{Vararg{Int,n}} end > On 19 Apr 2015, at 9:39 am, Steven G. Johnson wrote: > > Tuple{Vararg

[julia-users] Possible to see path of Warning?

2015-04-21 Thread Sheehan Olver
Is it possible to get julia to print out the path where a warning occurs, like for errors? Or maybe turn all warnings into errors? Having trouble hunting down a Warning: import of Base.real into ApproxFun conflicts with an existing identifier; ignored.

Re: [julia-users] Possible to see path of Warning?

2015-04-21 Thread Sheehan Olver
Artificial Intelligence Laboratory > > On Tue, Apr 21, 2015 at 8:11 PM, Sheehan Olver <mailto:dlfivefi...@gmail.com>> wrote: > Is it possible to get julia to print out the path where a warning occurs, > like for errors? Or maybe turn all warnings into errors? Having tr

[julia-users] Re: Jiahao's talk on Free probability, random matrices and disorder in organic semiconductors

2015-04-22 Thread Sheehan Olver
Great talk! On Thursday, April 23, 2015 at 4:52:57 AM UTC+10, Nick Henderson wrote: > > Hi All, > > Just wanted to announce that we posted Jiahao's recent talk on our youtube > page: > > https://www.youtube.com/watch?v=68yy33jOkOs > > Thanks again to both Jiahao and Andreas for the great talks!

[julia-users] Re: Mysterious errors due to new Tuple{S,V}

2015-05-13 Thread Sheehan Olver
This is for latest build of 0.4 on Mac OS X Yosemite On Thursday, May 14, 2015 at 2:51:07 PM UTC+10, Sheehan Olver wrote: > > > I get the error message below, and cannot find any sign of the cause. > With debug statements, I found that its dying trying to call a function > wit

[julia-users] Mysterious errors due to new Tuple{S,V}

2015-05-13 Thread Sheehan Olver
I get the error message below, and cannot find any sign of the cause. With debug statements, I found that its dying trying to call a function with the signature function linsolve{T<:Operator,N<:Number}(A::Vector{T},b::Array{N};tolerance=0.01,maxlength=100) ... end Any thoughts? Maybe

Re: [julia-users] Re: Mysterious errors due to new Tuple{S,V}

2015-05-14 Thread Sheehan Olver
> > On Thu, May 14, 2015 at 11:02 AM, David P. Sanders > wrote: >> >> >> El miércoles, 13 de mayo de 2015, 23:51:33 (UTC-5), Sheehan Olver escribió: >>> >>> This is for latest build of 0.4 on Mac OS X Yosemite >>> >>> On Thursday, May 1

Re: [julia-users] Re: Mysterious errors due to new Tuple{S,V}

2015-05-14 Thread Sheehan Olver
:RS end > On 15 May 2015, at 1:09 am, Yichao Yu wrote: > > On Thu, May 14, 2015 at 11:02 AM, David P. Sanders <mailto:dpsand...@gmail.com>> wrote: >> >> >> El miércoles, 13 de mayo de 2015, 23:51:33 (UTC-5), Sheehan Olver escribió: >>> >>

[julia-users] Is Julia "ready" for use in an undergraduate mathematical computing course?

2015-05-15 Thread Sheehan Olver
I'm moving a Mathematical Computing course from Fortran to another language. I'd like to do Julia, but after a bad experience with students trying to use Julia box, and the difficulty with plotting packages, I'm a bit wary. Other options are Matlab (which is really easy for students but te

Re: [julia-users] Re: Is Julia "ready" for use in an undergraduate mathematical computing course?

2015-05-16 Thread Sheehan Olver
m/stevengj/julia-mit > > For homework assignments, I have them email their notebooks to the TAs, who > print them out and grade them. (That way, only the TAs need to have LaTeX, > Pandoc etc installed to get nice printed output from Jupyter notebooks.) > >> On Frida

[julia-users] How to debug inlining wrong type:

2015-05-20 Thread Sheehan Olver
I have an example that is along the lines of abstract Foo{T} Base.eltype{T}(::Foo{T})=T function foo(A::Foo) # assumes eltype(A) is a matrix and eltype(eltype(A)) is a number ret=Array(Foo{eltype(eltype(T))},0) push!(ret,anotherfunction(A)) end This is returning an error like expec

[julia-users] ANN: ApproxFun v0.0.6 with support for BigFloat, Julia v0.4

2015-05-21 Thread Sheehan Olver
I tagged a new version of ApproxFun https://github.com/ApproxFun/ApproxFun.jl which is a package for approximating functions and solving ODEs and PDEs with spectral methods. It now supports Julia v0.4 (0.4.0-dev+4921). It also supports high precision solution of ODEs: the example bel

[julia-users] Guidelines for overriding Base.convert?

2015-06-24 Thread Sheehan Olver
Is there a guide/good guidelines for overriding Base.convert? Is it allowed for a convert routine to ever return a different type than requested? My overrides (in a fairly deep type hierarchy) seem to be triggering numerous bugs in Julia 0.4, I believe because of issues with type inference

[julia-users] How to debug "Illegal Instruction" in 0.4?

2015-06-24 Thread Sheehan Olver
I got the following crash signal (4): Illegal instruction: 4 unknown function (ip: 0x316f9ff7a) Illegal instruction: 4 with no other information given in 0.4 master. I suppose this is a bug in Julia itself, but without a stack trace it's hard to narrow down. Any suggestions?

Re: [julia-users] Re: How to debug "Illegal Instruction" in 0.4?

2015-06-25 Thread Sheehan Olver
ulia-debug, and/or inside gdb or lldb? > > > On Thursday, June 25, 2015 at 12:08:51 AM UTC-4, Sheehan Olver wrote: > I got the following crash > > signal (4): Illegal instruction: 4 > > unknown function (ip: 0x316f9ff7a) > > Illegal instruction: 4 > > >

Re: [julia-users] Re: Guidelines for overriding Base.convert?

2015-06-25 Thread Sheehan Olver
end > > bar (generic function with 1 method) > > > > julia> convert(::Type{Foo},x::Int) = float(x) > > convert (generic function with 518 methods) > > > > julia> bar(1) > > > > signal (11): Segmentation fault: 11 > > >

Re: [julia-users] How to debug "Illegal Instruction" in 0.4?

2015-06-25 Thread Sheehan Olver
, June 25, 2015 at 7:41:26 AM UTC-4, Sheehan Olver wrote: > This is on OS X, julia v0.4 master > > How do I do julia-debug? > > >> On 25 Jun 2015, at 9:06 pm, Tony Kelman > >> wrote: >> >> Is this in a VM or some other unusual environment? Old hardware?

Re: [julia-users] How to debug "Illegal Instruction" in 0.4?

2015-06-25 Thread Sheehan Olver
;> On Thursday, June 25, 2015 at 8:27:34 PM UTC-4, Sheehan Olver wrote: >> Switching to juliadebug, I get >> >> ERROR: ReadOnlyMemoryError() >> >> >> still with no further information. I guess I can manually drill down to the >> offending line? >>

Re: [julia-users] Re: Guidelines for overriding Base.convert?

2015-06-25 Thread Sheehan Olver
n an issue? > >> On Thu, Jun 25, 2015 at 6:33 PM, Sheehan Olver wrote: >> Is that a bug in Julia that wrongly overloading convert is an unsafe >> operation? >> >> Sent from my iPad >> >>> On 26 Jun 2015, at 12:22 am, Simon Byrne wrote: >>>

Re: [julia-users] Re: Guidelines for overriding Base.convert?

2015-06-25 Thread Sheehan Olver
OK I submitted issue #11874 > On 26 Jun 2015, at 2:06 pm, Stefan Karpinski wrote: > > Thanks! > > On Thu, Jun 25, 2015 at 11:12 PM, Sheehan Olver <mailto:dlfivefi...@gmail.com>> wrote: > Yep I'll open an issue with Simons example. I had another issue w

Re: [julia-users] How to debug "Illegal Instruction" in 0.4?

2015-06-25 Thread Sheehan Olver
See issue #11874 for a similar example that caused the segfault > On 26 Jun 2015, at 1:11 pm, Sheehan Olver wrote: > > Actually, it turned out that the cause was another faulty convert > implementation, see other thread I started > > I'm filing an issue > >

[julia-users] How do I debug an Illegal Instruction crash on Travis?

2015-07-03 Thread Sheehan Olver
There is a bug that is causing julia to crash, but only on the Travis test machine, which is System: Linux (x86_64-linux-gnu) CPU: AMD Opteron(tm) Processor 6376 WORD_SIZE: 64 BLAS: libopenblas (NO_LAPACK NO_LAPACKE DYNAMIC_ARCH NO_AFFINITY Piledriver) LAPACK: liblapack.so.3 LIBM: libopenlibm L

[julia-users] Re: eig()/eigfact() performance: Julia vs. MATLAB

2015-07-12 Thread Sheehan Olver
I remember seeing this same performance gap before. I believe the problem is that OpenBLAS doesn't have the correct thread defaults. Here are other timings setting the threads directly: *julia> **blas_set_num_threads(1)* *julia> **@time eigfact(M);* elapsed time: 1.827510669 seconds (7999704

[julia-users] Re: eig()/eigfact() performance: Julia vs. MATLAB

2015-07-12 Thread Sheehan Olver
Sorry, forgot the timing with the default number of threads. *julia> **@time eigfact(M);* elapsed time: 2.261110895 seconds (79997048 bytes allocated, 2.05% gc time) On Monday, July 13, 2015 at 10:19:33 AM UTC+10, Sheehan Olver wrote: > > I remember seeing this same performance gap b

[julia-users] Warning: gc_disable() can cause Travis to kill process, and fail tests

2015-07-25 Thread Sheehan Olver
I spent a bit of time trying to figure out why tests were failing on Travis but not locally. It turned out that the issue was a call to gc_disable() causing the test to reach Travis's 3gig memory limit. I thought I should post a note so that people are aware of this possible cause for faili

[julia-users] Is there a break down when you have too many functions/types in 0.3?

2015-07-26 Thread Sheehan Olver
I've been running into issues in 0.3 where minor changes cause compile time to increase considerably, or even tab-completion takes forever and doesn't respond to ^C. Is there some sort of limit to the number of functions/types that I am reaching? I tried the tab-completion issue in 0.4 and it

[julia-users] How do you use "using" inside a function now that "require" is deprecated?

2015-07-29 Thread Sheehan Olver
The below code used to work to lazy load a module, but now is deprecated, with the warning saying to use `using` or `import`. But `using` doesn't work inside a function. What should be done? ```julia function foo2() require("StatsBase") end ```

Re: [julia-users] IDE for Julia

2015-08-31 Thread Sheehan Olver
Does Atom Support Gadfly graphics yet? (I got it installed but the output from Gadfly is just "Plot(...)" On Tuesday, September 1, 2015 at 2:30:23 AM UTC+10, Nils Gudat wrote: > > I've been using JunoLT for about a year and switched to the new Atom > client about 2 weeks ago - I think it's alrea

Re: [julia-users] IDE for Julia

2015-08-31 Thread Sheehan Olver
whipped up. > > On Monday, August 31, 2015 at 12:09:01 PM UTC-7, Sheehan Olver wrote: > Does Atom Support Gadfly graphics yet? > > (I got it installed but the output from Gadfly is just "Plot(...)" > > On Tuesday, September 1, 2015 at 2:30:23 AM UTC+10, Nils Gud

[julia-users] "Julian" way of doing protected methods and extension packages

2015-09-06 Thread Sheehan Olver
I'm trying to write a package that extends another package (ApproxFun), which needs to use and override many methods/functions that aren't exported. Right now the solution is to write a hundred "import ApproxFun: method1, method2, ...". Is there a standard "Julian" way of doing this?

[julia-users] 0.4: calling promote_type in creating type no longer works

2015-09-06 Thread Sheehan Olver
The following line code works in 0.3 and not 0.4. Is this a bug or should this be done differently now? *abstract AbstractFoo{T}* *immutable Foo{T,V} <: AbstractFoo{promote_type(T,V)} end*

Re: [julia-users] "Julian" way of doing protected methods and extension packages

2015-09-06 Thread Sheehan Olver
is Julian. Equally Julian is instead fully qualifying it: > > ApproxFun.method1() = 4 > > Unless you're adding a ton of methods to a function, I prefer the second > style as it makes things clearer, IMO. > > On Mon, 2015-09-07 at 00:13, Sheehan Olver wrote: >> I'

[julia-users] Re: How can I delete columns of a matrix in-place?

2015-09-07 Thread Sheehan Olver
Just curious: if it was [true,true,false] or [false,true,true] would it then be possible? The memory for a matrix is still inline, so these cases should correspond to changing the dimensions or rebasing the initial column. On Tuesday, September 8, 2015 at 4:10:07 AM UTC+10, Tomas Lycken wrot

Re: [julia-users] 0.4: calling promote_type in creating type no longer works

2015-09-07 Thread Sheehan Olver
> julia> super(Foo{Float64,Int}) > AbstractFoo{Int64} # oops: nope, that's wrong > > >> On Sun, Sep 6, 2015 at 7:32 PM Sheehan Olver wrote: >> The following line code works in 0.3 and not 0.4. Is this a bug or should >> this be done differently now? >> >> abstract AbstractFoo{T} >> >> immutable Foo{T,V} <: AbstractFoo{promote_type(T,V)} end

Re: [julia-users] ApproxFun v0.0.1 with ODE solving

2014-06-19 Thread Sheehan Olver
iveqr.jl:78 > in ultraiconversion at > /home/sdl/.julia/v0.3/ApproxFun/src/Operators/Operator.jl:71 > in * at /home/sdl/.julia/v0.3/ApproxFun/src/Operators/Operator.jl:97 > in anonymous at no file:2 > > > Le mercredi 11 juin 2014 23:27:52 UTC+2, Sheehan Olver a écrit :

Re: [julia-users] ApproxFun v0.0.1 with ODE solving

2014-06-20 Thread Sheehan Olver
t; Le vendredi 20 juin 2014 00:13:08 UTC+2, Sheehan Olver a écrit : >> >> Hi Stephanie, >> >> Are you on the latest GitHub version? You can get on it with >> >> Pkg.checkout("ApproxFun") >> >> Sent from my iPad >> >>> On 20

Re: [julia-users] ApproxFun v0.0.1 with ODE solving

2014-06-21 Thread Sheehan Olver
Hi, You didn’t quite get the Newton iteration right: if you want to solve B u + [1,0] = 0 L u + g(u) = 0 then Newton iteration becomes u = u - [B, L + g’(u)]\[B u + [1,0], L u + g(u)] i.e., your bc right hand side is not right. Below is the corrected

Re: [julia-users] ApproxFun v0.0.1 with ODE solving

2014-06-21 Thread Sheehan Olver
imized, so chances are you won't. Sent from my iPad > On 21 Jun 2014, at 10:15 pm, 'Stéphane Laurent' via julia-users > wrote: > > Ok, I understand. It works and it is really awesome. Thank you ! > > > Le samedi 21 juin 2014 12:17:22 UTC+2, Sheehan Olver a

Re: [julia-users] ApproxFun v0.0.1 with ODE solving

2014-06-21 Thread Sheehan Olver
edback. > Thank you again for this library and your help. > - Stéphane > > Le samedi 21 juin 2014 14:24:03 UTC+2, Sheehan Olver a écrit : >> >> Thanks! >> >> I'm interested to know if the ultraspherical spectral approach has any >> clear advant

Re: [julia-users] ApproxFun v0.0.1 with ODE solving

2014-06-21 Thread Sheehan Olver
gt; About the code, I will possibly experiment it during the next days or weeks, > and I'll send you some feedback. > Thank you again for this library and your help. > - Stéphane > > Le samedi 21 juin 2014 14:24:03 UTC+2, Sheehan Olver a écrit : > Thanks! > > I&#

[julia-users] Current state of the art for 3D plotting + movies?

2014-07-06 Thread Sheehan Olver
I'm currently using matplotlib for 3d plotting, but it seems very slow, even though the # of grid points/data is still small (300x300 non-evenly spaced grid of values). Is there a good, fast 3d plotter in Julia? Or should I use an OpenGL package if speed is an issue? Ideally, I'd like it f

  1   2   3   >