Re: [julia-users] Solving Sparse System with Tikhonov regularization

2015-01-11 Thread Chris Foster
On Sat, Jan 10, 2015 at 11:46 PM, Tobias Knopp tobias.kn...@googlemail.com wrote: I am already using iterative solvers for my problem. Interestingly the Kaczmarz method provides extremely good results for my matrix. Since it is challenging to choose lambda and the number of iterations in

Re: [julia-users] Solving Sparse System with Tikhonov regularization

2015-01-10 Thread Chris Foster
Hi Tobi, I think cholfact(X'X + lambda I)\(X'y) should work: X'X is positive (semi-)definite, lambda*I is positive definite for lambda0, and the sum of any two positive definite matrices is also positive definite. Alternatively, if you're worried about the numerical conditioning of X'X, you can

Re: [julia-users] ANN: GeometricalPredicates.jl

2014-10-13 Thread Chris Foster
Right, that makes sense. When I asked about rescaling I was wondering about how floating point roundoff affects the consistency of predicates before and after transforming points by a scaling/offset to put the coordinates into the range 1-2. I think what you're saying is that yes, consistency

Re: [julia-users] ANN: GeometricalPredicates.jl

2014-10-10 Thread Chris Foster
This is pretty cool. Writing a robust set of geometric predicates requires quite an attention to detail. Some questions: Restricting to the float range 1.0=x2.0 essentially makes the input a fixed point representation, with fixed point scaling factor eps(1.0) = 2.220446049250313e-16. How does

Re: [julia-users] Keyword arguments and type specialization

2014-06-29 Thread Chris Foster
On Sun, Jun 29, 2014 at 1:06 AM, Milan Bouchet-Valat nalimi...@club.fr wrote: One solution I thought of is to create a workhorse function do_freqtable(weights, subset, x...), which would be specialized on types. It sounds like a bit like working around a limitation of keyword arguments, but it

Re: [julia-users] Optim/DualNumbers question (maybe a math question?)

2014-06-03 Thread Chris Foster
On Tue, Jun 3, 2014 at 1:13 PM, Chris Foster chris...@gmail.com wrote: So you can compute the real part L of the Cholesky decomposition exactly as usual. Given that you now have L, you want the lower triangular matrix M. Because L and M are lower triangular that's actually quite easy: matrix

Re: [julia-users] Optim/DualNumbers question (maybe a math question?)

2014-06-03 Thread Chris Foster
On Wed, Jun 4, 2014 at 2:12 AM, Chris Foster chris...@gmail.com wrote: fiddling with Base.BLAS.dot only got me as far as a segfault so far. Actually I think I've fixed that now in the gist and using BLAS.dot directly is faster, though still not very impressive. According to @time, I've still

Re: [julia-users] Optim/DualNumbers question (maybe a math question?)

2014-06-03 Thread Chris Foster
for the result of the decomposition? Cheers, Kevin On Tuesday, June 3, 2014, Chris Foster chris...@gmail.com wrote: On Wed, Jun 4, 2014 at 2:12 AM, Chris Foster chris...@gmail.com wrote: fiddling with Base.BLAS.dot only got me as far as a segfault so far. Actually I think I've fixed that now

Re: [julia-users] Optim/DualNumbers question (maybe a math question?)

2014-06-02 Thread Chris Foster
On Tue, Jun 3, 2014 at 4:43 AM, Thomas Covert thom.cov...@gmail.com wrote: I was hoping to find some neat linear algebra trick that would let me compute a DualNumber cholesky factorization without having to resort to non-LAPACK code, but I haven't found it yet. That is, I figured that I could

Re: [julia-users] Optim/DualNumbers question (maybe a math question?)

2014-06-02 Thread Chris Foster
also worked out a similar derivation - though I wasn't able to prove to myself that the equation B = L*M' + M*L' has a unique solution for M. This feels similar to the Sylvester Equation, but its not quite the same... On Mon, Jun 2, 2014 at 10:13 PM, Chris Foster chris...@gmail.com wrote

Re: [julia-users] Re: Element-wise `and` for matrixes of booleans (i.e. BitArrays), and broadcasting

2014-05-21 Thread Chris Foster
The problem here is that . isn't defined as an operator, so there's no broadcasting form of at all. At a guess I'd say that's just an oversight, in which case making a github issue is the right thing. On the other hand, the broadcasting versions of .* etc are all defined on generic

Re: [julia-users] Re: Why do macros use the @ sign?

