a C interface to LAPACK, a FORTRAN software library for linear algebra
Questions tagged [lapacke]
84 questions
17
votes
2 answers
difference between lapacke and lapack
I wonder what is the difference between LAPACKE and LAPACK. I want to do Eigen analysis with QZ decomposition, but I'm not sure if I should start with LAPACKE or LAPACK. I appreciate any help.

Megidd
- 7,089
- 6
- 65
- 142
7
votes
1 answer
LAPACK/LAPACKE with C++ on LINUX --- Compiling, Linking and Running?
Intro:
I've developed an application in C++ that utilizes LAPACK(LAPACKE) and MPI, all on Windows. Works OK in Windows (compiling and linking are taken care of through Code::Blocks IDE), but the execution is way too slow. Hence, I want to migrate…

Boki
- 193
- 1
- 3
- 15
6
votes
3 answers
understanding Lapack_row_major and Lapack_col_major with lda
I have three questions regarding lapack_row_major and lapack_col_major:
1) Is my understanding correct that if A = [1,2,3,4,5,6] with dimensions 2*3 then the lapack_row_major results in [ [1,2,3],[4,5,6] ], while lapack_col_major results in […

Mina
- 113
- 1
- 6
6
votes
1 answer
errors using lapack C header in C++ with visual studio 2010
Please help me! It takes me hours to look up in the internet and I haven't found a solution....
I am trying to use the call lapack function from C++ functions but I failed at the very beginning. Here is my code:
#include "stdafx.h"
#include…

Jason
- 1,200
- 1
- 10
- 25
5
votes
2 answers
What is the use of the WORK parameters in LAPACK routines?
I am computing an eigenvalue decomposition of a symmetric matrix with scipy.linalg.cython_lapack.syev. From the doc I found, I need to pass an array called WORK:
WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
On exit, if INFO…

P. Camilleri
- 12,664
- 7
- 41
- 76
4
votes
2 answers
Differing Results Of Eigenvector Routines In C Versus Python
So I noticed that I get different answers for the eigendecomposition of the 4x4 matrix of all 1s.
In Python using numpy.linalg.eig:
matrix = numpy.ones((M,M), dtype=float);
values, vectors = numpy.linalg.eig(matrix);
Python Result:
V1: [-0.866025…

The Dude
- 661
- 2
- 11
- 20
3
votes
0 answers
LAPACKE or MAGMA GPU - inversion of matrix with Cholesky factorization - functions magma_dpotrf_gpu and magma_dpotri_gpu
I have a first version of a function that inverses a matrix of size m and using
magma_dgetrf_gpu and magma_dgetri_gpulike this :
// Inversion
magma_dgetrf_gpu( m, m, d_a, m, piv, &info);
magma_dgetri_gpu( m, d_a, m, piv, dwork, ldwork,…
user1773603
3
votes
1 answer
How to use OpenBlas Lapacke together with Rcpp
I have some running c++ code using the Lapacke version that comes with OpenBlas. I would like to include this code into an R package and transfer data between that function and R using the Rcpp package. But somehow the two seem not to like each…

Alex
- 4,925
- 2
- 32
- 48
3
votes
2 answers
Using OpenBLAS LAPACKE in Visual Studio
i need some linear algebra in my project and want use OpenBLAS for this. I downloaded the precompiled version (64bit version) and unpacked it to my projectfolder. In Visual Studio, i added include-, bin-, and lib-folder to my Project and ran the…

Thorsten Schmitz
- 542
- 7
- 19
3
votes
1 answer
LAPACK zgemm op(A) dimension
In this link from netlib it specifies M as:
On entry, M specifies the number of rows of the matrix
op( A ) and of the matrix C. M must be at least zero.
Unchanged on exit.
So if I want to use a 3x10 matrix as…

Alireza
- 410
- 3
- 17
3
votes
1 answer
FindBLAS and FindLAPACK usage in CMake
I am a bit confused by the utility of
find_package(BLAS) and find_package( LAPACK) within CMake.
It seems that depending on the vendor found, different source code is necessary. For example, mkl has
mkl.h and/or mkl_lapacke.h
but at least one…

rhl
- 103
- 1
- 9
3
votes
1 answer
How to allocate the memory for b in LAPACK sgelsd routine
According to the official user guide line, sgelsd is used to solve the least square problem
min_x || b - Ax ||_2
and allows matrix A to be rectangle and rank-deficient. And according to the interface description in the sgelsd source code, b is used…

coinsyx
- 643
- 2
- 7
- 13
2
votes
0 answers
Compute generalized eigenvalue problem with CLapack in C
I'm going to show you an example how to compute generalized eigenvalue problem in C with CLapack.
Here I have two matrices.
#define row 5
#define column 5
float A[row * column] = { 9.5605, 6.8163, - 1.9425, - 5.7558, 3.5550,
0.8163, …

euraad
- 2,467
- 5
- 30
- 51
2
votes
0 answers
Compiling LAPACKe library using C in MacOS
I need to use LAPACKe functions in a code that should run on Linux and macOS, but the problem is under OsX. I have a MacBook Pro 2021, with an M1 Pro processor, running an OsX 12.6.2
I wrote an example code
#include
#include…

Or1on
- 21
- 2
2
votes
0 answers
LAPACKE_dsyevd returns wrong eigenvectors
I am very far from being a great programmer and I am trying to use LAPACKE_dsyevd. I wrote the following code which aims to find out the eigenvalues and eigenvectors of a 2x2 symmetric matrix whose diagonal is made of 0 and non diagonal elements are…

Philippe Michelon
- 21
- 1