📄 laslv.h
字号:
// -*-C++-*- // Copyright (C) 2004 // Christian Stimming <stimming@tuhh.de>// This library is free software; you can redistribute it and/or// modify it under the terms of the GNU Lesser General Public License as// published by the Free Software Foundation; either version 2, or (at// your option) any later version.// This library is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the// GNU Lesser General Public License for more details.// You should have received a copy of the GNU Lesser General Public License along// with this library; see the file COPYING. If not, write to the Free// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,// USA.// LAPACK++ (V. 1.1)// (C) 1992-1996 All Rights Reserved./** @file * @brief Functions for solving linear equations */#ifndef _LASLV_H#define _LASLV_H#include "lafnames.h"#include LA_GEN_MAT_DOUBLE_H#include LA_VECTOR_DOUBLE_H#ifdef LA_COMPLEX_SUPPORT# include LA_GEN_MAT_COMPLEX_H# include LA_VECTOR_COMPLEX_H#endif#include LA_VECTOR_LONG_INT_H/** @name Real-valued matrices *///@{ /** Compute the solution to a real system of linear equations A*X=B * * Depending on the dimensions of A, either a LU or a QR decomposition * is used. * * @note This function was broken with non-square matrices and QR * decomposition for a long time. It is fixed and verified only * since lapackpp-2.4.11. */DLLIMPORTvoid LaLinearSolve( const LaGenMatDouble& A, LaGenMatDouble& X, const LaGenMatDouble& B );/** Compute the solution to a real system of linear equations A*X=B * in-place. * * Depending on the dimensions of A, either a LU or a QR decomposition * is used. * * In-place means: The contents of A are overwritten during the * calculation. B is not overwritten but always copied during this * operation. * * @note This function was broken with non-square matrices and QR * decomposition for a long time. It is fixed and verified only * since lapackpp-2.4.11. */DLLIMPORTvoid LaLinearSolveIP( LaGenMatDouble& A, LaGenMatDouble& X, const LaGenMatDouble& B );/** Compute the solution to a real system of linear equations A*X=B by * using the LU decomposition. This only works for a squares matrix A. */DLLIMPORTvoid LaLULinearSolve( const LaGenMatDouble& A, LaGenMatDouble& X, const LaGenMatDouble& B );/** Compute the solution to a real system of linear equations A*X=B by * using the LU decomposition in-place. This only works for a squares * matrix A. * * In-place means: The contents of A are overwritten during the * calculation. B is not overwritten but always copied during this * operation. */DLLIMPORTvoid LaLULinearSolveIP( LaGenMatDouble& A, LaGenMatDouble& X, const LaGenMatDouble& B );/** Compute the solution to a real system of linear equations A*X=B by * using QR decomposition, which works for any rectangular matrix A. * * @note This function was broken for a long time. It is fixed and * verified only since lapackpp-2.4.11. */DLLIMPORTvoid LaQRLinearSolve( const LaGenMatDouble& A, LaGenMatDouble& X, const LaGenMatDouble& B );/** Compute the solution to a real system of linear equations A*X=B by * using the QR decomposition in-place. This works for any rectangular * matrix A. * * In-place means: The contents of A are overwritten during the * calculation. B is not overwritten but always copied during this * operation. * * @note This function was broken for a long time. It is fixed and * verified only since lapackpp-2.4.11. */DLLIMPORTvoid LaQRLinearSolveIP( LaGenMatDouble& A, LaGenMatDouble& X, const LaGenMatDouble& B );/** @brief Compute the LU factorization * * Compute the LU factorization (in-place) of a general M-by-N * matrix A. * * More info: See man @c dgetrf. * * In-place means: The contents of GM are overwritten during the * calculation. * * @param GM Matrix to be factorized in-place. * * @param PIV Vector to return the pivoting indices. This vector * *has* to be at least as long as min(M,N). */DLLIMPORTvoid LUFactorizeIP(LaGenMatDouble &GM, LaVectorLongInt &PIV);//@}#ifdef LA_COMPLEX_SUPPORT/** @name Complex-valued matrices *///@{ /** Compute the solution to a complex-valued system of linear * equations A*X=B * * Depending on the dimensions of A, either a LU or a QR decomposition * is used. * * @note This function was broken with non-square matrices and QR * decomposition for a long time. It is fixed and verified only * since lapackpp-2.4.11. */DLLIMPORTvoid LaLinearSolve( const LaGenMatComplex& A, LaGenMatComplex& X, const LaGenMatComplex& B );/** Compute the solution to a complex-valued system of linear * equations A*X=B in-place. * * Depending on the dimensions of A, either a LU or a QR decomposition * is used. * * In-place means: The contents of A are overwritten during the * calculation. B is not overwritten but always copied during this * operation. * * @note This function was broken with non-square matrices and QR * decomposition for a long time. It is fixed and verified only * since lapackpp-2.4.11. */DLLIMPORTvoid LaLinearSolveIP( LaGenMatComplex& A, LaGenMatComplex& X, const LaGenMatComplex& B );/** Compute the solution to a complex-valued system of linear * equations A*X=B by using the LU decomposition. This only works for * a squares matrix A. */DLLIMPORTvoid LaLULinearSolve( const LaGenMatComplex& A, LaGenMatComplex& X, const LaGenMatComplex& B );/** Compute the solution to a complex-valued system of linear * equations A*X=B by using the LU decomposition in-place. This only * works for a squares matrix A. * * In-place means: The contents of A are overwritten during the * calculation. B is not overwritten but always copied during this * operation. */DLLIMPORTvoid LaLULinearSolveIP( LaGenMatComplex& A, LaGenMatComplex& X, const LaGenMatComplex& B );/** Compute the solution to a complex-valued system of linear * equations A*X=B by using QR decomposition, which works for any * rectangular matrix A. * * @note This function was broken for a long time. It is fixed and * verified only since lapackpp-2.4.11. */DLLIMPORTvoid LaQRLinearSolve( const LaGenMatComplex& A, LaGenMatComplex& X, const LaGenMatComplex& B );/** Compute the solution to a complex-valued system of linear * equations A*X=B by using the QR decomposition in-place. This works * for any rectangular matrix A. * * In-place means: The contents of A are overwritten during the * calculation. B is not overwritten but always copied during this * operation. * * @note This function was broken for a long time. It is fixed and * verified only since lapackpp-2.4.11. */DLLIMPORTvoid LaQRLinearSolveIP( LaGenMatComplex& A, LaGenMatComplex& X, const LaGenMatComplex& B );/** @brief Compute the LU factorization * * Compute the LU factorization (in-place) of a general M-by-N * matrix A. * * In-place means: The contents of GM are overwritten during the * calculation. * * More info: See man @c zgetrf. * * @param GM Matrix to be factorized in-place. * @param PIV Vector to return the pivoting indices. * This vector *has* to be at least as long as min(M,N). */DLLIMPORTvoid LUFactorizeIP(LaGenMatComplex &GM, LaVectorLongInt &PIV);//@}/** @brief Compute the inverse of a matrix from LU factorization
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -