From f0238cfb6997c4acfc2bd200de7295f3fa36968f Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 3 Mar 2019 21:09:10 +0100 Subject: don't index Eigen --- eigen/lapack/lu.cpp | 89 ----------------------------------------------------- 1 file changed, 89 deletions(-) delete mode 100644 eigen/lapack/lu.cpp (limited to 'eigen/lapack/lu.cpp') diff --git a/eigen/lapack/lu.cpp b/eigen/lapack/lu.cpp deleted file mode 100644 index 90cebe0..0000000 --- a/eigen/lapack/lu.cpp +++ /dev/null @@ -1,89 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2010-2011 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "common.h" -#include - -// computes an LU factorization of a general M-by-N matrix A using partial pivoting with row interchanges -EIGEN_LAPACK_FUNC(getrf,(int *m, int *n, RealScalar *pa, int *lda, int *ipiv, int *info)) -{ - *info = 0; - if(*m<0) *info = -1; - else if(*n<0) *info = -2; - else if(*lda(pa); - int nb_transpositions; - int ret = int(Eigen::internal::partial_lu_impl - ::blocked_lu(*m, *n, a, *lda, ipiv, nb_transpositions)); - - for(int i=0; i=0) - *info = ret+1; - - return 0; -} - -//GETRS solves a system of linear equations -// A * X = B or A' * X = B -// with a general N-by-N matrix A using the LU factorization computed by GETRF -EIGEN_LAPACK_FUNC(getrs,(char *trans, int *n, int *nrhs, RealScalar *pa, int *lda, int *ipiv, RealScalar *pb, int *ldb, int *info)) -{ - *info = 0; - if(OP(*trans)==INVALID) *info = -1; - else if(*n<0) *info = -2; - else if(*nrhs<0) *info = -3; - else if(*lda(pa); - Scalar* b = reinterpret_cast(pb); - MatrixType lu(a,*n,*n,*lda); - MatrixType B(b,*n,*nrhs,*ldb); - - for(int i=0; i<*n; ++i) - ipiv[i]--; - if(OP(*trans)==NOTR) - { - B = PivotsType(ipiv,*n) * B; - lu.triangularView().solveInPlace(B); - lu.triangularView().solveInPlace(B); - } - else if(OP(*trans)==TR) - { - lu.triangularView().transpose().solveInPlace(B); - lu.triangularView().transpose().solveInPlace(B); - B = PivotsType(ipiv,*n).transpose() * B; - } - else if(OP(*trans)==ADJ) - { - lu.triangularView().adjoint().solveInPlace(B); - lu.triangularView().adjoint().solveInPlace(B); - B = PivotsType(ipiv,*n).transpose() * B; - } - for(int i=0; i<*n; ++i) - ipiv[i]++; - - return 0; -} -- cgit v1.2.3