Re: [julia-users] Markdown Strings as Messages

2015-02-02 Thread Christoph Ortner
Maybe this was obvious for most, but for those who didn't realise it, stevengj mentioned in 1009 that `display` will correctly render a MD object. Christoph

[julia-users] Re: peakflops() question

2015-02-02 Thread Seth
I rebuilt from scratch and am now getting julia> peakflops() 7.735382541885574e10 Which is about 30% slower than in 0.3.4 but much better than before.

[julia-users] Re: peakflops() question

2015-02-02 Thread Seth
On Monday, February 2, 2015 at 4:20:30 PM UTC-8, Seth wrote: > > > > On Monday, February 2, 2015 at 12:05:45 PM UTC-8, Peter Simon wrote: >> >> Do 0.3 and 0.4 use the same number of threads by default? You could try >> calling blas_set_num_threads prior to peakflops to make sure. I get best >

[julia-users] Re: peakflops() question

2015-02-02 Thread Seth
On Monday, February 2, 2015 at 12:05:45 PM UTC-8, Peter Simon wrote: > > Do 0.3 and 0.4 use the same number of threads by default? You could try > calling blas_set_num_threads prior to peakflops to make sure. I get best > results when the number of threads is equal to (or slightly less than,

[julia-users] Re: The == function appears to give strange and misleading information about Arrays of IntSets

2015-02-02 Thread Michael Wojnowicz
Good to know. Thanks for the info and fix. Mike On Monday, February 2, 2015 at 3:37:57 PM UTC-8, Matt Bauman wrote: > > This is now fixed on both master and release/0.3. > > Thanks for the report! >

[julia-users] Re: The == function appears to give strange and misleading information about Arrays of IntSets

2015-02-02 Thread Matt Bauman
This is now fixed on both master and release/0.3. Thanks for the report!

Re: [julia-users] Re: what path to set in jl_init

2015-02-02 Thread eric l
Yes it did! And adding -lm in front -ljulia too. Interestingly enough on OSX with clang the linking to the math library is not needed. And this time I used Jeff advice and put: * jl_init_with_image("/usr/bin","../lib/x86_64-linux-gnu/julia/sys.ji");* instead of: * jl_init ("/usr/bin"); * an

Re: [julia-users] Re: 100X boost in BigInt addition when using in-place functionality

2015-02-02 Thread Ariel Keselman
I opened a place-holder issue for this until PR is opened: https://github.com/JuliaLang/julia/issues/10030

Re: [julia-users] Re: 100X boost in BigInt addition when using in-place functionality

2015-02-02 Thread Ariel Keselman
I've updated the benchmarks, added a pooled addition, and run all in latest Julia. The results: Current simple plus: ~20 sec Pooled addition : ~1.5 sec (saturated, increasing pool doesn't change this number) in-place addition : ~0.8 sec See code below. I guess current operators shoul

[julia-users] Re: The == function appears to give strange and misleading information about Arrays of IntSets

2015-02-02 Thread Matt Bauman
IntSets right now are somewhat broken for general use. I've been working on revamping them to be better behaved. Your example passes on my work-in-progress IntSets package. I hope to try to get it merged back into base soon. In this case, the problem isn't with arrays or copy, it's with test

Re: [julia-users] Re: what path to set in jl_init

2015-02-02 Thread Jameson Nash
does it work if you move `-ljulia` to the end of the list? some versions of ld care about the order, and will only resolve dependencies from left to right On Mon Feb 02 2015 at 3:17:09 PM eric l wrote: > Me again... > > I know try the same thing on my linux box. > > gcc -o embedd -I/usr/include/

[julia-users] Re: what path to set in jl_init

2015-02-02 Thread eric l
Me again... I know try the same thing on my linux box. gcc -o embedd -I/usr/include/julia -L/usr/lib/x86_64-linux-gnu/julia -ljulia embedding.c And this time it doesn't even link... All I get is the list of the jl_XXX used in embedding.c as undefined. /tmp/cceyXOMb.o: In function `jl_get_fun

