In recent tests, the best distribution estimator was a geometric mean because
the elapsed-time distribution was log-normal.
If each iteration is not too short (to avoid timing inaccuracies) and not too
long (to avoid spending a day benchmarking), you'd better get each elapsed-time
individually
Well, if only double precision is requested, you can compute E1 (or Ei) for
real x in,
say, 20 lines of julia code, using a combined approach of series expansion
and continued
fractions -- see Abramowitz and Stegun, Chapter 5. The other one, Ei or E1,
is then given
by the equation above.
I
It seems to localize single variables but not arrays. I could even
implement an async that I could interrupt by updating values in a global
array. I actually don't know of any sane way to do this, i.e., interrupt a
task or an async bloc from the main thread?
global x = zeros(1)
@async begin
In a macro I need to first define a large number of functions and then
merge them into one block and return that as the code from the macro. Is
there a simpler/smarter way than what I currently do, which is based on
explicitly adding
using Base.Test
# We want to find a way to merge the
I do now know how many of you are familiar with the PHCpack (
http://homepages.math.uic.edu/~jan/phcpack_doc_html/index.html) code for
solving (very large) polynomial systems without the need for initial
guessing, by using homotopy continuation methods. They have a github
repository as well at
Hello colleague,
On Wednesday, June 4, 2014 4:36:12 AM UTC+2, John Myles White wrote:
I’m not sure there’s any single correct way to do benchmarks without
information about what you’re trying to optimize.
If you’re trying to optimize the experience of people using your code, I
think it’s
First of all, sorry if the question in the title is not well explained.
Basically, what I want to know if some of you guys know a nicer way to do
the following:
function f2(a, b, c)
return a+b+c
end
f = function f1(a,b)
f2(3,a,b)
end
so
f(1,1)
is 5
What I want to do is to create a new
I don't think you can avoid f1 completely, but there is a one-line syntax
to obtain the same thing:
f1(a,b) = f2(3,a,b)
I can't imagine a syntax to express that thing that is more compact yet
equally expressive.
// T
On Wednesday, June 4, 2014 12:37:47 PM UTC+2, joanenric barcelo wrote:
How to read and change the content of web pages to the vector [word1,
word2, word3, wordlast]?
Paul
You can also make an anonymous function and assign it to a variable:
ff = (x,y) - f2(3,x,y)
But Thomas' suggestion is nicer:
f(a,b) = f2(3,a,b)
The anonymous function approach is shorter if you need to pass it to a
function, e.g.:
map(x - f2(3,4,x), 1:5)
But I think they have not the same
Here's a simple example of what I'm observing:
testmodule.jl
module testmodule
export @wrapexpr
# if I put foo here, everything works
# foo(x, y) = x*y
macro wrapexpr(expr)
quote
(x, y) - $(expr)
end
end
end
and testscript.jl:
using testmodule
foo(x, y) = x*y
fn1 = @wrapexpr x+y
Thanks for the one-line expression. Hence, if I want to assign this new
function to the existing variable f using one line, I can do
f = f1(a,b) = f2(3, a, b)
It will work for me!
Joan
El miércoles, 4 de junio de 2014 11:39:40 UTC+1, Tomas Lycken escribió:
I don't think you can avoid f1
This works:
parse(reduce(*, map(string, ex_funcs)))
as was suggested in this thread for symbols:
https://groups.google.com/d/msg/julia-dev/KJNOrV45sZo/zE2_fVzQrS4J
Still seems a bit ugly. Any better ways?
On Wed, 2014-06-04 at 08:58, robert.fe...@gmail.com wrote:
In a macro I need to first
As I once thought about writing an R package rPHCpack, I would be *very*
interested
in having access to PHCpack in Julia.
What I did not understand: (1) do you suggest someone else writes such a
package,
(2) is this a kind of poll for such a package, (3) are you going to code
such a
wrapper
@mauro I think there is a single function that combines map and reduce
http://docs.julialang.org/en/release-0.2/stdlib/base/#Base.mapreduce.
Also it seems like parse(string(ex_funcs...)) would do the
same job.
What about instead enclosing them in a block expression? I'm not sure
Let's say I have two sets of points in a 3-dimensional space represented by
arrays of sizes Nx3 and Mx3. What is the most efficient way to calculate
the distances between all points of set 1 against all points of set 2?
This is a (not so efficient example) of what I want to accomplish:
I have an array that will typically grow and shrink quite a bit – but I'd
rather not have stuff move around or perform any costly memory operations
because of this. My current solution is to simply store the current size as
a Uint, and then manually check whether I can append to it by simply
It's still an open issue: https://github.com/JuliaLang/julia/issues/1864,
though there have been talks on how to improve.
-Jacob
On Wed, Jun 4, 2014 at 8:10 AM, Mauro mauro...@runbox.com wrote:
Is that a fact? That would be sad, since it would mean that a functional
style suffers a
Yes I have seen it. I tried something with the function pairwise, but I did
not really get what I want. If I have two sets of sizes N and M
respectively, I expect as return value a matrix of size NxM. What I got out
of pairwise is smaller than that.
See the document
here: https://github.com/JuliaStats/Distance.jl#computing-pairwise-distances
On Wednesday, June 4, 2014 8:15:51 AM UTC-5, Dahua Lin wrote:
The Distance package assumes that *each column is a point*.
Since Julia uses column-major layout for arrays, using column-major ways
It is basically a call for collaborators on such a package. I am willing to
contribute although I am quite new to Julia.
On Wednesday, June 4, 2014 1:28:55 PM UTC+2, Hans W Borchers wrote:
As I once thought about writing an R package rPHCpack, I would be *very*
interested
in having access
Thankyou very much for pointing that out, it was not obvious to me what was
going on!
I would have expected if I just wrote int64(4) as the last line would
return that value, but if an assignment was deliberately done by the coder
I expected it would be honoured and then the left hand side
On Wednesday, June 4, 2014 2:55:26 PM UTC+2, Ivar Nesje wrote:
I think push!() is faster because the other option is accessing an array
that contains `#undef` values (Julia speak for a NULL pointer) and this is
slower than accessing a regular array that does not contain #undef.
See:
*Arrays*
function f1(a, b, c)
return (a.^2)*sum(a).*c.+exp(-b)
end
function f2(a, b, c=3)
return (a.^2).*sum(a).*c.+exp(-b)
end
f3(a, b) = f1(a, b, 3)
f4 = (a, b) - f1(a, b, 3)
a = rand(1000);
b = rand(1000);
julia @time for i=1:1 f1(a, b, 3) end
elapsed time: 0.813792743 seconds
Extending on what Miguel suggested, for a small number of optional
arguments I tend to prefer the following equivalent way which shows off the
multiple dispatch:
f1(a, b, c) = a + b + c
f1(a,b) = f1(a, b, 3)
On Wednesday, June 4, 2014 5:51:16 AM UTC-7, Miguel Bazdresch wrote:
You can also
Sounds interesting, I'd certainly play with it. This is probably the first
piece of code I've seen in public that's written in Ada though - having
never built an Ada library before, getting it set up to easily install
through Julia's package manager sounds like it would be the hardest part.
You can take a pointer to an array and reinterpret it as a smaller array,
which sounds like (sort of) what you want.
https://gist.github.com/anonymous/e8042c8bffe49c3aa886
(whether this is more performant and/or a good idea is left as an exercise
:)
On Wed, Jun 4, 2014 at 10:22 AM, Magnus Lie
Dear Julia users,
I am trying to use Julia's parallel capabilities to do a simple parameter
sweep. I am probably doing something wrong, but top seems to indicate that
half om my julia processes are doing nothing at all:
This is my workflow (not very pro, but it suits my case for now)
I start
I probably already have an idea what's going on. How are the different
tasks distributed over the different Julia processes? Is the for loop
immediately cut into pieces where e.g. process 1 will handle the cases
iter=1:10, process 2 handles the cases iter=11:20 and so on? For different
values
When calling for a BFGS or L-BFGS optimization in Optim.jl, the initial
inverse hessian is set to the identity matrix. I am running into some
trouble with this design decision, as my objective function is numerically
unstable at the first function evaluation point x0 - (I \ g0), where x0 is
Exposing the option to control the initial approximate Hessian would be a good
idea. If you don’t mind, I’d encourage you to put a little time into learning
GitHub since it will make it a lot easier in the future for you to help fix
problems you’re running into.
Fixing our line search routine
I have a pending pull request #6910 to fix macros to behave as you expect,
but until that gets integrated you will need to use the esc function in
your macro to tell the macro system that x, y, and expr are in the macro
caller's context, not the macro definition's context. There is no
I open a Github issue here: https://github.com/JuliaOpt/Optim.jl/issues/59
Dahua
On Wednesday, June 4, 2014 10:43:56 AM UTC-5, John Myles White wrote:
Exposing the option to control the initial approximate Hessian would be a
good idea. If you don’t mind, I’d encourage you to put a little
Hi all
I am trying to call Julia from the Swift language
(https://sites.google.com/site/exmcomputing/swift-t) and run it on large
computers like the Blue Gene/Q. (This technique currently allows us to run
Python, R, and Tcl on many cores.) I have been able to get the basic
embedded Julia
Now that we have optional positional arguments, this can be done more tersely
as:
f1(a, b, c = 3) = a + b + c
On Jun 4, 2014, at 7:34 AM, Ethan Anderes ethanande...@gmail.com wrote:
Extending on what Miguel suggested, for a small number of optional arguments
I tend to prefer the following
I want a theoretically pure measurement for an algorithm. I'm not sure how
I would go about counting CPU instructions, however, since the algorithm is
only a heuristic one and my only guide for how long it takes on a given set
of instances is to run it and see how long it took. Is there some
Power PC shouldn't be a problem. The real problem on BG/Q is that you can't
allocate extra executable memory after the program has started (or so I've
been told). When I last talked about this with Hal Finkel (he works on BG/Q
support for LLVM), he thought that it ought to be possible to just
On Tuesday, June 3, 2014, Stefan Karpinski stefan.karpin...@gmail.com
wrote:
Shouldn't be hard though.
For a few terms (which should be the most common use case), this is true.
I'm curious what's possible now when the number of terms grows. Early in
grad school, I vaguely remember this
Any help ?
How to read and change the content of web pages to the vector [word1,
word2, word3, wordlast]?
W dniu 2014-06-04 12:47, paul analyst pisze:
How to read and change the content of web pages to the vector
[word1, word2, word3, wordlast]?
Paul
I don't really understand what you mean by web page.
-- John
On Jun 4, 2014, at 9:20 AM, Paul Analyst paul.anal...@mail.com wrote:
Any help ?
How to read and change the content of web pages to the vector [word1,
word2, word3, wordlast]?
W dniu 2014-06-04 12:47, paul analyst
On Wed, Jun 4, 2014 at 5:29 AM, Andreas Lobinger lobing...@gmail.com
wrote:
Especially i like Stefan's idea not to exclude the gc.
https://github.com/JuliaLang/julia/issues/7119 – make it easier to know how
much time is spent on GC out of total execution time.
The reason that assignments return the unconverted value of their right
hand side is so that assignment chains behave as expected instead of the
assignments to the right subtly and surprisingly affecting assignments to
the left. Otherwise you would have unfortunate effects like this:
function
Thanks for the encouragement. Is there a good Julia-specific reference for
how to do this? So far I have:
1) Set up a GitHub account
2) clicked the fork button on the Optim.jl page and cloned it to my
machine (right now it lives in ~/github/Optimize.jl/ on my machine)
3) made my changes to my
Is there a function in Base to generate a sparse block-diagonal matrix from
the diagonal blocks which themselves are stored as SparseMatrixCSC objects?
I thought I should ask before reinventing the wheel.
I have found it most convenient to make a branch on the code in .julia and
work from there, then everything will work as if it were the normal
package. The package in the .julia directory is just a clone of the
project on GitHub. This is probably morally wrong somehow, but it is
convenient.
On Wednesday, June 4, 2014 2:54:22 AM UTC-4, Hans W Borchers wrote:
Well, if only double precision is requested, you can compute E1 (or Ei)
for real x in,
say, 20 lines of julia code, using a combined approach of series expansion
and continued
fractions -- see Abramowitz and Stegun,
On Wednesday, June 4, 2014 2:45:25 PM UTC-4, David Einstein wrote:
I have found it most convenient to make a branch on the code in .julia and
work from there, then everything will work as if it were the normal
package. The package in the .julia directory is just a clone of the
project on
Many programming languages and scientific computing systems follow the
round half to even
tie-breaking rule; this is also the default rounding mode in the IEEE
standard for floating-point
arithmetic (IEEE 754). So in R or Python (with NumPy), but not in, e.g.,
MATLAB) we have
round(0.5)
Any idea why type inference is failing on full(chol(A, :U)) ?
It can't be determined from the types of the arguments what the result will
be, because you could give different symbols to access different parts of
the factorization. I think this was a design choice to make it easier to
We follow C, Fortran, Matlab, Python and most other programming languages
here. R and NumPy's rule is pretty unusual; it has some nice statistical
properties (it's apparently known as statistician's rounding), but is
quite awkward for general programming tasks.
One question: I have the impression that the round() function is not affected
by the currently chosen rounding rule in Julia. Is that right?
-- John
On Jun 4, 2014, at 2:48 PM, Stefan Karpinski ste...@karpinski.org wrote:
We follow C, Fortran, Matlab, Python and most other programming
This isn't really related to IEEE rounding modes. Floating-point rounding
modes are about choosing which of the closest representable floating-point
values an operation should produce when the true value is between them. The
round function is a well-defined mathematical function regardless of IEEE
I should add, I suspect that 'esc' can only be used in a quote block, so I
tried this instead:
macro wrapexpr(expr)
quote
($(esc(x)), $(esc(y))) - $(esc(expr))
end
end
But get:
ERROR: x not defined
On Wednesday, June 4, 2014 11:44:43 AM UTC-4, David Moon wrote:
I have a pending
Sorry for the long silence!
The things you posted were really inspiring, and I'm trying to incorporate
what I can!
I actually started coding and I'm posting the updates on my blog:
http://randomphantasies.wordpress.com/
Please feel free to comment the progress on Github, the Blog, or here ;)
Developing in Julia, I find I am missing the nice diagnostics that gfortran
provides with -fcheck=bounds, that is, the name of the array and which
index is out of bounds (for multidimensional arrays). All I am getting
from Julia is the line number of the beginning of the for-loop that
Couldn't this be provided by the get_rounding/set_rounding/with_rounding
framework?
On Wed, Jun 4, 2014 at 2:59 PM, Stefan Karpinski ste...@karpinski.org
wrote:
This isn't really related to IEEE rounding modes. Floating-point rounding
modes are about choosing which of the closest
It could, but it shouldn't. The rounding mode and how you round to integers
are completely different matters.
On Wed, Jun 4, 2014 at 8:16 PM, Kevin Squire kevin.squ...@gmail.com wrote:
Couldn't this be provided by the get_rounding/set_rounding/with_rounding
framework?
On Wed, Jun 4, 2014
I'm sure this has been asked before, but I can't find an answer.
Given a .jld files, how do I inspect it to list the variables it contains?
Right now I'm resorting to
before=Set(names(Main))
@load data.jld
after = Set(names(Main))
varnames = collect(setdiff(after,before))
That works but is
Hi guys,
I've tried to insert some values into a table (postgres)
I was successful when I put:
query(INSERT INTO sum_access(contact_id,sum_reg) VALUES ('1','10'))
But, when I replace the integer values for variables like:
value = 10
sum = 15
query(INSERT INTO
I got it to work with:
macro wrapexpr(expr)
x = :x
y = :y
quote
$(esc(quote ($x, $y) - $expr end))
end
end
I think the problem before was that the entire anonymous function has to be
escaped. I also don't claim to understand hygiene well enough to really
understand what that means.
I'll try to get around to comparing against the DataFrames version and
profiling this week. I got stuck trying to figure out the action semantics.
On Tuesday, May 27, 2014 6:58:42 PM UTC-4, John Myles White wrote:
I'd be really interested to see how this parser compares with DataFrames.
https://github.com/timholy/HDF5.jl/blob/master/doc/hdf5.md#getting-information
The things that work for plain HDF5 files should also work for JLD. If not, it
should be viewed as a bug (barring things I'm not thinking of ATM).
--Tim
On Wednesday, June 04, 2014 05:56:23 PM Samuel Colvin wrote:
Hi all,
It seems there are a lot of packages out there, and most package are hosted
on github. The only way I know to install a package is Pkg.add(some
package). So it seems inconvenient to use a package, say PyPlot, because I
have to download and install it first every new package uninstalled.
https://github.com/amitmurthy/MessageUtils.jl could be useful for your own
task distribution.
On Wed, Jun 4, 2014 at 9:39 PM, Kevin Squire kevin.squ...@gmail.com wrote:
It is the case currently that the array itself is divided up evenly. One
way to deal with this (in the back end) is work
Thanks Kevin!
and if I want to insert values from an Array?
For example:
out_table = Array(Int64,5)
sum = 0
for i in 1:5
out_table[i] = 0
sum+=1
query(INSERT INTO test(id,sum) VALUES ('$value[i]','$sum'))
end
I have this message:
Thanks Kevin!
and if I want to insert values from an Array?
out_table = Array(Int64,5)
sum = 0
for i in 1:5
out_table[i] = 0
sum+=1
query(INSERT INTO test(id,soma) VALUES ('$out_table[i]','$sum'))
end
I got this message: [ODBC] 22P02: ERROR: invalid input syntax for integer:
It worked with:
out_table = Array(Int64,5)
sum = 0
value = 0
for i in 1:5
out_table[i] = 0
sum+=1
value = out_table[i]
query(INSERT INTO test(id,soma) VALUES ('$value','$sum'))
end
Thanks!
On Wednesday, June 4, 2014 9:11:11 PM UTC-7, Douglas
I'm still lost. Do you want to print out the text for an HTML table to STDOUT?
-- John
On Jun 4, 2014, at 9:33 AM, Kevin Squire kevin.squ...@gmail.com wrote:
I would think web page = HTML document.
On Wednesday, June 4, 2014, John Myles White johnmyleswh...@gmail.com
wrote:
I don't
I added blkdiag() for sparse matrices a few months back (was the first
thing I did when I started using Julia). Let me know if it doesn't do what
you're looking for.
On Wednesday, June 4, 2014 11:33:16 AM UTC-7, Douglas Bates wrote:
Is there a function in Base to generate a sparse
There are definitely plans to create more complete distributions that include
the most commonly used 3. party packages. Currently we don't do that, because
it requires some changes to the distribution system, and nobody has done that
(yet). We would also need to make a decision about what to
70 matches
Mail list logo