solve_matrixT_solve_matrixSolveMatrixSolveMatrixsolve_matrix (Operator)

Name

solve_matrixT_solve_matrixSolveMatrixSolveMatrixsolve_matrix — Berechnet die Lösung eines Gleichungssystems.

Signatur

solve_matrix( : : MatrixLHSID, MatrixLHSType, Epsilon, MatrixRHSID : MatrixResultID)

Herror T_solve_matrix(const Htuple MatrixLHSID, const Htuple MatrixLHSType, const Htuple Epsilon, const Htuple MatrixRHSID, Htuple* MatrixResultID)

void SolveMatrix(const HTuple& MatrixLHSID, const HTuple& MatrixLHSType, const HTuple& Epsilon, const HTuple& MatrixRHSID, HTuple* MatrixResultID)

HMatrix HMatrix::SolveMatrix(const HString& MatrixLHSType, double Epsilon, const HMatrix& MatrixRHSID) const

HMatrix HMatrix::SolveMatrix(const char* MatrixLHSType, double Epsilon, const HMatrix& MatrixRHSID) const

HMatrix HMatrix::SolveMatrix(const wchar_t* MatrixLHSType, double Epsilon, const HMatrix& MatrixRHSID) const   (Nur Windows)

static void HOperatorSet.SolveMatrix(HTuple matrixLHSID, HTuple matrixLHSType, HTuple epsilon, HTuple matrixRHSID, out HTuple matrixResultID)

HMatrix HMatrix.SolveMatrix(string matrixLHSType, double epsilon, HMatrix matrixRHSID)

def solve_matrix(matrix_lhsid: HHandle, matrix_lhstype: str, epsilon: float, matrix_rhsid: HHandle) -> HHandle

Beschreibung

Der Operator solve_matrixsolve_matrixSolveMatrixSolveMatrixSolveMatrixsolve_matrix berechnet die Lösung eines linearen Gleichungssystems oder eines linearen Kleinsten-Quadrate Problems. Die Eingabematrizen MatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHSmatrix_lhs und MatrixRHSMatrixRHSMatrixRHSMatrixRHSmatrixRHSmatrix_rhs sind durch die Matrix Handles MatrixLHSIDMatrixLHSIDMatrixLHSIDMatrixLHSIDmatrixLHSIDmatrix_lhsid und MatrixRHSIDMatrixRHSIDMatrixRHSIDMatrixRHSIDmatrixRHSIDmatrix_rhsid gegeben. Die Anzahl der Zeilen der Matrizen MatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHSmatrix_lhs und MatrixRHSMatrixRHSMatrixRHSMatrixRHSmatrixRHSmatrix_rhs müssen identisch sein. Der Operator gibt das Matrix Handle MatrixResultIDMatrixResultIDMatrixResultIDMatrixResultIDmatrixResultIDmatrix_result_id der Matrix MatrixResultMatrixResultMatrixResultMatrixResultmatrixResultmatrix_result zurück. Zugriff auf die Elemente der Matrix ist z.B. mit dem Operator get_full_matrixget_full_matrixGetFullMatrixGetFullMatrixGetFullMatrixget_full_matrix möglich.

Für lineare Gleichungssysteme werden die Gleichungen MatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHSmatrix_lhs * MatrixResultMatrixResultMatrixResultMatrixResultmatrixResultmatrix_result = MatrixRHSMatrixRHSMatrixRHSMatrixRHSmatrixRHSmatrix_rhs gelöst. Hierfür muss die Matrix MatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHSmatrix_lhs quadratisch und der Parameter EpsilonEpsilonEpsilonEpsilonepsilonepsilon 0 sein. Der Matrixtyp der Matrix MatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHSmatrix_lhs kann über den Parameter MatrixLHSTypeMatrixLHSTypeMatrixLHSTypeMatrixLHSTypematrixLHSTypematrix_lhstype gewählt werden. Die folgenden Werte stehen zur Verfügung: 'general'"general""general""general""general""general" für allgemeine, 'symmetric'"symmetric""symmetric""symmetric""symmetric""symmetric" für symmetrische, 'positive_definite'"positive_definite""positive_definite""positive_definite""positive_definite""positive_definite" für symmetrisch positiv definite und 'tridiagonal'"tridiagonal""tridiagonal""tridiagonal""tridiagonal""tridiagonal" für tridiagonale Matrizen, 'upper_triangular'"upper_triangular""upper_triangular""upper_triangular""upper_triangular""upper_triangular" für obere, 'permuted_upper_triangular'"permuted_upper_triangular""permuted_upper_triangular""permuted_upper_triangular""permuted_upper_triangular""permuted_upper_triangular" für permutierte obere, 'lower_triangular'"lower_triangular""lower_triangular""lower_triangular""lower_triangular""lower_triangular" für untere und 'permuted_lower_triangular'"permuted_lower_triangular""permuted_lower_triangular""permuted_lower_triangular""permuted_lower_triangular""permuted_lower_triangular" für permutierte untere Dreiecksmatrizen.

Für ein lineares Kleinste-Quadrate Problem oder die Wahl EpsilonEpsilonEpsilonEpsilonepsilonepsilon ungleich 0 muss die Matrix MatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHSmatrix_lhs nicht quadratisch sein. Die Kleinste-Quadrate Lösung wird mittels einer Singulärwertzerlegung der Matrix MatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHSmatrix_lhs durch Minimieren von ||MatrixRHSMatrixRHSMatrixRHSMatrixRHSmatrixRHSmatrix_rhs - MatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHSmatrix_lhs * MatrixResultMatrixResultMatrixResultMatrixResultmatrixResultmatrix_result|| berechnet. Alle Singulärwerte, die kleiner als EpsilonEpsilonEpsilonEpsilonepsilonepsilon * dem größten Singulärwert sind, werden 0 gesetzt. Für diese Werte wird keine interne Division vorgenommen um einer Division durch 0 vorzubeugen. Ebenfalls darf die Matrix MatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHSmatrix_lhs in diesem Fall einen Rangdefekt aufweisen. Als Matrixtyp muss MatrixLHSTypeMatrixLHSTypeMatrixLHSTypeMatrixLHSTypematrixLHSTypematrix_lhstype = 'general'"general""general""general""general""general" gewählt werden.

