[julia-users] Using composite types with many fields

2015-06-20 Thread Stef Kynaston
I feel I am missing a simpler approach to replicating the behaviour of a Matlab structure. I am doing FEM, and require structure like behaviour for my model initialisation and mesh generation. Currently I am using composite type definitions, such as: type Mesh coords :: Array{Float64,

[julia-users] Composite types with many fields

2015-06-20 Thread Stef Kynaston
I feel I am missing a simpler approach to replicating the behaviour of a Matlab structure. I am doing FEM, and require structure like behaviour for my model initialisation and mesh generation. Currently I am using composite type definitions, such as: type Mesh coords :: Array{Float64,

[julia-users] Re: Using composite types with many fields

2015-06-22 Thread Stef Kynaston
Thank you all for your help, what David suggested: type MyType a::Float64 b::Int64 MyType() = new() end was what I was originally looking for; this is neat, and effectively works the same (syntactically) as a Matlab structure. Although it does seem like Christo

Re: [julia-users] Using composite types with many fields

2015-06-22 Thread Stef Kynaston
Many thanks for this - the mesh library may very well be helpful in the near future. As it stands I am replicating exactly some existing MATLAB code that my group has been working with; the hope is to provoke a move over to Julia by a straight speed-comparison! However our mesh construction is

Re: [julia-users] Using composite types with many fields

2015-06-22 Thread Stef Kynaston
Many thanks for this Mauro - the mesh library may very well be helpful in the near future. As it stands I am replicating exactly some existing MATLAB code that my group has been working with; the hope is to provoke a move over to Julia by a straight speed-comparison! However our mesh constructio

[julia-users] Memory allocation: type uncertainty of temporary variables within in-built routines and operations

2015-06-25 Thread Stef Kynaston
I have a function "myFunc.jl", say (in actuality, this is quite a mesh generation function). I run my program once to start with, and then time the second run: julia> include("myFunc.jl") myFunc (generic function with 1 method) julia> myFunc(); julia> @time myFunc(); elapsed time: 2.745065871

[julia-users] Workaround for a PosDefException in eigs?

2015-07-10 Thread Stef Kynaston
Dear all, I am experiencing some problems with eigs, and wondered if anyone had any suggestions for a workaround. I need to find the smallest positive eigenvalue, lambda, of the generalised eigenvalue problem A*v = lambda*B*v Here, A and B are large, sparse symmetric stiffness matrices from a