solve_matrixT_solve_matrixSolveMatrixSolveMatrix (Operator)

Name

solve_matrixT_solve_matrixSolveMatrixSolveMatrix — 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)

Beschreibung

Der Operator solve_matrixsolve_matrixSolveMatrixSolveMatrixSolveMatrix berechnet die Lösung eines linearen Gleichungssystems oder eines linearen Kleinsten-Quadrate Problems. Die Eingabematrizen MatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHS und MatrixRHSMatrixRHSMatrixRHSMatrixRHSmatrixRHS sind durch die Matrix Handles MatrixLHSIDMatrixLHSIDMatrixLHSIDMatrixLHSIDmatrixLHSID und MatrixRHSIDMatrixRHSIDMatrixRHSIDMatrixRHSIDmatrixRHSID gegeben. Die Anzahl der Zeilen der Matrizen MatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHS und MatrixRHSMatrixRHSMatrixRHSMatrixRHSmatrixRHS müssen identisch sein. Der Operator gibt das Matrix Handle MatrixResultIDMatrixResultIDMatrixResultIDMatrixResultIDmatrixResultID der Matrix MatrixResultMatrixResultMatrixResultMatrixResultmatrixResult zurück. Zugriff auf die Elemente der Matrix ist z.B. mit dem Operator get_full_matrixget_full_matrixGetFullMatrixGetFullMatrixGetFullMatrix möglich.

Für lineare Gleichungssysteme werden die Gleichungen MatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHS * MatrixResultMatrixResultMatrixResultMatrixResultmatrixResult = MatrixRHSMatrixRHSMatrixRHSMatrixRHSmatrixRHS gelöst. Hierfür muss die Matrix MatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHS quadratisch und der Parameter EpsilonEpsilonEpsilonEpsilonepsilon 0 sein. Der Matrixtyp der Matrix MatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHS kann über den Parameter MatrixLHSTypeMatrixLHSTypeMatrixLHSTypeMatrixLHSTypematrixLHSType gewählt werden. Die folgenden Werte stehen zur Verfügung: 'general'"general""general""general""general" für allgemeine, 'symmetric'"symmetric""symmetric""symmetric""symmetric" für symmetrische, 'positive_definite'"positive_definite""positive_definite""positive_definite""positive_definite" für symmetrisch positiv definite und 'tridiagonal'"tridiagonal""tridiagonal""tridiagonal""tridiagonal" für tridiagonale Matrizen, '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" für permutierte obere, '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" für permutierte untere Dreiecksmatrizen.

Für ein lineares Kleinste-Quadrate Problem oder die Wahl EpsilonEpsilonEpsilonEpsilonepsilon ungleich 0 muss die Matrix MatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHS nicht quadratisch sein. Die Kleinste-Quadrate Lösung wird mittels einer Singulärwertzerlegung der Matrix MatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHS durch Minimieren von ||MatrixRHSMatrixRHSMatrixRHSMatrixRHSmatrixRHS - MatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHS * MatrixResultMatrixResultMatrixResultMatrixResultmatrixResult|| berechnet. Alle Singulärwerte, die kleiner als EpsilonEpsilonEpsilonEpsilonepsilon * 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 MatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHS in diesem Fall einen Rangdefekt aufweisen. Als Matrixtyp muss MatrixLHSTypeMatrixLHSTypeMatrixLHSTypeMatrixLHSTypematrixLHSType = 'general'"general""general""general""general" gewählt werden.

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

Achtung

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

Ausführungsinformationen

Parameter

MatrixLHSIDMatrixLHSIDMatrixLHSIDMatrixLHSIDmatrixLHSID (input_control)  matrix HMatrix, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Matrix Handle der Eingabematrix der linken Seite.

MatrixLHSTypeMatrixLHSTypeMatrixLHSTypeMatrixLHSTypematrixLHSType (input_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

Der Matrixtyp der Eingabematrix der linken Seite.

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

Werteliste: 'general'"general""general""general""general", '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_upper_triangular'"permuted_upper_triangular""permuted_upper_triangular""permuted_upper_triangular""permuted_upper_triangular", 'positive_definite'"positive_definite""positive_definite""positive_definite""positive_definite", 'symmetric'"symmetric""symmetric""symmetric""symmetric", 'tridiagonal'"tridiagonal""tridiagonal""tridiagonal""tridiagonal", 'upper_triangular'"upper_triangular""upper_triangular""upper_triangular""upper_triangular"

EpsilonEpsilonEpsilonEpsilonepsilon (input_control)  real HTupleHTupleHtuple (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

MatrixRHSIDMatrixRHSIDMatrixRHSIDMatrixRHSIDmatrixRHSID (input_control)  matrix HMatrix, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Matrix Handle der Eingabematrix der rechten Seite.

MatrixResultIDMatrixResultIDMatrixResultIDMatrixResultIDmatrixResultID (output_control)  matrix HMatrix, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Neues Matrix Handle mit der Lösung.

Ergebnis

Sind die Parameterwerte korrekt, dann liefert solve_matrixsolve_matrixSolveMatrixSolveMatrixSolveMatrix den Wert 2 (H_MSG_TRUE). Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.

Vorgänger

create_matrixcreate_matrixCreateMatrixCreateMatrixCreateMatrix

Nachfolger

get_full_matrixget_full_matrixGetFullMatrixGetFullMatrixGetFullMatrix, get_value_matrixget_value_matrixGetValueMatrixGetValueMatrixGetValueMatrix

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