That looks very promising.
Instead of type checking every time an element is accessed it is enough to
just check once what type of Vector it is and then we know what element we
have in the core loop. Since there is only a few type of elements the cost
of this check will be negligble.
I will
I am seeing what looks like a similar problem trying to use PyPlot in
version 0.4. When I issue 'using PyPlot', I get
ERROR: LoadError: LoadError: LoadError: MethodError: `convert` has no
method matching convert(::Type{Ptr{UInt8}}, ::ASCIIString)
This may have arisen from a call to the
Hello folks,
This is a re-post from my previous post earlier in the week. My code
was referring t a non-existent file. I am attaching the code I am using
since I have no idea what part of the code is producing errors in Julia
0.3.6.
I am trying to run a little bootstrap in Julia using pmap
type LinTrig : FElement
v1::Int
end
Here you should probably use `immutable`, that way it will be stored as
efficiently as ints.
type LinQuad : FElement
v1::Int
v2::Int
end
type Node
c::Float64
end
type FEMesh
node::Vector{Node}
elements::Vector{FElement}
Left some nonsense at the top of my reply, sorry.
I've been toying around with implementing a fixed-point type in Julia.
This has been mentioned before (http://bit.ly/1DlF2S0) I guess that it is
on one or more person's to-do list; does anyone have a fixed-point type
they can share?
I made a toy type at this gist:
Thanks! I feel sheepish for not seeing that earlier.
Looking at the package, I am curious to know why Fixed32 does not have a
dynamic storage type as UFixed does?
I guess it would be possible to add code so that
Fixed32{2}(1)+Fixed32{4}(1) would work; is that right?
Also, I guess that Fixed32
Perhaps related, I've have a Glob package for finding files and matching
paths against their shell-style pattern: https://github.com/vtjnash/Glob.jl/
On Sat, Mar 14, 2015 at 4:02 PM Simon Danisch sdani...@gmail.com wrote:
I've this piece of code flying around:
function
Expand and show_sexpr are handy!
Looks like you were right, Tamas.
On Saturday, March 14, 2015 at 12:33:56 PM UTC, John wrote:
I was surprised today that the following function doesn't modify an input
array
function f(x)
x += 1
end
However, now I understand that x += 1 is just
Good to to hear that. I've filed an issue to figure out how to make this
more consistent
https://github.com/JuliaLang/julia/issues/10520
2015-03-14 21:06 GMT-04:00 Kristoffer Carlsson kcarlsso...@gmail.com:
On Sunday, March 15, 2015 at 1:02:11 AM UTC+1, Andreas Noack wrote:
You can get
Hello Kristoffer, I don't quite understand what you are doing. But by
judging from the title of your post, I'd like to share with you my opinion,
and I hope it would be helpful.
The (multiple) dispatch used by Julia is a dynamic one, that is, the
dispatch is preformed at run time instead of
You can get around this by specifying that the matrix is symmetric. This
can be done with
cholfact(Symmetric(A, :L))
which then bypasses the test for symmetry and cholfact only looks at the
lower triangle.
However, the error you got is not consistent with the way cholfact works
for dense
El sábado, 7 de marzo de 2015, 11:59:47 (UTC-6), Alan Edelman escribió:
With about a week left, I'd love to find out how many digits of π we can
get only from Julia.
Perhaps we can coordinate a worldwide distributed computation this week.
In a different direction, it seems not to be
If you mean a fixed point number, you might want to check out
FixedPointNumbers.jl.
--Tim
On Saturday, March 14, 2015 06:28:00 PM Christian Peel wrote:
I've been toying around with implementing a fixed-point type in Julia.
This has been mentioned before (http://bit.ly/1DlF2S0) I guess that it
From my Finite Element code I generate a global stiffness matrix K.
However, I can not use the cholesky factorization on it because of
ERROR: ArgumentError: sparse matrix is not symmetric/Hermitian
in cholfact at sparse/cholmod.jl:916
in cholfact at sparse/cholmod.jl:991
However, I am pretty
Ok, I will give a minimum working example.
Consider this:
abstract FElement
type LinTrig : FElement
v1::Int
end
type LinQuad : FElement
v1::Int
v2::Int
end
type Node
c::Float64
end
type FEMesh
node::Vector{Node}
elements::Vector{FElement}
end
function
`x[:]` works, because the values of `x` can be changed. Nevertheless, `x`
itself (its address) cannot be changed. When you do `x=x+1` in the callee,
it will bind `x` to a new local variable, which has different address from
the previous `x`.
The same lethargy applies to `x[1] += 1`.
On
On Saturday, March 14, 2015 at 11:06:06 PM UTC+1, Mauro wrote:
type LinTrig : FElement
v1::Int
end
Here you should probably use `immutable`, that way it will be stored as
efficiently as ints.
I actually do use immutable, I just forgot to write it in the example.
type
Maybe I can create a macro
macro’s can only modify syntax. they don’t have access to any type
information. i don’t see how that will help you.
--
if i understand your comments correctly, i think you could structure your
algorithm as so (where i’ve called the primary
On Saturday, March 14, 2015 at 5:26:25 PM UTC, Erik Schnetter wrote:
As long as linear algebra is handled by BLAS, using multi-threading in
Julia isn't really necessary. If the matrices are large enough to warrant
multithreading, then using a multi-threaded BLAS is usually more
Adding to my last reply.
If my mesh looked like
type FEMesh
node::Vector{Node}
elements_1::Vector{LinTrig}
elements_2::Vector{LinQuad}
end
than it would also be OK because I could first call the function with
elements_1, and then elements_2 and both times the compiler would know
And I agree it is type unstable, that's the crux.
I need to rewrite my Mesh
Maybe I can create a macro
On Saturday, March 14, 2015 at 11:06:06 PM UTC+1, Mauro wrote:
type LinTrig : FElement
v1::Int
end
Here you should probably use `immutable`, that way it will be stored as
On Sunday, March 15, 2015 at 1:02:11 AM UTC+1, Andreas Noack wrote:
You can get around this by specifying that the matrix is symmetric. This
can be done with
cholfact(Symmetric(A, :L))
Thank you, just what I was looking for.
which then bypasses the test for symmetry and cholfact only
How about a multithreaded (+ coroutine as it is now) HttpServer?
On Friday, March 13, 2015 at 4:52:37 AM UTC+1, Viral Shah wrote:
I am looking to put together a set of use cases for our multi-threading
capabilities - mainly to push forward as well as a showcase. I am thinking
of starting
On Saturday, March 14, 2015 07:27:48 PM Christian Peel wrote:
Looking at the package, I am curious to know why Fixed32 does not have a
dynamic storage type as UFixed does?
They were written by different people, presumably for different purposes.
I guess it would be possible to add code so
not familiar with the vtk format but are you sure the the x,y,z coordinates
lay not directly after each other?
Could try:
write(fid, vcat(x[:]', y[:]', z[:]') )
Am Samstag, 14. März 2015 18:54:59 UTC+1 schrieb Christian Dengler:
Ty for your answers. I'm not familiar with vtk export on python,
I've this piece of code flying around:
function searchfile(file_name::String, root_folder::String)
file_name == return
files_folders = readdir(root_folder)
folders = filter(x-isdir(joinpath(root_folder, x)),
files_folders)
files =
Hello,
I am writing some code for Finite Elements in Julia. As usual, I have a
mesh with elements and nodes. However, I do not want to restrict myself to
only using one type of element per mesh and therefore I have a hierarchy of
element types along the lines of:
abstract FElement
type
Hello,
I am writing some code for Finite Elements in Julia. As usual, I have a
mesh with elements and nodes. However, I do not want to restrict myself to
only using one type of element per mesh and therefore I have a hierarchy of
element types along the lines of:
abstract FElement
type
I agree with @Mauro on the definition of `FEMesh`.
When @Kristo writes `elements::Vector{FElement}`
you implied that `elements` can be an heterogeneous vector, which contains
`LinTrid` and `LinQuad` at the same time.
So the compiler has to test each component of the vector, which makes the
Read
http://docs.julialang.org/en/latest/manual/performance-tips/?highlight=performance#performance-tips
in particular the first one avoiding global variables. I get up to 40
times the performance by putting your code in a function.
Cheers
Lex
On Sunday, March 15, 2015 at 2:10:29 PM UTC+10,
Late to the party but here's a simple monte carlo simulation visualized
using Reactive, Interact, Compose
randpoint() = (rand(), rand())
isin(x, y) = 0.25 (x-0.5)^2 + (y-0.5)^2
Compose.set_default_graphic_size(8inch, 8inch)
@manipulate for switch=false,
t=fpswhen(switch, 10),
I am very new to Julia. I'm working on adding some features to a fairly
simple Fortran simulation, and decided to try writing it in Python to make
it easier to explore variations. After a lot of optimization work I got it
within about 8x slower than the Fortran code. I had read about Julia and
I would like something like the following to work:
A=rand(1000,4)
plot(A) # this would plot 4 curves each
with 1000 data points and auto-labelled as 1:1000
plot(A,Geom.histogram) # this would plot 4 histograms with
1000
Do we consider nullness of java objects and nullables to be similar enough that
they should actually be checked with the same predicate? I guess the two
concepts do have a lot of things in common, though methods written to work with
nullables might not be prepared to accept java objects.
Hi, everyone.
I am wonder how to convert Julia code into runnable LLVM IR(the *.ll file).
There is a call named `code_llvm` can compile Julia function into LLVM IR.
But its result contains something like `%jl_value_t*` hidden the object
type, and makes it not a pure LLVM IR.
Is there a way to
I was surprised today that the following function doesn't modify an input
array
function f(x)
x += 1
end
However, now I understand that x += 1 is just syntactic sugar for x = x + 1.
The reasoning from https://github.com/JuliaLang/julia/issues/7052 makes
sense.
OTOH, x[:] += 1 does modify the
The nrrd format seems to be similar (text header and binary data). You can
have a look at the implementation in Images.jl.
See https://github.com/timholy/Images.jl/blob/master/src/ioformats/nrrd.jl#L356
for the part where the data is written. Note that the data function is
only required here,
Avik, I think it would be worth opening an issue on either julia or
Compat.jl about this.
On Sat, Mar 14, 2015 at 7:14 AM, Toivo Henningsson toivo@gmail.com
wrote:
Do we consider nullness of java objects and nullables to be similar enough
that they should actually be checked with the same
Hi, I have thought about it
I'm currently running linux on my day to day laptop workstation but i used
to run openbsd.
I'll try to find the time to run a test build.
llvm is v3.5 in OpenBSD 5.6
ggc is 4.9
gmake is 4.0
gfortran is 4.2
git is 1.9
perl is in base
wget is in ports
m4 is 1.4.17
My main use cases involve operations that I want to parallelize over the
last dimension of an array. In C/C++ I'd use #pragma parallel for or a
thread pool.
E.g., say I have a function f that operates in-place, like
function f(x,y)
for i=1:length(x)
y[i] = exp(x[i])
end
end
It
My mental model is that
x[:] += 1
is turned into
x[:] = x[:] + 1
which is equivalent to
x[:] = x + 1
which then is turned into a setindex! call. See
http://docs.julialang.org/en/release-0.3/manual/arrays/#assignment
I don't know if the last step is accessible to the user (for
Hello,
I'm trying to save my data as .vtk files, and ran into a problem with the
print and write function.
Resumee of what would solve my problems:
- Using print(filestream, data), but omitting the square brackets, and
- using print(filestream, vector), and actually writes the vector, one
I am confused on the the doc of
[embedding](https://github.com/JuliaLang/julia/blob/master/doc/manual/embedding.rst)...
For instance, when Julia is installed to $JULIA_DIR, one can compile the
above test program test.c with gcc using:
`gcc -o test -I$JULIA_DIR/include/julia
Thanks. Is the (top(endof)) syntax something that is exposed to the
user? Did not work for me:
julia colon(1,(top(endof))([1:4;]))
ERROR: UndefVarError: top not defined
Would be nice when I need to construct the range generated by a lone :
in a macro.
Best,
Tamas
On Sat, Mar 14 2015, Matt
As long as linear algebra is handled by BLAS, using multi-threading in Julia
isn't really necessary. If the matrices are large enough to warrant
multithreading, then using a multi-threaded BLAS is usually more efficient...
-erik
On Mar 13, 2015, at 16:54 , Tobias Knopp
On Mar 12, 2015, at 23:52 , Viral Shah vi...@mayin.org wrote:
I am looking to put together a set of use cases for our multi-threading
capabilities - mainly to push forward as well as a showcase. I am thinking of
starting with stuff in the microbenchmarks and the shootout implementations
It can be helpful to look at the sexpr form:
julia Meta.show_sexpr(expand(parse(“x[:] += 1”)))
(:body, (:(=), GenSym(0), (:call, :colon, 1, (:call, :(top(endof)), :x))),
(:(=), GenSym(1), (:call, :+, (:call, :getindex, :x, GenSym(0)), 1)),
(:call, :setindex!, :x, GenSym(1), GenSym(0)), (:return,
There are no leap seconds in universal time. There are leap seconds in UTC
which bridges terrestrial time (SI seconds) with universal time (day = 1
earth rotation; second = 1/86400 of an earth rotation) by using SI seconds
as the basic unit but introducing leap seconds here and there to ensure
I think the only way to do this right now is to dump the whole image so you
get all the necessary prior definitions. See this comment for the command
line:
https://github.com/JuliaLang/julia/issues/9430#issuecomment-67758882
(related to Emscripten, which doesn't work yet, but may work with
Le samedi 14 mars 2015 à 07:11 -0700, Zexuan Luo a écrit :
I am confused on the the doc of
[embedding](https://github.com/JuliaLang/julia/blob/master/doc/manual/embedding.rst)...
For instance, when Julia is installed to $JULIA_DIR, one can
compile the above test program test.c with gcc
I have added JuliaCon to Lanyrd here: http://lanyrd.com/2015/juliacon/
Jiahao and the other organizers should feel free to claim the event and
make updates
(also: please ask a question in only one place because the same people
answer here and on StackOverflow)
On Sat, Mar 14, 2015 at 10:32 AM, Isaiah Norton isaiah.nor...@gmail.com
wrote:
I think the only way to do this right now is to dump the whole image so
you get all the necessary prior
I presume that there are other Julia users attending the SIAM CSE
conference in Salt Lake City this weekend. Would anyone be interested in
meeting up?
It is my glory to send a pull request. Please wait...
2015-03-14 22:43 GMT+08:00 Milan Bouchet-Valat nalimi...@club.fr:
Le samedi 14 mars 2015 à 07:11 -0700, Zexuan Luo a écrit :
I am confused on the the doc of
[embedding](
One method that I have used to export VTK from Julia is simply using the
VTK-library from python and calling it with PyCall.
Something like
this: https://gist.github.com/KristofferC/9a989a2c0518bb70009c
On Saturday, March 14, 2015 at 1:41:04 PM UTC+1, Christian Dengler wrote:
Hello,
I'm
On Saturday, March 14, 2015 at 9:15:32 AM UTC-4, Tamas Papp wrote:
I don't know if the last step is accessible to the user (for
metaprogramming), would be interesting to learn about that.
Here you go:
julia expand(parse(x[:] += 1))
:(begin
GenSym(0) = colon(1,(top(endof))(x))
in that case, one usage might be that it's necessary for porting a
competitive BLAS into julia.
On Sat, Mar 14, 2015 at 1:26 PM Erik Schnetter schnet...@gmail.com wrote:
As long as linear algebra is handled by BLAS, using multi-threading in
Julia isn't really necessary. If the matrices are
Ty for your answers. I'm not familiar with vtk export on python, and i'm
confident that finding my mistake will be easier than trying to understand
what you did there with pycall.
As for the nrrd code, it seems to be doing exactly what i did. I found one
mistake i did previously though, telling
Hello colleagues,
is there a simple method to search for data files (so not code) along a
given path?
data_path = ['/usr/local_data','/opt/all_data']
f = find_file(a.data,data_path);
Wishing a happy day,
Andreas
60 matches
Mail list logo