Re: [R] "best" c++ matrix library?

From: Martin Maechler <maechler_at_stat.math.ethz.ch>
Date: Thu 01 Sep 2005 - 21:30:12 EST

>>>>> "Romain" == Romain Francois <francoisromain@free.fr> >>>>> on Thu, 01 Sep 2005 11:19:59 +0200 writes:

    Romain> Le 01.09.2005 10:32, Ott Toomet a écrit :
>> Thanks for everyone who replied to my question.
>>
>> I tried newmat myself, seems to be working well. What I
>> am interested in is something like
>>
>> * Fast element-wise operations. You know, it may be slow
>> in R.
>>
>> * (Some) control over memory allocation. I would like to
>> specify when the matrix should not be copied.
>>
>> * Compatibility with R. At least the way how the matrix
>> data is represented in memory should be the same as R
>> has. Otherwise, the data interchange may become slow and
>> memory-consuming.
>>
>> * And, of course, the basic matrix operations like
>> multiplication, inverting, eigenvalues etc....
>>
>> I am using linux/gcc if that matters.
>>
>> Best, Ott | From: "Tuszynski, Jaroslaw W."
>> <JAROSLAW.W.TUSZYNSKI@saic.com> | Date: Wed, 31 Aug 2005
>> 12:59:04 -0400
>> |
>> | What kind of matrix operations do you need?
>> |
>> | Jarek
>> |
>> | -----Original Message----- | From:
>> r-help-bounces@stat.math.ethz.ch |
>> [mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of
>> Ott Toomet | Sent: Wednesday, August 31, 2005 12:54 PM |
>> To: r-help@stat.math.ethz.ch | Subject: [R] "best" c++
>> matrix library?
>> |
>> | Hi folks,
>> |
>> | I am planning to write some more time-consuming matrix
>> manipulations in c++. | What is the experience with the
>> existing c++ matrix libraries? Do you have | some
>> recommendations? Are some libraries more compatible with
>> R than the | others?
>> |
>> | All suggestions welcome!
>> |
>> | Best, | Ott
>>
>>
    Romain> Hello,

    Romain> CPPLAPACK : <http://cpplapack.sourceforge.net/> is a
    Romain> c++ wrapper for lapack routines.  It is not so
    Romain> complicated to use once you have blas and lapack
    Romain> installed.  I think it is much faster than newmat.

LAPACK is ``state of the art'' of numerical algebra. Don't use anything else if you don't have to.

It's definitely *much* more ``compatible with R'' since we base almost all our matrix computations on LAPACK. GNU octave and commercial Matlab are also entirely based on LAPACK for the matrix computations.

I have no idea about the "CPP" (= c++) part in CPPLAPACK though.

The CRAN package 'Matrix' has several objectives, notably *sparse* matrix computations. But it also uses LAPACK for dense matric computations, AFAIR also for a few things not available (via LAPACK) in "core R".

Martin Maechler, ETH Zurich



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Sep 01 21:34:57 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 16:10:22 EST