Re: [Haskell-cafe] ANN: Updated OpenGL libraries

2012-02-06 Thread Alberto Ruiz
Thanks!!! On 02/05/2012 11:53 PM, Jason Dagit wrote: Hello, I'm pleased to anounce a minor bug fix release of the OpenGL libraries. This release was prompted by issues and warnings when compiling with ghc-7.4.1. The following packages have been updated: * OpenGLRaw 1.2.0.0 * OpenGL

Re: [Haskell-cafe] Can't figure out cmap in hmatrix

2011-05-31 Thread Alberto Ruiz
On 05/30/2011 10:33 PM, Carter Schonwald wrote: this is actually a bug in the type of cmap, a fix is due in the next release (at least thats what Alberto indicated to me when I asked about this a monthish ago) (note how you have the container type c e, but we want c a and c b ). Instead use the

Re: [Haskell-cafe] NFData instance for Numeric.LinearAlgebra Matrix

2011-03-27 Thread Alberto Ruiz
Hello Tad, It can be defined in terms of rwhnf, Matrix is strict: ghci rwhnf $ [1,2,3,undefined::Double] () ghci rwhnf $ (22) [1,2,3,undefined::Double] *** Exception: Prelude.undefined instance NFData (Matrix t) where rnf = rwhnf ms = [ident 3, (22) [1,2,3,undefined::Double]] ghci

[Haskell-cafe] ANN: hmatrix-0.11

2011-01-26 Thread Alberto Ruiz
Hi all, I am happy to announce hmatrix-0.11, a package for numerical computation based on LAPACK and GSL. Home page: http://code.haskell.org/hmatrix/ Hackage: http://hackage.haskell.org/package/hmatrix Recent changes: http://code.haskell.org/hmatrix/CHANGES By default this version uses

Re: [Haskell-cafe] Matlab Style Logic Operations ala V1.*(V20) on Vectors and Matrices with HMatrix ??

2010-12-21 Thread Alberto Ruiz
Hi Phil, On 12/20/2010 10:49 PM, gutti wrote: Hi all, In Matlab the following line of code: V3 = V1.*(V20) (V20) gives a Bool-Vector with ones (trues) and zero's where elements of V2 are 0; Then this Bool vector is used to multiply all elements in V1 to zero where the condition V20 is not

[Haskell-cafe] Re: hmatrix's fitModel function crashes ghc(i)

2010-11-06 Thread Alberto Ruiz
Hello Roel, Roel van Dijk wrote: Hello, I would like to use hmatrix to do some function fitting with the Levenberg Marquardt algorithm. As an example I would like to fit the very simple function f x = a*x + b on some data points. The problem is that executing the 'fitModel' function crashes

[Haskell-cafe] Re: Numeric.LinearProgramming - confusion in constructors for bounds

2010-03-31 Thread Alberto Ruiz
Hi Ozgur, You are right, the operators are misleading. I will change them to :=: and :=:. And perhaps the symbol :: for the interval bound should also be improved... Thanks for your suggestion! Alberto Ozgur Akgun wrote: Hi everyone and Alberto, Numeric.LinearProgramming[1] provides a

Re: [Haskell-cafe] Linear programming in Haskell

2010-02-26 Thread Alberto Ruiz
24, 2010 at 4:07 AM, Alberto Ruiz ar...@um.es mailto:ar...@um.es wrote: I have uploaded to hackage an interface to the simplex algorithm based on GLPK. It is a very early version, it will probably have lots of problems. In the future I would like to add support for integer

Re: [Haskell-cafe] Linear programming in Haskell

2010-02-24 Thread Alberto Ruiz
liblapack-dev I hope it is useful, Alberto Erik de Castro Lopo wrote: Alberto Ruiz wrote: I think that GSL does not include linear programming solvers, but in the GSL home page there is a reference to the GLPK package: http://www.gnu.org/software/glpk/glpk.html I have not used

Re: [Haskell-cafe] Linear programming in Haskell

2010-02-17 Thread Alberto Ruiz
I think that GSL does not include linear programming solvers, but in the GSL home page there is a reference to the GLPK package: http://www.gnu.org/software/glpk/glpk.html I have not used it, but it would be very nice to have a simple Haskell interface to GLPK (or other similar library) in

