I am finding it difficult to learn about C libraries-LAPACK MEPL EIGEN. Please help me find good references.

11 comentarios

Walter Roberson
Walter Roberson el 25 de Dic. de 2017
Editada: Walter Roberson el 26 de Dic. de 2017
MEPL -- do you mean Mentor Embedded Performance Library ?
Could you be more specific about what you want to know? The entire source code for LAPACK is available
ANAGHA GOURI
ANAGHA GOURI el 26 de Dic. de 2017
Yes, MEPL- Mentor Enhanced Performance Library . I am not familiar with these libraries
Walter Roberson
Walter Roberson el 26 de Dic. de 2017
MEPL appears to be proprietary. I had not heard of it.
https://www.mentor.com/embedded-software/hpc-libraries
It would help if you asked more specific questions instead of just saying that you are not familiar with the libraries.
ANAGHA GOURI
ANAGHA GOURI el 29 de Dic. de 2017
Is there a LAPACK or CBLAS function that can be used to normalise an m by n matrix ? A=abs(B/max(B)); %B is m by n matrix
Also, Is there a LAPACK or CBLAS function that can be used to find log10 of an m by n matrix ? A = 10*log10(B);
ANAGHA GOURI
ANAGHA GOURI el 15 de En. de 2018
Editada: ANAGHA GOURI el 15 de En. de 2018
>> b=[4,1,5;2,3,1]
b =
4 1 5
2 3 1
>> max(b)
ans =
4 3 5
>> b/max(b)
ans =
0.8800
0.4400
Since max(b) is a row vector containing the maximum value of each column, can't b/max(b(:)) be calculated using functions like dgesv() ?? [A=bx form, where x=Ab-1].I read that dgesv() deals with mxm matrix as A, but in my case it is an mxn matrix. Please help
Jan
Jan el 15 de En. de 2018
A normalization sounds more like you need the elementwise division:
b ./ max(b)
Note that the matrix division is performed by a LAPACK routine internally already. So I do not see a need to call it explicitly.
Walter Roberson
Walter Roberson el 15 de En. de 2018
" Problems that LAPACK can Solve
LAPACK can solve systems of linear equations, linear least squares problems, eigenvalue problems and singular value problems. LAPACK can also handle many associated computations such as matrix factorizations or estimating condition numbers. "
Those are not the types of problems you are attempting to solve.
Walter Roberson
Walter Roberson el 15 de En. de 2018
"Is there a LAPACK or CBLAS function that can be used to normalise an m by n matrix ? A=abs(B/max(B)); %B is m by n matrix"
Not directly. You can calculate 1/max(B) and you can build a vector of zeros the same size as the number of elements in B, and then you can call daxpy with 1/max(B) as the "alpha" parameter, B(:) as the x parameter, and the vector of zeros as the "y" parameter; dapxy would calculate alpha*x+y which would then be (1/max(B)) * B(:) + 0; you would reshape the result back to size(B). It is far from clear that this would be any more efficient than calculating 1/max(B) and doing all of the multiplications yourself.
You are using PowerPC, which does not have any SIMD (Single Instruction Multiple Data) vector instructions for double precision other than type conversion to single, or swapping words. See http://moss.csc.ncsu.edu/~mueller/cluster/ps3/SDK3.0/docs/arch/vector_simd_pem_v_2.07c_26Oct2006_cell.pdf. So basically you cannot do better than an unrolled loop written in C using the obvious operations. You probably do not need to worry about cache-line problems as long as you proceed through sequential memory addresses.
"Also, Is there a LAPACK or CBLAS function that can be used to find log10 of an m by n matrix ? A = 10*log10(B);"
No. They do not do log.
Walter Roberson
Walter Roberson el 15 de En. de 2018
"Since max(b) is a row vector containing the maximum value of each column, can't b/max(b(:)) be calculated using functions like dgesv()"
Are you normalizing each column independently ?
But in any case, No, there are no LAPACK or BLAS calls for scalar multiplication or division on a per-column basis.
ANAGHA GOURI
ANAGHA GOURI el 16 de En. de 2018
In daxpy(),isn't parameter DA specify the scalar alpha. But 1/max(B) is a vector. So how will it calculate alpha*x+y with 1/max(B) as the "alpha" parameter, B(:) as the x parameter, and the vector of zeros as the "y" parameter?
Walter Roberson
Walter Roberson el 16 de En. de 2018
I did not notice at the time of the original post that you were not asking for the maximum over the entire matrix. I later updated with "there are no LAPACK or BLAS calls for scalar multiplication or division on a per-column basis."

Iniciar sesión para comentar.

 Respuesta aceptada

Jan
Jan el 29 de Dic. de 2017
Is there a LAPACK or CBLAS function that can be used to normalise
an m by n matrix ?
A=abs(B/max(B)); %B is m by n matrix
No, there is no LABACK or CBLAS function for this. Do you mean
A = abs(B / max(B(:))) % The (:) is essential
% Or
A = abs(B ./ max(B)) % The ./ is essential
Is there a LAPACK or CBLAS function that can be used to
find log10 of an m by n matrix?
A = 10*log10(B);
No, there is no LAPACK or BLAS function for this. The shown code is efficient already.

8 comentarios

ANAGHA GOURI
ANAGHA GOURI el 29 de Dic. de 2017
Thank you
Walter Roberson
Walter Roberson el 29 de Dic. de 2017
LAPACK and BLAS are for linear algebra, but log10 is nonlinear. Once the log10 is taken, the multiplication by 10 would be a linear operation though. MATLAB will automatically use LAPACK or equivalent for the multiplication if it decides the matrices are large enough to make the overhead worth while.
ANAGHA GOURI
ANAGHA GOURI el 31 de Dic. de 2017
Thanks for the explaination.
I downloaded LAPACK library and gfortran in ubuntu but when I tried to compile my code it shows lapack not found. What are the commands to be written in the terminal so that the problem is rectified. I have seen sites with the same problem, but couldn't understand the way of using Makefile . Is there an alternative??
gcc -o a example_DGELS_colmajor.c -llapack -lrefblas -tmglib -lm -lgfortran
Walter Roberson
Walter Roberson el 31 de Dic. de 2017
Is there a particular reason you are going to that trouble? MATLAB calls upon the libraries at need. You can also call upon the routines directly if you need to; https://www.mathworks.com/matlabcentral/fileexchange/16777-lapack
ANAGHA GOURI
ANAGHA GOURI el 1 de En. de 2018
I need to find the performance comparison of these libraries on a power PC.
Walter Roberson
Walter Roberson el 1 de En. de 2018
If you are trying to do this with MATLAB on a PowerPC then you would have to be using OS-X 10.5 or earlier with MATLAB R2007b or earlier, as MATLAB was only supported on PowerPC for Mac and only to R2007b. If that is what you are doing then you need to detail exactly which compiler you are using and which library versions you are using.
If you are trying to do this with a current PowerPC device then it is not a MATLAB question and is not appropriate for this forum.
ANAGHA GOURI
ANAGHA GOURI el 10 de En. de 2018
I used dgemm() for matrix matrix multiplication. Is there a LAPACK or CBLAS function to perform element by element multiplication??
Walter Roberson
Walter Roberson el 10 de En. de 2018
I do not see any routines for element by element multiplication. http://www.icl.utk.edu/~mgates3/docs/lapack.html

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Linear Algebra en Centro de ayuda y File Exchange.

Preguntada:

el 25 de Dic. de 2017

Comentada:

el 16 de En. de 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by