I'm trying to solve a large number (50) of non-linear simultaneous equations in Julia. For the moment I'm just trying to make this work with 2 equations to get the syntax right etc. However, I've tried a variety of packages/tools - NLsolve, nsolve in
In Julia, I might want to write a function that returns 0 if the input is less than 1, or returns 2 if the input is greater than or equal to 1. This is a pretty simple function, and the verbosity of a five-line if else construct is probably excessive
Is there an efficient way to do the following in Julia in one line of code? foldl((prev, x)-> [prev; prev[end] + x] , 0, block_lengths) For example, for block_lengths = [2, 2, 2, 2, 3] the desired output is [0, 2, 4, 6, 8, 11] (I presume that the way
Using julia and PyPlot (which looks like it calls matplotlib) I've got a radial log plot ranging from 0dB on the outer edge of the plot to -50dB on the interior: using PyPlot ; theta = 0:0.02:1 * pi ; n = length(theta) ; U = cos( theta ).^2 ; V = zer
Is it possible to use the julia language in c++? Does the julia language provides some libraries to include? For now, I am trying to use some funcitons of the julia language in my c++ project. Is this possbile? What could I do? thanks in advance. ---
So, I've been playing around with Gadfly in Julia and run into this issue. Geom.ribbon does't accept Int vectors as input for ymin and ymax when used in combination with Geom.smooth. I was wondering if this is a bug, is intended, or if I'm doing anyt
I wanted to have a look at the julia language, so I wrote a little script to import a dataset I'm working with. But when I run and profile the script it turns out that it is much slower than a similar script in R. When I do profiling it tells me that
Julia has an interesting support for Unicode characters. The syntax allows me to run the following in the iJulia notebook. μ = 10 σ = 20 ∑ = sum a = [1,2,3,4] ∑(a) # prints 10 However, it doesn't always seem like you can use Unicode characters for fu
On my Ubuntu 14.04 box, Julia is complaining that my machine doesn't support AVX instructions. What may be the reason for this? --------------Solutions------------- "AVX instructions" are extensions to the basic x86 instruction set, and are relativel
I am trying to write a function that would solve any general version of this problem: If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples
In numpy you can do np.allclose(A, B) to see if the arrays A & B are close. Is there any function in Julia to do so ? --------------Solutions------------- For single numbers, isapprox is defined. If you want to extend this to an element-wise comp
Julia will have multi-threading soon. I'm curious to know the impact on its GC algorithm. At one point in the thread, Stefan says that "Memory allocation will always be thread-local." If Julia will always use thread-local storage, doesn't that mean i
In Julia, why is immutability a "property" of overall types (in the Julia sense of the word, so more akin to a struct or class in other languages) rather than variables? e.g. In Rust (and I think most languages with support for immutability), whether
Setup: Consider a parametric type in Julia type MyType1{T1} x::T1 end I define two methods for a single function over this type using multiple dispatch and type parameters: f1(m::MyType1, i::Int64) = m.x + i #Method 1 f1{T1}(m::MyType1, i::T1) = m.x
In Julia, I get no stack traces any time a module is loaded with errors. The module compiles fine on its own, but when a call to a method of the module gives an error, the only thing that gets printed is the exception string, but there is no line/sta
I am using Distributions.jl since the julia standard library does not support all necessary distributions Within 1 special function I need the same random numbers. I am looking for a way to use always the same random number generator for this part, b
Ive been looking at speed comparisons of the new language Julia and have been impressed as it seems much faster than Python. The thing is so much of the underlying code I have created as well as user-contributed modules are already in Python. So I wa
For example, I want to see what's "inside" of the @time macro. How would I do this? --------------Solutions------------- While it doesn't show you the macro itself, you can see the results of the macro expansion with macroexpand. For example: julia
I would like to write julialang code in emacs. Is there an easy way to do it like, for example, when you do python code (all these reserved words in colors and indentation)? Here is what I have done so far: I created the file ~/.emacs.d/init.el with
I am trying to add support for new intrinsics in Julia. For this I use the llvmcall fork. However, when using this in a Julia function, I always encounter the following problem: declare function: julia> function ptx_test(a,b,c) idx = Base.llvmcall