[Haskell-cafe] ANN: hmatrix 0.8.3

2010-02-12 Thread Alberto Ruiz
://hackage.haskell.org/package/hmatrix home page: http://code.haskell.org/hmatrix tutorial : http://code.haskell.org/hmatrix/hmatrix.pdf Any feedback is welcome! Alberto Ruiz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo

Re: [Haskell-cafe] Cabal + gfortran?

2009-11-19 Thread Alberto Ruiz
Hi Gregory, The package hmatrix [1] checks for LAPACK and BLAS (and GSL) using a simple script [2] (but it does not compile fortran sources, only a few C helper functions). [1] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hmatrix [2]

Re: [Haskell-cafe] Matrices

2009-04-19 Thread Alberto Ruiz
Using hmatrix-static: import Numeric.LinearAlgebra.Static m = [$mat| 46.0,37.0; 71.0,83.0 |] es = [$mat| 40.9746835443038,42.0253164556962; 76.0253164556962,77.9746835443038 |] chisquare = sum . toList . flatten $ (m - es)^2 / es ::Double -- 1.8732940252518542 Cetin

Re: [Haskell-cafe] ANN: hmatrix-static: statically-sized linear algebra

2009-04-14 Thread Alberto Ruiz
Hi Reiner, Fantastic work! User-friendly static dimension checking is an essential feature for any decent linear algebra library. Your interface using quasiquotation and view patterns is very elegant and practical. I am happy that hmatrix is useful, but I'm afraid that its primitive dynamic

Re: [Haskell-beginners] Re: [Haskell-cafe] Re: permuting a list

2009-02-16 Thread Alberto Ruiz
Heinrich Apfelmus wrote: Alberto Ruiz wrote: How about using random doubles? randomPerm xs = fmap (map snd . sort . flip zip xs) rs where rs = fmap (randoms . mkStdGen) randomIO :: IO [Double] Interesting idea. The chance of duplicates should be negligible now, but that's because we're

Re: [Haskell-cafe] Re: permuting a list

2009-02-15 Thread Alberto Ruiz
Heinrich Apfelmus wrote: Jon Fairbairn wrote: Heinrich Apfelmus writes: The answer is a resounding yes and the main idea is that shuffling a list is *essentially the same* as sorting a list; the minor difference being that the former chooses a permutation at random while the latter chooses a

Re: [Haskell-cafe] hmatrix, Windows and GCC

2009-01-28 Thread Alberto Ruiz
Hi, allan wrote: Hi The INSTALL file in the hmatrix repository has some very clear instructions for installation on Windows. http://perception.inf.um.es/~aruiz/darcs/hmatrix/INSTALL However note this section at the bottom: Unfortunately the lapack dll supplied by the R system does not

[Haskell-cafe] Re: [hmatrix] build error

2008-10-08 Thread Alberto Ruiz
Hi Xiao-Yong, In i686 Arch linux, with the normal blas and lapack, I need: extra-libraries: gsl lapack blas gslcblas gfortran But using atlas-lapack: extra-libraries: gsl lapack f77blas gslcblas atlas gcc_s I don't know how I found that __powidf2 is in libgcc_s :) I will

Re: [Haskell-cafe] Fw: patch applied (ghc): Remove the OpenGL familyof libraries fromextralibs

2008-07-26 Thread Alberto Ruiz
Don Stewart wrote: claus.reinke: But neither do I believe the rumour that OpenGL isn't much used, and forwarding the removal notice gives those users the opportunity to speak up now if they prefer no gaps in OpenGL presence, or forever to hold their peace, as they say. I for one have noticed

Re: [Haskell-cafe] BLAS Solve Example

2008-07-23 Thread Alberto Ruiz
Darrin Thompson wrote: I'm stuck on something that I thought would be easy. I have a matrix and a vector. module Main where import Data.Vector.Dense import Data.Matrix.Dense import BLAS.Matrix.Solve m = listMatrix (2, 3) ([1, 2, 3, 4, 5, 6]::[Double]) v = listVector 2 ([1, 2]::[Double])

