A=rand(4,4); A[:,vec(A[1,:].0.7)]
--Tim
On Sunday, March 29, 2015 12:07:10 PM Andreas ten Pas wrote:
How can we do the following *Matlab* code in *Julia*?
A=rand(4); A(:,A(1,:)0.7)
I've tried this in *Julia*:
A=rand(4,4); A[:,A[1,:].0.7]
And how would we combine multiple *boolean
After some thinking I defined a custom function (looping over the array)
for the mean.
This is a bit cumbersome but fine given that it is about 3 times faster and
has only 288 bytes of memory allocation (compared to 1 GB!) in the example
below.
If anyone knows how to do this faster I would
Hello all
I understand that indexing a vector creates a copy thereof. This does not
seem to be the optimal way to, say, sum over all elements which satisfy a
certain condition.
Is there a way to optimize the performance of the toy examples below?
I just did read up on various functions such as
When it comes to advanced techniques for optimizing dynamic code, we have
barely scratched the surface. What Julia does now is essentially just
static compilation at runtime – enabled by aggressive specialization and
type inference. All the fancy things that fast JavaScript implementations
do to
see https://github.com/JuliaLang/Compat.jl
On Monday, March 30, 2015 at 6:53:30 AM UTC-7, Abel Soares Siqueira wrote:
Hi,
I have this code:
push!(DL_LOAD_PATH,.)
But the master moved DL_LOAD_PATH to Libdl.
I want my code to work on release-0.3 and master, so I changed it to
Related to https://github.com/JuliaLang/julia/issues/10618 – I think this
should be fixed.
On Mon, Mar 30, 2015 at 6:08 AM, Milan Bouchet-Valat nalimi...@club.fr
wrote:
Le lundi 30 mars 2015 à 04:54 -0500, Tim Holy a écrit :
A=rand(4,4); A[:,vec(A[1,:].0.7)]
And as regards your second
Hi,
I have this code:
push!(DL_LOAD_PATH,.)
But the master moved DL_LOAD_PATH to Libdl.
I want my code to work on release-0.3 and master, so I changed it to this:
try
push!(DL_LOAD_PATH,.)
catch
push!(Libdl.DL_LOAD_PATH,.)
end
Is there a better option?
Best
On Monday, March 30, 2015 09:30:48 AM Stefan Karpinski wrote:
Related to https://github.com/JuliaLang/julia/issues/10618 – I think this
should be fixed.
And as that link points out, it is...once we can merge #10525.
--Tim
On Mon, Mar 30, 2015 at 6:08 AM, Milan Bouchet-Valat
I think I've got my head pretty much wrapped around all of this. I figured
I'd recap just in case anyone else comes across any of the issues discussed.
import DataFrames # Like import DataFrames in Python, requires
DataFrames.foo for all methods
using DataFrames# Like import DataFrames;
Nope, that's the best way to do it. Yet another illustration that it's trivial
to write code that beats any attempt to cleverly mix together library
functions.
I'd get rid of the @inbounds, though, it doesn't serve any purpose for a
function that runs a long loop. Inlining too much can
Thanks,
I ended up using Stefan's bit shifts solution because it works and doesn't
require any additional dependency.
Thanks for the summary! I think something like this should go into the
manual as it is not particularly clear...
On Mon, 2015-03-30 at 17:09, kevin.dale.sm...@gmail.com wrote:
I think I've got my head pretty much wrapped around all of this. I figured
I'd recap just in case anyone else comes
I have a DataArray{UTF8String,1} and I have a Dict generated using indexmap
that should take this UTF8String and return an Int64, however, when I pass
this through `map`, I get back a DataArray{Any, 1} instead of an
Array{Int64, 1}
Any idea why and what I can do to fix it? I'm using Julia
On Sunday, March 29, 2015 at 1:06:29 PM UTC-4, Milan Bouchet-Valat wrote:
Le dimanche 29 mars 2015 à 09:46 -0700, Philip Tellis a écrit :
As to my actual problem, what I have is a DataFrame with two columns, one
a DataArray{UTF8String, 1} and the other a DataArray{Int64, 1}, and I need
I have a DataArray{UTF8String, 1} and I am trying to map it to an
Array{Int64, 1} using a Dict lookup. My Dict is of type Dict{String,
Int64}, and I'm using map to do the lookup.
However, it seems that the map returns a DataArray{Any, 1} instead of an
Array{Int64, 1}, and I don't understand
Hi Michela,
It looks like you're referring to JuMP, in which case:
@defVar(m, a = x = b, SemiCont)
should do the trick. See also the documentation:
http://jump.readthedocs.org/en/release-0.8/refvariable.html?highlight=semicontinuous
We prefer to direct optimization-related questions to
Hello,
I have a function that pushes some data onto other processes. It does this
by constructing a RemoteRef on each worker process and then using put!() to
put the data onto each process. These RemoteRef's are stored in an array.
The main function then calls some other functions on the
Le lundi 30 mars 2015 à 09:46 -0500, Tim Holy a écrit :
Nope, that's the best way to do it. Yet another illustration that it's
trivial
to write code that beats any attempt to cleverly mix together library
functions.
I'd get rid of the @inbounds, though, it doesn't serve any purpose for
how do I model in Julia a variable that can be either zero or in some range
non containing zero? e.g. x \in 0 \cup [a,b] where a0.
Thanks in advance for any information!
Michela
Hallo everyone!
how do I model a variable (array of variables) that can either be zero or
in some range not containing zero?
e.g. x∈0∪[a,b] where a0
Thank you in advance for any information!
Michela
Thanks very much, it worked.
Best Regards,
Abel
On 03/30/2015 11:31 AM, Tony Kelman wrote:
see https://github.com/JuliaLang/Compat.jl
On Monday, March 30, 2015 at 6:53:30 AM UTC-7, Abel Soares Siqueira
wrote:
Hi,
I have this code:
push!(DL_LOAD_PATH,.)
But the
Hi Michela,
I think you're going to need to provide some additional information. Are
you modeling this in JuMP by chance?
Cheers,
Kevin
On Mon, Mar 30, 2015 at 12:25 PM, Michela Di Lullo
michela.dilu...@uniroma1.it wrote:
Hallo everyone!
how do I model a variable (array of variables)
Hi all,
Consider the following:
typealias Edge Pair{Int,Int}
src(e::Edge) = e.first
dst(e::Edge) = e.second
Under what circumstances, if any, will calling src(e) or dst(e) incur a
performance penalty relative to
p = Pair{Int,Int}(...)
p.first, p.second
?
Thanks.
What is the rationale for the change? It makes Julia faster?
Right now I only see this as a limitation from an user perspective.
-Júlio
Extended discussion: https://github.com/JuliaLang/julia/issues/10154
On Mon, Mar 30, 2015 at 6:22 PM, Júlio Hoffimann julio.hoffim...@gmail.com
wrote:
What is the rationale for the change? It makes Julia faster?
Right now I only see this as a limitation from an user perspective.
-Júlio
Actually there were some bugs in the code. The following code works:
zero_mask!{T,N}(a::AbstractArray{T,N}, mask::AbstractArray{Bool,N}) =
setindex!(a, zero(T), find(!mask))
function do_stuff{N}(rows, columns, mask::Nullable{Array{Bool,N}})
a = rand(rows, columns)
isnull(mask) ? nothing
Hi all,
Match.jl provides both simple and advanced pattern matching capabilities
for Julia. Features include:
- Matching against most data types
- Deep matching within data types and matrices
- Variable binding within matches
Usage generally looks like this:
using Match
@match item
Say I want to be able to set the value of an array to zero where a boolean
mask array is false, then I can define this function:
zero_mask!(a::AbstractArray, mask::AbstractArray{Bool}) = setindex!(a,
zero(T), find(!mask))
I have a function that constructs arrays and part of its job is to
Il giorno lunedì 30 marzo 2015 21:45:13 UTC+2, Miles Lubin ha scritto:
Hi Michela,
It looks like you're referring to JuMP, in which case:
@defVar(m, a = x = b, SemiCont)
should do the trick. See also the documentation:
I have some data for which I want to find the mode(s) of the kernel density
estimate of the data. Is there anything that already does this? If not what
is the best approach?
No explicit loop is needed:
@defVar(m, inf[i]= pt[i=1:hmax] =sup[i], SemiCont)
They keyword SemiCont means that the variable can be either equal to zero
or fall within the given bounds.
Be sure to use a solver which supports this class of variables (Gurobi or
CPLEX).
On Monday, March 30,
As long as no other methods for src and dst might apply, they should be inlined
and I believe the performance should be exactly the same.
32 matches
Mail list logo