11/*
22 * This file contains code adapted from the ORCA quantum chemistry program.
3- * ORCA is developed by the group of Prof. Frank Neese at the Max-Planck-Institut für Kohlenforschung,
4- * Mülheim an der Ruhr and FAccTs GmbH. ORCA is licensed by the Max-Planck-Institut für Kohlenforschung and FAccTs GmbH.
3+ * ORCA is developed by the group of Prof. Frank Neese at the
4+ * Max-Planck-Institut für Kohlenforschung, Mülheim an der Ruhr and FAccTs GmbH.
5+ * ORCA is licensed by the Max-Planck-Institut für Kohlenforschung and FAccTs
6+ * GmbH.
57 *
6- * The inclusion of ORCA code in this file has been done with the explicit permission
7- * of the ORCA developers.
8+ * The inclusion of ORCA code in this file has been done with the explicit
9+ * permission of the ORCA developers.
810 *
9- * For reuse or licensing of this code, please contact the ORCA team at the Max-Planck-Institut
10- * für Kohlenforschung (https://orcaforum.kofo.mpg.de/) or FAccTs GmbH (https://www.faccts.de/).
11+ * For reuse or licensing of this code, please contact the ORCA team at the
12+ * Max-Planck-Institut für Kohlenforschung (https://orcaforum.kofo.mpg.de/) or
13+ * FAccTs GmbH (https://www.faccts.de/).
1114 */
1215#pragma once
1316
@@ -35,8 +38,8 @@ inline int BLAS_Add_Mat_x_Vec(
3538 bool Transpose,
3639 double alpha
3740) {
38- if (Transpose) {
39- if (A.cols == C.N && A.rows == V.N ) {
41+ if (Transpose) {
42+ if (A.cols == C.N && A.rows == V.N ) {
4043 cblas_dgemv (
4144 CblasRowMajor,
4245 CblasTrans,
@@ -54,7 +57,7 @@ inline int BLAS_Add_Mat_x_Vec(
5457 return EXIT_SUCCESS;
5558 };
5659 } else {
57- if (A.rows == C.N && A.cols == V.N ) {
60+ if (A.rows == C.N && A.cols == V.N ) {
5861 cblas_dgemv (
5962 CblasRowMajor,
6063 CblasNoTrans,
@@ -98,7 +101,7 @@ inline int BLAS_Add_Mat_x_Mat(
98101 // check for size 0 matrices
99102 if (A.cols == 0 || A.rows == 0 || B.cols == 0 || B.rows == 0 || C.cols == 0 ||
100103 C.rows == 0 ) {
101- exit (EXIT_FAILURE);
104+ exit (EXIT_FAILURE);
102105 };
103106
104107 // check for transpositions
@@ -221,9 +224,9 @@ inline int BLAS_InvertMatrix(TMatrix<double> &a) {
221224 (lapack_int)a.cols ,
222225 ipiv
223226 );
224- if (info != 0 ) {
227+ if (info != 0 ) {
225228 delete[] ipiv;
226- return EXIT_FAILURE;
229+ return EXIT_FAILURE;
227230 }
228231
229232 // Inverse of an LU-factored general matrix
@@ -240,19 +243,19 @@ inline int BLAS_InvertMatrix(TMatrix<double> &a) {
240243/* *
241244 * @brief Solve a symmetric linear system A * X = B for X.
242245 *
243- * This routine factorizes a symmetric matrix A using Bunch-Kaufman factorization
244- * and solves for the right-hand side vector B. The matrix A is overwritten
245- * by its factorization. The solution overwrites B.
246+ * This routine factorizes a symmetric matrix A using Bunch-Kaufman
247+ * factorization and solves for the right-hand side vector B. The matrix A is
248+ * overwritten by its factorization. The solution overwrites B.
246249 *
247250 * @param A Symmetric matrix of size (m x m). Overwritten by the factorization.
248251 * @param B Right-hand side vector of size m. Overwritten by the solution.
249252 * @return int Returns EXIT_SUCCESS (0) on success, EXIT_FAILURE (1) on error.
250253 */
251254inline int BLAS_SolveSymmetric (
252- TMatrix<double > &A, // symmetric matrix
253- TVector<double > &B // RHS vector (becomes solution)
255+ TMatrix<double > &A, // symmetric matrix
256+ TVector<double > &B // RHS vector (becomes solution)
254257) {
255- const lapack_int m = A.rows ;
258+ const lapack_int m = A.rows ;
256259 const lapack_int nrhs = 1 ;
257260
258261 if (A.cols != m || B.N != m) {
@@ -272,7 +275,8 @@ inline int BLAS_SolveSymmetric(
272275 }
273276
274277 // Solve for all RHS columns
275- info = LAPACKE_dsytrs (LAPACK_ROW_MAJOR, ' L' , m, nrhs, A.p , m, ipiv, B.p , nrhs);
278+ info =
279+ LAPACKE_dsytrs (LAPACK_ROW_MAJOR, ' L' , m, nrhs, A.p , m, ipiv, B.p , nrhs);
276280 delete[] ipiv;
277281
278282 if (info != 0 ) {
0 commit comments