Re: [Haskell-cafe] sum in hmatrix and blas?

2008-06-08 Thread Alberto Ruiz
Xiao-Yong Jin wrote: Tomas Andersson [EMAIL PROTECTED] writes: You can never go wrong with a good old fashioned hand written tail recursion when you're in doubt, they are pretty much the closest thing to for-loops there is in haskell and should be easy to grok for Imperative programmers and

Re: [Haskell-cafe] Re: Patrick Perry's BLAS package

2008-06-07 Thread Alberto Ruiz
Patrick Perry wrote: Xiao-Yong Jin wrote: Apart from some warnings, the library compiles fine in my system. But there is a minor issue about the library it links against when `./Setup test'. I need to use `-lcblas' instead of `-lblas' to get it to link to correct libraries. I don't know

Re: [Haskell-cafe] Re: Patrick Perry's BLAS package

2008-06-07 Thread Alberto Ruiz
Xiao-Yong Jin wrote: Salute! Excellent! Patrick Perry [EMAIL PROTECTED] writes: * Support for both immutable and mutable types. Haskell tries to make you use immutable types as much as possible, and indeed there is a very good reason for this, but sometimes you have a 100MB

[Haskell-cafe] Patrick Perry's BLAS package

2008-06-06 Thread Alberto Ruiz
Hello all, I have just noticed that yesterday this fantastic package has been uploaded to hackage: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/blas-0.4 We finally have a high quality library for numeric linear algebra. This is very good news for the Haskell community.

Re: [Haskell-cafe] Re: hmatrix

2008-06-05 Thread Alberto Ruiz
Hello Bulat and Anatoly, I have written a first version of an interface to inplace updates in the ST monad for the hmatrix vectors and matrices. Many things must be improved (range checking, documentation, etc.) but I hope that the general idea makes sense. A few usage examples:

[Haskell-cafe] Re: hmatrix

2008-06-03 Thread Alberto Ruiz
Anatoly Yakovenko wrote: do you have any plans to provide an interface for inplace updates? Yes, I will try to write a simple version of Data.Array.ST... I can try to help you, although I still dont quite grok monads. Wouldn't it be more efficient to use StorableArray, so you can cast from

Re: [Haskell-cafe] Re: hmatrix

2008-06-03 Thread Alberto Ruiz
Bulat Ziganshin wrote: Hello Alberto, Tuesday, June 3, 2008, 11:27:54 AM, you wrote: Yes, I will try to write a simple version of Data.Array.ST... That's right, the correspondence with StorableArray is direct, and efficient conversion can be easily added to the library. I mentioned the idea

[Haskell-cafe] Re: hmatrix

2008-06-02 Thread Alberto Ruiz
Anatoly Yakovenko wrote: do you have any plans to provide an interface for inplace updates? Yes, I will try to write a simple version of Data.Array.ST... On Sun, Jun 1, 2008 at 3:20 AM, Alberto Ruiz [EMAIL PROTECTED] wrote: Anatoly Yakovenko wrote: What is the most efficient way to update

[Haskell-cafe] Re: hmatrix