2014-05-21 Thread Chris Foster
Hopefully encouraging less fancy metaprogramming stuff means simpler library implementations which actually feel like they're written in the language. It's a real pain when you have to learn a new DSL for every library implementation you want to understand (I say this having read a lot of C++

Re: [julia-users] GSOC 3D Visualizations plotting API - Make a wish!

2014-05-20 Thread Chris Foster
I'm also pretty excited about using the rift for scientific/technical visualization (I have a DK1), but so far that hasn't been reflected by an appropriate amount of spare hacking time. If you haven't already, I'd recommend checking out the VRUI youtube demos (for example, this one is pretty

Re: [julia-users] GSOC 3D Visualizations plotting API - Make a wish!

2014-05-19 Thread Chris Foster
On Mon, May 19, 2014 at 11:44 PM, Chris Foster chris...@gmail.com wrote: I think these last two points probably generalise to 1D, 2D and 3D data. IMO there's a case to be made for a simple default GUI with a capable camera model and control over data set visibility. This would go a long way

Re: [julia-users] Accessing the loop variable (and pi as float)

2014-05-17 Thread Chris Foster
On Sat, May 17, 2014 at 9:59 PM, Hans W Borchers hwborch...@gmail.com wrote: Yesterday I implemented a function calculating arc length of curves (to the last digit) when I came across the following stumbling blocks. Image the following function where I leave a for-loop with a 'break' statement:

Re: [julia-users] Accessing the loop variable (and pi as float)

2014-05-17 Thread Chris Foster
On Sat, May 17, 2014 at 11:14 PM, Hans W Borchers hwborch...@gmail.com wrote: and it took me some time before I realized that the answer came from outside the function. That behavior can really lead to very difficult testing situations. Fair enough. I suspect there can be some subtle bugs

Re: [julia-users] Some Syntactic Sugar for end Keyword

2014-05-09 Thread Chris Foster
Huh, at first I thought this could be done with a macro (not that I'd recommend using any such macro in actual code!), but when I tried I couldn't quote an incomplete block: julia :(end) ERROR: syntax: unexpected end Looking at the underlying Expr for :(begin end) it becomes clear why this is:

Re: [julia-users] Re: Error: type non-boolean (BitArray(1)) used in boolean context

2014-04-24 Thread Chris Foster
On Thu, Apr 24, 2014 at 7:52 PM, Isaac dux...@gmail.com wrote: The rand(1) in julia always produces an array rather than a number in Matlab. In matlab a scalar is the same as a 1x1 matrix. Luckily julia doesn't insist on any such madness... try rand() instead :-)

Re: [julia-users] bit-twiddling micro benchmark

2014-04-10 Thread Chris Foster
Is it the zlib implementation in the function crc32() you're comparing to? Taking a peek in the zlib source, it looks like they do a fair bit of manual loop unrolling and also process the CRC 4 bytes at a time. Given those differences, the speed difference might not be so surprising. On Thu,

Re: [julia-users] Re: bit-twiddling micro benchmark

2014-04-10 Thread Chris Foster
On Fri, Apr 11, 2014 at 6:44 AM, Laszlo Hars laszloh...@gmail.com wrote: note that the running time does not change with a partial loop unroll, like this: ~~~ function signed_loop{D:Unsigned, A:Unsigned}(::Type{D}, r::A, data, table::Vector{A}) local j = 0 for i = 1 :

Re: [julia-users] Re: The then keyword

2014-03-21 Thread Chris Foster
On Sat, Mar 22, 2014 at 9:23 AM, Stefan Karpinski ste...@karpinski.org wrote: I kind of like that idea, actually. On Fri, Mar 21, 2014 at 5:10 PM, Matt Bauman mbau...@gmail.com wrote: I quickly acclimated to Stefan's idiom and now happily read and write code containing it. That said, it

Re: [julia-users] Re: The then keyword

2014-03-21 Thread Chris Foster
the attraction as a one liner though. -Jacob On Mar 21, 2014 9:52 PM, Chris Foster chris...@gmail.com wrote: On Sat, Mar 22, 2014 at 9:23 AM, Stefan Karpinski ste...@karpinski.org wrote: I kind of like that idea, actually. On Fri, Mar 21, 2014 at 5:10 PM, Matt Bauman mbau...@gmail.com wrote

Re: [julia-users] Re: The then keyword

2014-03-20 Thread Chris Foster
On Thu, Mar 20, 2014 at 7:24 PM, Cristóvão Duarte Sousa cris...@gmail.com wrote: Although the short-circuit is more or less known among several programming languages, I don't think it's that readable outside of an if. Maybe after a while one starts to read that code as if then, but it's not so