Re: [Lapackpp-devel] Lapackpp scaled matrix addition
Status: Beta
Brought to you by:
cstim
From: Christian S. <sti...@tu...> - 2007-05-15 19:27:23
|
Am Montag, 14. Mai 2007 16:59 schrieb Matti Varjokallio: > > >Am I correct in saying that currently the possibilities to compute a > > >scaled matrix sum in lapack++ are: > > >1) Do a basic double-loop > > >2) Blas_Mat_Mat_Mult with the second argument as identity matrix > > >3) Blas_Scale for the second argument and use +-operator which is > > >marked deprecated > > > > > > It seems that there is a Blas_Add_Mult -function only for vectors, but > > > not for matrices? Is there some specific reason for this or could a > > > wrapper for dgema be added? > > > > Oh, there exists dgema that does this? In that case it would be nice to > > have a wrapper for this, indeed. If you're up to submitting a patch, I'd > > happily include it into lapackpp; otherwise I might be able to do this > > maybe in June. > > Sorry it turned out that I was browsing through some Compaq-specific > extensions and thought it was plain LAPACK-interface. Also ESSL gives > dgeadd for this purpose, but there seems to be no such function in LAPACK. Ah, ok. Yes, that's what I knew as well. Even though I needed this at times, there wasn't any function available except for Blas_Mat_Mat_Mult with an identity matrix. > Would it make sense to use daxpy (scaled vector addition) to make > something like Blas_Add_Mult(LaGenMatDouble&, double, const > &LaGenMatDouble)? I'm not so sure. We're talking about an element-wise sum of matrices? In that case daxpy does not make sense because it always calculates the (scaled) inner product of two vectors, if I recall correctly. I'm open for patches that implement this function "by hand" in lapackpp. However I've regularly been surprised by the speed of the existing LAPACK function. In cases like this I'd like to hear (with some convincing numbers) that a hand-written function is indeed faster than Blas_Mat_Mat_Mult with "weird" input arguments (identity etc.). Profiling numbers could be obtained by e.g. valgrind's tool callgrind or others. Regards, Christian |