2008-06-01 Thread Alberto Ruiz
Anatoly Yakovenko wrote: What is the most efficient way to update a position in a matrix or a vector? I came up with this: updateVector :: Vector Double - Int - Double - Vector Double updateVector vec pos val = vec `add` v2 where v2 = fromList $ (replicate (pos) 0.0) ++ ((val - (vec @

Re: [Haskell-cafe] ghc 6.8.1 bug?

2007-11-16 Thread Alberto Ruiz
-haskell-users/2007- November/013454.html What is the word size on your machine? But that may well be a complete red herring. We'll stand by. Simon | -Original Message- | From: [EMAIL PROTECTED] [mailto:haskell-cafe- [EMAIL PROTECTED] On Behalf Of Alberto Ruiz | Sent

Re: [Haskell-cafe] ghc 6.8.1 bug?

2007-11-15 Thread Alberto Ruiz
Hello, I have had exactly the same problem with my bindings to GSL, BLAS and LAPACK. The foreign functions (!) randomly (but very frequently) produced NaN with ghc-6.8.1 -O. As usual, I first thought that I had a subtle bug related to the foreign pointers, but after a lot of refactoring,

Re: [Haskell-cafe] ghc 6.8.1 bug?

2007-11-15 Thread Alberto Ruiz
On Thursday 15 November 2007 19:58, SevenThunders wrote: Alberto Ruiz-2 wrote: Hello, I have had exactly the same problem with my bindings to GSL, BLAS and LAPACK. The foreign functions (!) randomly (but very frequently) produced NaN with ghc-6.8.1 -O. As usual, I first thought that I

Re: [Haskell-cafe] Problem linking with GHC 6.8.1

2007-11-06 Thread Alberto Ruiz
I have the same problem. And gmp.h is also not found when using the FFI. I must add: cc-options: -I/path/to/ghc-6.8.1/gmp On Tuesday 06 November 2007 16:07, david48 wrote: This is a program that works under ghci. GHC was installed using the tarball on hashell.org. When I try to

Re: [Haskell-cafe] Problem linking with GHC 6.8.1

2007-11-06 Thread Alberto Ruiz
If you don't use the foreign function interface I think that you only need the -L option: ghc --make -L/usr/local/lib/ghc-6.8.1/gmp -O2 -o edimail Main.hs Something similar worked for me, but this new behavior is not very reasonable. Could it be a bug? On Tuesday 06 November 2007 17:47,

Re: [Haskell-cafe] Haskell libraries for computer vision

2007-11-01 Thread Alberto Ruiz
I have included in the web page a reference to this earlier work, in which all the key ideas were already present. For example, using ordinary Haskell functions to process an infinite list containing the whole image sequence taken by the camera... We can write extremely concise and powerful

[Haskell-cafe] virtual lambda

2007-11-01 Thread Alberto Ruiz
Hi, I think that you may like the following demo of a simple computer vision application powered by Haskell: http://covector.blogspot.com/2007/10/functional-augmented-reality.html Alberto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Haskell Paralellism

2007-10-25 Thread Alberto Ruiz
Hello Dominik, I have used something like this and it worked very well: import Control.Parallel.Strategies inParallel = parMap rwhnf id [a,b] = inParallel [f x, g y] I hope it helps, Alberto On Thursday 25 October 2007 11:36, Dominik Luecke wrote: Hello, I am trying to use the code

[Haskell-cafe] ANN: new version of matrix library (GSLHaskell)

2007-10-24 Thread Alberto Ruiz
Dear Haskellers, I am happy to announce a new version of GSLHaskell, a basic library for matrix computations and other numeric algorithms based on LAPACK, BLAS and GSL. The goal is that simple problems involving singular values, linear systems, etc, can be easily solved using Haskell. The

[Haskell-cafe] GSL special functions (Re: [Haskell] math library for Haskell)

2007-07-30 Thread Alberto Ruiz
(moved to Haskell-cafe) On Wednesday 25 July 2007 12:52, Gregory Wright wrote: On Jul 25, 2007, at 6:39 AM, Chris Kuklewicz wrote: Alberto Ruiz wrote: I have included a binding to gsl_sf_gamma in the darcs repo of GSLHaskell: http://dis.um.es/~alberto/GSLHaskell/doc/GSL-Special.html#v

Re: [Haskell-cafe] Why Haskell?

2006-07-24 Thread Alberto Ruiz
The GSL has been ported to Windows: http://gnuwin32.sourceforge.net/packages/gsl.htm so I think that GSLHaskell could also be adapted to work in Windows... I will try to do it. Alberto On Monday 24 July 2006 02:56, SevenThunders wrote: Jared Updike wrote: GSL Haskell bindings:

Re: [Haskell-cafe] State Variables

2006-05-29 Thread Alberto Ruiz
On Sunday 28 May 2006 23:38, Matthew Bromberg wrote: I've been toying with the idea of using Haskell to write a medium sized simulation of a wireless network. However I have a number of concerns as I've begun to program a bit more in Haskell. The first concern is that the simulation needs

[Haskell-cafe] shared local definitions

2006-05-18 Thread Alberto Ruiz
Hi all, I have a question about optimization of shared values in local definitions. I frequently use this scheme: fun a b c d x = r where q = costly computation depending only on a, b, c, and d r = depends only on q and x g1 = fun 1 2 3 4 g2 = fun 5 4 2 7 (etc.) When I compute (using

[Haskell-cafe] Re: [Haskell] ANNOUNCE: An index-aware linear algebra library in Haskell

2006-04-16 Thread Alberto Ruiz
polymorphic function with a dummy value (actually 'undefined') of that type; then returning the function's result. Frederik On Sat, Apr 15, 2006 at 06:14:44PM +0200, Alberto Ruiz wrote: On Friday 14 April 2006 17:02, Frederik Eaton wrote: An index-aware linear algebra library in Haskell

[Haskell-cafe] Re: [Haskell] ANNOUNCE: An index-aware linear algebra library in Haskell

2006-04-15 Thread Alberto Ruiz
On Friday 14 April 2006 17:02, Frederik Eaton wrote: An index-aware linear algebra library in Haskell Excellent work! Is it possible to create a vector or matrix whose size is not known at compile time? - Due to the need to specify index types at some point, input of vectors is difficult.

Re: [Haskell-cafe] matrix computations based on the GSL

2006-03-18 Thread Alberto Ruiz
contribution or suggestion will be greatly appreciated, including code samples that should work with this kind of library, to be used as examples or tests. Best regards, Alberto On Friday 17 March 2006 13:30, Alberto Ruiz wrote: On Thursday 16 March 2006 18:13, Frederik Eaton wrote: Also, in my

Re: [Haskell-cafe] matrix computations based on the GSL

2006-03-17 Thread Alberto Ruiz
On Thursday 16 March 2006 18:13, Frederik Eaton wrote: Also, in my experiments (with matrix inversion) it seems, subjectively, that Octave is about 5 or so times faster for operations on large matrices. Presumably you've tested this as well, do you have any comparison results? Frederik, you

Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-19 Thread Alberto Ruiz
Hello Bulat, thanks a lot for your message, the RULES pragma is just what we need! However, in some initial experiments I have observed some strange behavior. For instance, in the following program: -- {-# OPTIONS_GHC -fglasgow-exts #-} apply :: (Int

Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-13 Thread Alberto Ruiz
Hello! I have a few doubts concerning the LinearAlgebra library... On Friday 08 July 2005 11:29, Henning Thielemann wrote: I would remove the 'matrix' portions of the function names, since this information is already contained in the module name. E.g. after importing LinearAlgebra.Matrix as

Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-08 Thread Alberto Ruiz
The server is working again. On Thursday 07 July 2005 20:58, Alberto Ruiz wrote: I' sorry, our web server is temporarily down :-( http://dis.um.es/~alberto/hmatrix/matrix.html ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-07 Thread Alberto Ruiz
Hello! Thank you very much for all your suggestions. A new version of the library can be found at: http://dis.um.es/~alberto/hmatrix/matrix.html Here are the main changes: - Vector and Matrix are now different types with different functions operating on them. They cannot be interchanged and

Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-07 Thread Alberto Ruiz
I' sorry, our web server is temporarily down :-( On Thursday 07 July 2005 20:37, Alberto Ruiz wrote: Hello! Thank you very much for all your suggestions. A new version of the library can be found at: http://dis.um.es/~alberto/hmatrix/matrix.html

[Haskell-cafe] matrix computations based on the GSL

2005-06-29 Thread Alberto Ruiz
Hello all! This is my first message to the list. In my work I often need linear algebra algorithms and other numeric computations. An option is using scientific computing systems like Matlab, Mathematica, Maple, etc. In Haskell there are several modules and bindings to matrix libraries; many

Re: [Haskell-cafe] matrix computations based on the GSL

2005-06-29 Thread Alberto Ruiz
Henning: I was wrong, the different names are synonymes for the same type. :-( I agree that we must statically distinguish Vector and Matrix (see below). Some notes: I would not call it a matrix library but a linear algebra library. Then setup modules like LinearAlgebra.Matrix,