Apply clang-format to lapack/blas directories

This commit is contained in:
Antonio Sanchez
2024-02-09 10:32:56 -08:00
committed by Antonio Sánchez
parent 4eac211e96
commit 186f8205db
24 changed files with 5720 additions and 6027 deletions

View File

@@ -11,59 +11,62 @@
#include <Eigen/Cholesky>
// POTRF computes the Cholesky factorization of a real symmetric positive definite matrix A.
EIGEN_LAPACK_FUNC(potrf,(char* uplo, int *n, RealScalar *pa, int *lda, int *info))
{
EIGEN_LAPACK_FUNC(potrf, (char *uplo, int *n, RealScalar *pa, int *lda, int *info)) {
*info = 0;
if(UPLO(*uplo)==INVALID) *info = -1;
else if(*n<0) *info = -2;
else if(*lda<std::max(1,*n)) *info = -4;
if(*info!=0)
{
if (UPLO(*uplo) == INVALID)
*info = -1;
else if (*n < 0)
*info = -2;
else if (*lda < std::max(1, *n))
*info = -4;
if (*info != 0) {
int e = -*info;
return xerbla_(SCALAR_SUFFIX_UP"POTRF", &e, 6);
return xerbla_(SCALAR_SUFFIX_UP "POTRF", &e, 6);
}
Scalar* a = reinterpret_cast<Scalar*>(pa);
MatrixType A(a,*n,*n,*lda);
Scalar *a = reinterpret_cast<Scalar *>(pa);
MatrixType A(a, *n, *n, *lda);
int ret;
if(UPLO(*uplo)==UP) ret = int(internal::llt_inplace<Scalar, Upper>::blocked(A));
else ret = int(internal::llt_inplace<Scalar, Lower>::blocked(A));
if (UPLO(*uplo) == UP)
ret = int(internal::llt_inplace<Scalar, Upper>::blocked(A));
else
ret = int(internal::llt_inplace<Scalar, Lower>::blocked(A));
if (ret >= 0) *info = ret + 1;
if(ret>=0)
*info = ret+1;
return 0;
}
// POTRS solves a system of linear equations A*X = B with a symmetric
// positive definite matrix A using the Cholesky factorization
// A = U**T*U or A = L*L**T computed by DPOTRF.
EIGEN_LAPACK_FUNC(potrs,(char* uplo, int *n, int *nrhs, RealScalar *pa, int *lda, RealScalar *pb, int *ldb, int *info))
{
EIGEN_LAPACK_FUNC(potrs,
(char *uplo, int *n, int *nrhs, RealScalar *pa, int *lda, RealScalar *pb, int *ldb, int *info)) {
*info = 0;
if(UPLO(*uplo)==INVALID) *info = -1;
else if(*n<0) *info = -2;
else if(*nrhs<0) *info = -3;
else if(*lda<std::max(1,*n)) *info = -5;
else if(*ldb<std::max(1,*n)) *info = -7;
if(*info!=0)
{
if (UPLO(*uplo) == INVALID)
*info = -1;
else if (*n < 0)
*info = -2;
else if (*nrhs < 0)
*info = -3;
else if (*lda < std::max(1, *n))
*info = -5;
else if (*ldb < std::max(1, *n))
*info = -7;
if (*info != 0) {
int e = -*info;
return xerbla_(SCALAR_SUFFIX_UP"POTRS", &e, 6);
return xerbla_(SCALAR_SUFFIX_UP "POTRS", &e, 6);
}
Scalar* a = reinterpret_cast<Scalar*>(pa);
Scalar* b = reinterpret_cast<Scalar*>(pb);
MatrixType A(a,*n,*n,*lda);
MatrixType B(b,*n,*nrhs,*ldb);
Scalar *a = reinterpret_cast<Scalar *>(pa);
Scalar *b = reinterpret_cast<Scalar *>(pb);
MatrixType A(a, *n, *n, *lda);
MatrixType B(b, *n, *nrhs, *ldb);
if(UPLO(*uplo)==UP)
{
if (UPLO(*uplo) == UP) {
A.triangularView<Upper>().adjoint().solveInPlace(B);
A.triangularView<Upper>().solveInPlace(B);
}
else
{
} else {
A.triangularView<Lower>().solveInPlace(B);
A.triangularView<Lower>().adjoint().solveInPlace(B);
}