📄 lulinsolver.java
字号:
package org.jutil.math.matrix;/** * <p>A class of objects that solve linear systems of equations represented * as a matrix using the LU decomposition of that matrix.</p> * * @path $Source: /cvsroot/org-jutil/jutil.org/src/org/jutil/math/matrix/LULinSolver.java,v $ * @version $Revision: 1.4 $ * @date $Date: 2002/07/02 14:27:31 $ * @state $State: Exp $ * @author Marko van Dooren * @release $Name: $ */public class LULinSolver extends AbstractSolver implements LinSolver { /* The revision of this class */ public final static String CVS_REVISION ="$Revision: 1.4 $"; /** * Initialize a new LULinSolver with the given LUDecomposer. * * @param decomposer * The LUDecomposer to be used by this LULinSolver. */ /*@ @ public behavior @ @ pre decomposer != null; @ @ post getDecomposer() == decomposer; @*/ public LULinSolver(LUDecomposer decomposer) { _decomposer = decomposer; } /** * Return the LUDecomposer of this LULinSolver. */ public LUDecomposer getDecomposer() { return _decomposer; } /** * see superclass */ public Column solve(Matrix A, Column b) { // P*A = L*U // A*x = b // P*A*x = P*b // L*U*x = P*b // L*(U*x) = P*b // L*(y) = P*b // U*x = y LUDecomposition lu = getDecomposer().decompose(A); Column Pb = lu.P().times(b).getColumn(1); Column y = forwardSubstitute(lu.L(),Pb); return backSubstitute(lu.U(), y); } /** * The QRDecomposer used by this QRLinSolver. */ /*@ @ private invariant _decomposer != null; @*/ private LUDecomposer _decomposer;}/*<copyright>Copyright (C) 1997-2002. This software is copyrighted by the people and entities mentioned after the "@author" tags above, on behalf of the JUTIL.ORG Project. The copyright is dated by the dates after the "@date" tags above. All rights reserved.This software is published under the terms of the JUTIL.ORG SoftwareLicense version 1.1 or later, a copy of which has been included withthis distribution in the LICENSE file, which can also be found athttp://www.jutil.org/LICENSE. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the JUTIL.ORG Software License for more details.For more information, please see http://jutil.org/</copyright>*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -