From mathieu.ribatet at epfl.ch  Mon Apr 14 00:00:53 2008
From: mathieu.ribatet at epfl.ch (Mathieu Ribatet)
Date: Mon, 14 Apr 2008 00:00:53 +0200
Subject: [Rd] Matrix multiplication in a C code
In-Reply-To: <alpine.LFD.1.00.0804061350410.9702@auk.stats.ox.ac.uk>
References: <47F8C62C.7010501@epfl.ch>
	<alpine.LFD.1.00.0804061350410.9702@auk.stats.ox.ac.uk>
Message-ID: <48028295.9010408@epfl.ch>

First, sorry for the delayed reply.

You were right matprod will do exactly what I want. Thanks. On another 
point, are you aware about a BLAS routine to test for semi-definite 
positive matrix ? This is required for my loglikelihood and thus should 
return -\infty if not.

Best,
Mathieu


Prof Brian Ripley a ?crit :
> On Sun, 6 Apr 2008, Mathieu Ribatet wrote:
>
>>    Dear list members,
>>
>> I've got a small question on matrix multiplications in a C code. Because
>> of a really cpu demanding likelihood, I had to use a C code within an R
>> function wrapper. I'm pretty sure that there is already one good code
>> for matrix multiplication in C - maybe in the R source code itself - but
>> I wasn't able to find it.
>>
>> Anyone as an idea on how to handle matrix multiplications?
>
> Well, R does use fast C code where available: see matmult in 
> src/main/array.c which calls the BLAS.  It works best if you have an 
> optimized BLAS: otherwise it may not be as fast as the simple version 
> used when there are NAs present.
>

-- 
Institute of Mathematics
Ecole Polytechnique F?d?rale de Lausanne
STAT-IMA-FSB-EPFL, Station 8
CH-1015 Lausanne   Switzerland
http://stat.epfl.ch/
Tel: + 41 (0)21 693 7907



[Rd] Matrix multiplication in a C code
Mathieu Ribatet