Re: [julia-users] ControKTH

2016-06-13 Thread Linus Härenstam-Nielsen
r? What license is this code under? > > On Sun, Jun 12, 2016 at 2:54 PM, Linus Härenstam-Nielsen < > linu...@gmail.com > wrote: > >> Here we go: https://github.com/Linusnie/ControlBasic >> >> Note that at the time I used a 0.4.0 dev build so everything might not &g

Re: [julia-users] ControKTH

2016-06-12 Thread Linus Härenstam-Nielsen
Here we go: https://github.com/Linusnie/ControlBasic Note that at the time I used a 0.4.0 dev build so everything might not work properly. On Sunday, June 12, 2016 at 7:35:51 PM UTC+2, Linus Härenstam-Nielsen wrote: > > Hi author of (part of) ControlKTH here > > This was inde

Re: [julia-users] ControKTH

2016-06-12 Thread Linus Härenstam-Nielsen
Hi author of (part of) ControlKTH here This was indeed a student project last summer, we based the development on Control.jl . We decided not to post the code publicly under the university name since I copied part of MatLab's algorithm for drawing root

[julia-users] rref in 0.4.3

2016-02-04 Thread Linus Härenstam-Nielsen
So it seems like the rref function has been taken out from Base (https://github.com/JuliaLang/julia/pull/9804). Is there a package floating around that contains the same function? I really liked having it for checking my work and for a quick way of find spanning vectors for kernel spaces etc..

[julia-users] Re: setindex! for matrix of vectors

2015-07-29 Thread Linus Härenstam-Nielsen
I haven't found a solution that works perfectly yet but I circumvented the problem by making a check for colons: rows = inds[1] == Colon() ? (1:sys.ny) : inds[1] cols = inds[2] == Colon() ? (1:sys.nu) : inds[2] Not perfect since it limits you to always have to use exactly 2 incidences, but it

[julia-users] setindex! for matrix of vectors

2015-07-28 Thread Linus Härenstam-Nielsen
I'm implementing a setindex! method for an object with a field of type Matrix{Vector{Float64}} (a matrix of vectors) and I've run into a problem with getting the Colon() index to work properly. It comes down to this: julia A = Array(Vector{Int}, 1) 1-element Array{Array{Int64,1},1}: #undef

[julia-users] Tracking a type instability

2015-07-24 Thread Linus Härenstam-Nielsen
I recently poked around a bit with the @code_warntype macro in my code and quickly realized that a lot of my variables were assigned Any at compile time. I tried to find the reason for it and got down to the eig function: julia @code_warntype eig(rand(Float64, 5,5)) Variables:

Re: [julia-users] Tracking a type instability

2015-07-24 Thread Linus Härenstam-Nielsen
Thanks for the replies. I filed the issue here https://github.com/JuliaLang/julia/issues/12304 (#12304) On Friday, July 24, 2015 at 4:09:07 PM UTC+2, Stefan Karpinski wrote: Please do file an issue https://github.com/JuliaLang/julia/issues if you haven't already. On Fri, Jul 24, 2015 at

Re: [julia-users] Passing keyword arguments through a function

2015-07-21 Thread Linus Härenstam-Nielsen
This worked! Didn't realize you could use ; when calling functions. On Tuesday, July 21, 2015 at 4:49:36 PM UTC+2, Stefan Karpinski wrote: f(floor(x); args...) should work. On Tue, Jul 21, 2015 at 10:14 AM, Linus Härenstam-Nielsen linu...@gmail.com javascript: wrote: I am looking

[julia-users] Passing keyword arguments through a function

2015-07-21 Thread Linus Härenstam-Nielsen
I am looking for a way to automatically pass on all keyword arguments through a function. Naively I would like to be able to do something like this: f(x::Int; y::Int=5, z::Int=3) = x+y+z f(x::Float64; args...) = f(floor(x), args...) But that doesn't work currently (actually, it causes

[julia-users] Multiple dispatch for keyword arguments

2015-06-30 Thread Linus Härenstam-Nielsen
As I understand it keyword arguments aren't affected by multiple dispatch, I'm guessing it is a performance decition but it means you can run into the following situation: f(x::Int; t::Int=0) = t f(x::Number; t::Number=1) = t f(1, t=1.0) ERROR:TypeError:f:intypeassert, expected Int64, got

[julia-users] Supertypes in function arguments

2015-06-26 Thread Linus Härenstam-Nielsen
I ran into a problem with types today that I don't know how to interpret. If I define a function according to f(x::Real) = x it returns x as expected as long as the type of x is a subtype of Real. However if I define f(x::Array{Real}) = x it throws MethodError no matter what I pass as argument.

[julia-users] Re: Supertypes in function arguments

2015-06-26 Thread Linus Härenstam-Nielsen
:12 AM UTC-7, Linus Härenstam-Nielsen wrote: I ran into a problem with types today that I don't know how to interpret. If I define a function according to f(x::Real) = x it returns x as expected as long as the type of x is a subtype of Real. However if I define f(x::Array{Real}) = x

[julia-users] Re: PyPlot not working on 0.4.0

2015-06-19 Thread Linus Härenstam-Nielsen
This fixed it! Thanks

[julia-users] PyPlot not working on 0.4.0

2015-06-18 Thread Linus Härenstam-Nielsen
I am having problems with using PyPlot in the nightly build (version 0.4.0). Typing 'using PyPlot' followed by 'plot([sin(a) for a=linspace(0,2*pi)])' yields the following: _ _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_)|