Bemerkung: Die relative Genauigkeit der Gleitkommarepräsentation des genutzten Datentyps (double) ist EpsilonEpsilonEpsilonEpsilonepsilonepsilon = 2.2204e-16.

Achtung

Wird MatrixLHSTypeMatrixLHSTypeMatrixLHSTypeMatrixLHSTypematrixLHSTypematrix_lhstype = 'symmetric'"symmetric""symmetric""symmetric""symmetric""symmetric", 'positive_definite'"positive_definite""positive_definite""positive_definite""positive_definite""positive_definite" oder 'upper_triangular'"upper_triangular""upper_triangular""upper_triangular""upper_triangular""upper_triangular" gewählt, so muss der obere Dreiecksteil der Eingabematrix MatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHSmatrix_lhs die relevante Information der Matrix beinhalten. Der exakt untere Teil der Matrix wird nicht verwendet. Wird MatrixLHSTypeMatrixLHSTypeMatrixLHSTypeMatrixLHSTypematrixLHSTypematrix_lhstype = 'lower_triangular'"lower_triangular""lower_triangular""lower_triangular""lower_triangular""lower_triangular" gewählt, so muss der untere Dreiecksteil der Eingabematrix MatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHSmatrix_lhs die relevante Information der Matrix beinhalten. Der exakt obere Teil der Matrix wird nicht verwendet. Wird MatrixLHSTypeMatrixLHSTypeMatrixLHSTypeMatrixLHSTypematrixLHSTypematrix_lhstype = 'tridiagonal'"tridiagonal""tridiagonal""tridiagonal""tridiagonal""tridiagonal" gesetzt, wird nur die Hauptdiagonale und die beiden Nebendiagonalen der Eingabematrix MatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHSmatrix_lhs genutzt. Die anderen Teile der Matrix werden nicht verwendet. Wenn der verwendete Teil der Eingabematrix MatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHSmatrix_lhs nicht vom spezifizierten Typ ist, wird eine Fehlerbehandlung durchgeführt.

Ausführungsinformationen

Parameter

MatrixLHSIDMatrixLHSIDMatrixLHSIDMatrixLHSIDmatrixLHSIDmatrix_lhsid (input_control)  matrix HMatrix, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Matrix Handle der Eingabematrix der linken Seite.

MatrixLHSTypeMatrixLHSTypeMatrixLHSTypeMatrixLHSTypematrixLHSTypematrix_lhstype (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Der Matrixtyp der Eingabematrix der linken Seite.

Defaultwert: 'general' "general" "general" "general" "general" "general"

Werteliste: 'general'"general""general""general""general""general", 'lower_triangular'"lower_triangular""lower_triangular""lower_triangular""lower_triangular""lower_triangular", 'permuted_lower_triangular'"permuted_lower_triangular""permuted_lower_triangular""permuted_lower_triangular""permuted_lower_triangular""permuted_lower_triangular", 'permuted_upper_triangular'"permuted_upper_triangular""permuted_upper_triangular""permuted_upper_triangular""permuted_upper_triangular""permuted_upper_triangular", 'positive_definite'"positive_definite""positive_definite""positive_definite""positive_definite""positive_definite", 'symmetric'"symmetric""symmetric""symmetric""symmetric""symmetric", 'tridiagonal'"tridiagonal""tridiagonal""tridiagonal""tridiagonal""tridiagonal", 'upper_triangular'"upper_triangular""upper_triangular""upper_triangular""upper_triangular""upper_triangular"

EpsilonEpsilonEpsilonEpsilonepsilonepsilon (input_control)  real HTuplefloatHTupleHtuple (real) (double) (double) (double)

Lösungstyp und Grenze zum Setzen der Singulärwerte zu 0.

Defaultwert: 0.0

Wertevorschläge: 0.0, 2.2204e-16

MatrixRHSIDMatrixRHSIDMatrixRHSIDMatrixRHSIDmatrixRHSIDmatrix_rhsid (input_control)  matrix HMatrix, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Matrix Handle der Eingabematrix der rechten Seite.

MatrixResultIDMatrixResultIDMatrixResultIDMatrixResultIDmatrixResultIDmatrix_result_id (output_control)  matrix HMatrix, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Neues Matrix Handle mit der Lösung.

Ergebnis

Sind die Parameterwerte korrekt, dann liefert solve_matrixsolve_matrixSolveMatrixSolveMatrixSolveMatrixsolve_matrix den Wert TRUE. Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.

Vorgänger

create_matrixcreate_matrixCreateMatrixCreateMatrixCreateMatrixcreate_matrix

Nachfolger

get_full_matrixget_full_matrixGetFullMatrixGetFullMatrixGetFullMatrixget_full_matrix, get_value_matrixget_value_matrixGetValueMatrixGetValueMatrixGetValueMatrixget_value_matrix

Literatur

David Poole: „Linear Algebra: A Modern Introduction“; Thomson; Belmont; 2006.
Gene H. Golub, Charles F. van Loan: „Matrix Computations“; The Johns Hopkins University Press; Baltimore and London; 1996.

Modul

Foundation