Re: [julia-users] using ccall to call a fortran parser for large input file

2015-02-02 Thread Tony Kelman
Does dlsym return a non-null pointer for that function name? You might need to try varying numbers of appended or prepended underscores on the module-mangled name. I don't think we have great support for calling into Fortran modules at the moment, we probably eventually need a specialized imple

[julia-users] Re: peakflops() question

2015-02-02 Thread Peter Simon
Do 0.3 and 0.4 use the same number of threads by default? You could try calling blas_set_num_threads prior to peakflops to make sure. I get best results when the number of threads is equal to (or slightly less than, for 12 cores) the number of physical cores. --Peter On Monday, February 2, 2

Re: [julia-users] using ccall to call a fortran parser for large input file

2015-02-02 Thread benjamin kary
I am using Fortran 95 and the mangled name was obtained by calling nm in the terminal on the shared library file. This technique worked for a simpler fortran module/function which simply takes a float and adds it to itself. Thanks for the replies! Ben >

Re: [julia-users] using ccall to call a fortran parser for large input file

2015-02-02 Thread Tony Kelman
Unless that Fortran library is written in Fortran-95-or-newer and makes use of modules, in which case the mangling is much more complicated. On Monday, February 2, 2015 at 10:21:50 AM UTC-8, Jameson wrote: > > it seems you are ccall'ing the location of the MOD variable inside of the > function,

[julia-users] Re: The == function appears to give strange and misleading information about Arrays of IntSets

2015-02-02 Thread Michael Wojnowicz
Oops, I meant to write the third element of the IntSet ARRAY.

[julia-users] The == function appears to give strange and misleading information about Arrays of IntSets

2015-02-02 Thread Michael Wojnowicz
Hi everyone, As the title says, the == function appears to give strange and misleading information about Arrays of IntSets. In particular, a copy (or deep copy) of the array is NOT identical to the original intset array, according to the == function. However, according to the setdiff() functio

Re: [julia-users] dynamically create a type definition

2015-02-02 Thread Tim Holy
You might just want a Dict: d = Dict{Symbol,Any}() d[:spec_name] = "hi there" d[:lambda] = [1.0f0, 1.3f0] and so forth. --Tim On Monday, February 02, 2015 08:15:46 AM alex codoreanu wrote: > Hi, > > I am trying to figure out how to erase a previous instance of a type > definition. I am writi

Re: [julia-users] using ccall to call a fortran parser for large input file

2015-02-02 Thread Jameson Nash
it seems you are ccall'ing the location of the MOD variable inside of the function, rather than the function name itself. fortran functions are often name-mangled by appending or prepending a small number of underscores, not completely re-writing the name. On Mon Feb 02 2015 at 1:05:21 PM benjami

[julia-users] using ccall to call a fortran parser for large input file

2015-02-02 Thread benjamin kary
I have a Fortran module which parses a complicated input file to populate a workspace with all the variables I need for a certain task. I have decimated the fortran code to try and get a single parsing command to work. The input to the Fortran function "em_data_read_input" is a string contain

[julia-users] Re: peakflops() question

2015-02-02 Thread Seth
On Monday, February 2, 2015 at 9:43:50 AM UTC-8, Seth wrote: > > From https://github.com/JuliaLang/julia/pull/7662 I learned about > peakflops(), so I decided to give it a try and am seeing very strange > performance. > > On my Macbook Pro, I get 1.6950987382609034e9. This is slower than what's

[julia-users] peakflops() question

2015-02-02 Thread Seth
>From https://github.com/JuliaLang/julia/pull/7662 I learned about peakflops(), so I decided to give it a try and am seeing very strange performance. On my Macbook Pro, I get 1.6950987382609034e9. This is slower than what's in the screenshot at the PR. Julia Version 0.4.0-dev+2529 Commit 322cf2

Re: [julia-users] Re: 100X boost in BigInt addition when using in-place functionality

2015-02-02 Thread Jiahao Chen
On Mon, Feb 2, 2015 at 12:24 PM, Steven G. Johnson wrote: > We've also discussed maintaining a pool of temporary bignums that are > re-used as needed. This (and the analogous issues for arrays) would be a very nice use of register allocation algorithms. I'm hoping that Oscar's upcoming work on

[julia-users] Re: select! with range creating a memory allocation

2015-02-02 Thread Kristoffer Carlsson
I checked it a bit more carefully, the reason for the high memory usage is that I create a new instance of an anonymous function every time I call select! I will try work around it. On Monday, February 2, 2015 at 5:03:12 PM UTC+1, Kristoffer Carlsson wrote: > > I did some benchmarkling and I

Re: [julia-users] Re: 100X boost in BigInt addition when using in-place functionality

2015-02-02 Thread Steven G. Johnson
We've also discussed maintaining a pool of temporary bignums that are re-used as needed.

Re: [julia-users] Re: compute hermite polynomials

2015-02-02 Thread Jiahao Chen
And in fact the coefficients you obtained with the code are not correct because of integer overflow. (I got these coefficients from Mathematica.) julia> compute_hermite_polynomial(48) Poly(8629227277223198720 - 8374539685103403008x^2 + 2715657340094251008x^4 + 6791467061357838336x^6 + 825954348167

Re: [julia-users] Re: compute hermite polynomials

2015-02-02 Thread Jiahao Chen
Thanks for catching that. But even with Polynomials, the code computes the coefficients of the polynomial in the monomial basis, not the value of the polynomial at a given x. Using the former to compute the latter is dangerous because it is numerically unstable. julia> Hermite48(x) = 2000797416490

Re: [julia-users] Re: compute hermite polynomials

2015-02-02 Thread Steven G. Johnson
On Monday, February 2, 2015 at 11:17:36 AM UTC-5, Jiahao Chen wrote: > > The entire point of orthogonal polynomials is that they can be evaluated > very efficiently using their recurrence relations. I would make use of this > fact to the extent possible allowed by numerical roundoff. > (In a se

Re: [julia-users] Re: compute hermite polynomials

2015-02-02 Thread Andrei Berceanu
That depends on weather one uses the Polynomial or Polynomials package. I use the latter (which has in fact superseded the former). The main difference is the ordering of the coefficients. On Monday, February 2, 2015 at 5:59:45 PM UTC+1, Jiahao Chen wrote: > > This code computes the coefficient

Re: [julia-users] Re: 100X boost in BigInt addition when using in-place functionality

2015-02-02 Thread Stefan Karpinski
I think I'm ok with having separate mutating add!, mul! etc. operators since they should *only* work on mutable numeric types (e.g. BigInt, BigFloat, Matrix), so this doesn't ruin genericity the way making having operations that are either mutating or non-mutating based on their argument types does

Re: [julia-users] Re: compute hermite polynomials

2015-02-02 Thread Jiahao Chen
This code computes the coefficient of the leading order term, not the value of the polynomial. Thanks, Jiahao Chen Staff Research Scientist MIT Computer Science and Artificial Intelligence Laboratory On Mon, Feb 2, 2015 at 11:43 AM, Andrei Berceanu wrote: > I came up with this, so far > > > >

[julia-users] Re: Robust Inner Products

2015-02-02 Thread Steven G. Johnson
It might be nice to submit a patch to OpenBLAS to make their dot functions use pairwise summation; this is almost as accurate as KBN summation but with negligible performance penalty (for a large base case), so it should be possible to put together an attractive pull request. For Base, currentl

Re: [julia-users] dynamically create a type definition

2015-02-02 Thread alex codoreanu
Hi Kyle, DataFrames is an option if I restructure my data around it. This structure issue is important for the data.fits file reader but Stefan had a good suggestion about wrapping up the type definition in a module call. However, it's getting close to sun-up in Australia so I'll sleep on it f

Re: [julia-users] Re: 100X boost in BigInt addition when using in-place functionality

2015-02-02 Thread Andreas Noack
I was about to write that as well. Arithmetic on BigFloats BigInts should be quite a bit faster with the new gc. The idea of mutable BigInts and -Float has been discussed a couple of places https://groups.google.com/forum/#!msg/julia-dev/uqp7LziUEfY/3Klx_KFy0mkJ https://github.com/JuliaLang/julia

[julia-users] Re: 100X boost in BigInt addition when using in-place functionality

2015-02-02 Thread Tony Kelman
Looks like you're running that either on 0.3 or on an old copy of 0.4. It would be interesting to see how much the new GC changes these numbers. But yes, in-place operations for BigInt and BigFloat would be quite useful. I think an issue or PR for discussion of the right implementation would be

[julia-users] Re: compute hermite polynomials

2015-02-02 Thread Andrei Berceanu
I came up with this, so far *function compute_hermite_polynomial(n)P = Poly([1])const x = Poly([0; 1]) for i = 1:nP = 2x*P - polyder(P)endPend* On Monday, February 2, 2015 at 5:2

Re: [julia-users] dynamically create a type definition

2015-02-02 Thread Kyle Barbary
Hi Alex, Correct me if I'm wrong, but I think what you're looking for is the equivalent of a numpy structured array: an array where each element is a composite data structure. Normally in Julia, you'd use an array of your custom type to achieve this. However, the desire here is that the fields and

Re: [julia-users] erase previous instance of type

2015-02-02 Thread Stefan Karpinski
If you define your types inside of a module, you can reload the module and get new types. This is a pretty convenient way to do this. Beware that you probably want to access things explicitly with Module.binding since bindings to old versions of the things tend to stick around. On Mon, Feb 2, 2015

[julia-users] Re: compute hermite polynomials

2015-02-02 Thread Andrei Berceanu
Andras, no worries :) Now I understand why I couldn't find the polynomials in your gist! //A On Monday, February 2, 2015 at 5:19:49 PM UTC+1, Andras Niedermayer wrote: > > Sorry, I meant Cubic Hermite Interpolation. Now I see you're looking for > Hermite polynomials. > > On Monday, February 2,

[julia-users] Re: compute hermite polynomials

2015-02-02 Thread Andras Niedermayer
Sorry, I meant Cubic Hermite Interpolation. Now I see you're looking for Hermite polynomials. On Monday, February 2, 2015 at 4:50:00 PM UTC+1, Andras Niedermayer wrote: > > I was looking for Hermite polynomials and haven't found any code. I have > some (very unpolished) code. > > I haven't made

Re: [julia-users] Re: compute hermite polynomials

2015-02-02 Thread Jiahao Chen
The entire point of orthogonal polynomials is that they can be evaluated very efficiently using their recurrence relations. I would make use of this fact to the extent possible allowed by numerical roundoff. Thanks, Jiahao Chen Staff Research Scientist MIT Computer Science and Artificial Intellig

[julia-users] dynamically create a type definition

2015-02-02 Thread alex codoreanu
Hi, I am trying to figure out how to erase a previous instance of a type definition. I am writing a function that can dynamically create a return_type based on the variables passed to it. For example: instance 1 type data_return_type spec_name::String lambda::Vector(Float32} spec::Vect

Re: [julia-users] erase previous instance of type

2015-02-02 Thread Jiahao Chen
Types are constants and cannot be redefined. Currently there is a workaround to use workspace(): julia> type foo end julia> type foo A end ERROR: invalid redefinition of constant foo julia> workspace() julia> type foo A end However, workspace() does not work we

[julia-users] Re: compute hermite polynomials

2015-02-02 Thread Andrei Berceanu
Jiahao, it's not just for reproducing the Wikipedia figure. I will need to compute higher orders as well, i.e. Hn for n = 48. I was just wondering if there was anything already implemented in Julia. Meanwhile I found this: https://github.com/daviddelaat/Orthopolys.jl On Monday, February 2, 2015

[julia-users] erase previous instance of type

2015-02-02 Thread alex codoreanu
Hi, I am trying to figure out how to erase a previous instance of a type definition. I am writing a function that can dynamically alocate For example: instance 1 type data_return_type spec_name::String lambda::Vector(Float32} spec::Vector(Float32} end

Re: [julia-users] create a multi data type structure in Julia

2015-02-02 Thread alex codoreanu
Hi Tim, I am actually trying to use the low-level functionality provided in FITSIO.jl to write a higher-level function that can deal with fits files with an unknown number of columns and a mix of datatypes. Fingers crossed! On Sunday, February 1, 2015 at 10:33:47 PM UTC+11, Tim Holy wrote: >

[julia-users] Re: select! with range creating a memory allocation

2015-02-02 Thread Kristoffer Carlsson
I did some benchmarkling and I noticed that select! uses the majority of memory(27 mb out of ~30) when I create a kd tree. I tried to remove the return value from the select! function but it didn't make a big difference. The way I use select! is like this: select!(perm, mid_idx, by = i -> data[

[julia-users] Re: compute hermite polynomials

2015-02-02 Thread Andras Niedermayer
I was looking for Hermite polynomials and haven't found any code. I have some (very unpolished) code. I haven't made a public package yet, since it needs to be improved (especially in terms of efficiency, also documentation). Unfortunately, I'm unlikely to have time for this in the near future,

Re: [julia-users] Re: compute hermite polynomials

2015-02-02 Thread Jiahao Chen
All you need to do is compute the polynomials using the recurrence relations in the Wikipedia article. There are more sophisticated ways to evaluate Hermite polynomials but for plotting a few of the lower-order polynomials computing them directly from the definition should suffice. Thanks, Jiaha

[julia-users] Re: compute hermite polynomials

2015-02-02 Thread Jiahao Chen
> Is there an easy way to compute Hn(x)? Do you mean to evaluate a given Hermite polynomial of order n at a value x?

[julia-users] Re: compute hermite polynomials

2015-02-02 Thread Andrei Berceanu
Yes, exactly, in order to generate plots like http://en.wikipedia.org/wiki/Hermite_polynomials#mediaviewer/File:Hermite_poly_phys.svg //A On Monday, February 2, 2015 at 4:36:55 PM UTC+1, Jiahao Chen wrote: > > > > Is there an easy way to compute Hn(x)? > > Do you mean to evaluate a given Hermit

Re: [julia-users] Re: Memory usage and speed in nested loop.

2015-02-02 Thread Stefan Karpinski
On Mon, Feb 2, 2015 at 6:39 AM, Kristoffer Carlsson wrote: > Now my two versions allocate exactly the same amount of memory. A bit > cumbersome to have to do the unrolling yourself but not so bad. This is definitely in our sights to fix. Until we have a really good, general solution, it seems b

Re: [julia-users] Parametric vs Abstract typed collections, design question

2015-02-02 Thread Josh Langsfeld
As Jutho mentioned, a parametric type without a type parameter is just another abstract type so I don't think there would be any difference in performance. But if Foo and Bar have the same internal structure, are they really different types at all? You could always do a manual "type" dispatch b

Re: [julia-users] Re: Caching of code generated by macros

2015-02-02 Thread Jan Niklas Hasse
2015-02-02 4:00 GMT+01:00 : > Others will know a lot more about this, but caching of already compiled > Julia code is a very large issue. It may be safe to say it is the largest > current issue for the language now that a new GC has been merged into 0.4. > So this is to say that you aren't alone

[julia-users] compute hermite polynomials

2015-02-02 Thread Andrei Berceanu
Hi, Are Hermite polynomials (http://en.wikipedia.org/wiki/Hermite_polynomials) implemented in Julia? Is there an easy way to compute Hn(x)? //A

Re: [julia-users] How to make vector 'c' such that they are the values of the vector "a" but not in the vector "b"?

2015-02-02 Thread paul analyst
Thx, my idea was to long;) c=copy(a) deleteat!(c,findin(a,b)) Paul W dniu poniedziałek, 2 lutego 2015 13:43:18 UTC+1 użytkownik Tamas Papp napisał: > > Perhaps > > setdiff(a, b) > > or > > a[indexin(a, b) .== 0] > > I don't know which is faster, for small arrays it should not matter. > > B

Re: [julia-users] How to make vector 'c' such that they are the values of the vector "a" but not in the vector "b"?

2015-02-02 Thread Tamas Papp
Perhaps setdiff(a, b) or a[indexin(a, b) .== 0] I don't know which is faster, for small arrays it should not matter. Best, Tamas On Mon, Feb 02 2015, paul analyst wrote: > How to make vector 'c' such that they are the values of the vector "a" but not > in the vector "b"? > > (Excluding the

[julia-users] Re: How to make vector 'c' such that they are the values of the vector "a" but not in the vector "b"?

2015-02-02 Thread Yuuki Soho
setdiff(a,b) You can find all this kind of functions here, they are quite useful: http://docs.julialang.org/en/release-0.3/stdlib/collections/#set-like-collections

[julia-users] How to make vector 'c' such that they are the values of the vector "a" but not in the vector "b"?

2015-02-02 Thread paul analyst
How to make vector 'c' such that they are the values of the vector "a" but not in the vector "b"? (Excluding the value of b with a ) julia> b=[1 2 5] 1x3 Array{Int64,2}: 1 2 5 julia> a=[1:1:10] 10-element Array{Int64,1}: 1 2 3 4 5 6 7 8 9 10 expected c: 3 4 6 7 8 9 10 P

[julia-users] Re: Memory usage and speed in nested loop.

2015-02-02 Thread Kristoffer Carlsson
Yes, that was an excellent suggestion! I am sorry I did not realize that was you meant in your first post. Now my two versions allocate exactly the same amount of memory. A bit cumbersome to have to do the unrolling yourself but not so bad. Again, thanks. On Monday, February 2, 2015 at 11:59

[julia-users] Re: Memory usage and speed in nested loop.

2015-02-02 Thread Yuuki Soho
I think you can just add a loop over the dimensions to do the copy and avoid the allocations: function slow(points::Array{Float64,2}) n_dim = size(points,1) n_points::Int = size(points,2) point_2 = zeros(n_dim) cum = 0.0 for i in 1:n_points for j in (i+1):n_points

[julia-users] Re: 100X boost in BigInt addition when using in-place functionality

2015-02-02 Thread Ariel Keselman
`sum` is implemented this way actually, so in the example above I could use it to get similar results. Nevertheless this could be a good addition IMO any thoughts?

[julia-users] Re: Memory usage and speed in nested loop.

2015-02-02 Thread Kristoffer Carlsson
Yes, but my code was just a contrieved example of the problem, not what I am actually doing. I have a matrix of size (n_dim, n_points). I then want to pass points to different distance functions. I therefore pass point_matrix[:, current_point] to those distance functions. What you are saying

[julia-users] 100X boost in BigInt addition when using in-place functionality

2015-02-02 Thread Ariel Keselman
I'm working on a PR based on this benchmark, see image below, comments welcome!

[julia-users] Re: Memory usage and speed in nested loop.

2015-02-02 Thread Yuuki Soho
If you access directly the elements of your arrays it will not allocate memory: cum += points[1, j] It's often worth adding a loop or reshaping your inputs so you can write your inner code like that and avoid memory allocation.