KlassenKlassenKlassenKlassen | | | | Operatoren

solve_matrixsolve_matrixSolveMatrixsolve_matrixSolveMatrixSolveMatrix (Operator)

Name

solve_matrixsolve_matrixSolveMatrixsolve_matrixSolveMatrixSolveMatrix — Berechnet die Lösung eines Gleichungssystems.

Signatur

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

Herror solve_matrix(const Hlong MatrixLHSID, const char* MatrixLHSType, double Epsilon, const Hlong MatrixRHSID, Hlong* MatrixResultID)

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

Herror solve_matrix(const HTuple& MatrixLHSID, const HTuple& MatrixLHSType, const HTuple& Epsilon, const HTuple& MatrixRHSID, Hlong* MatrixResultID)

HMatrix HMatrix::SolveMatrix(const HTuple& MatrixLHSType, const HTuple& Epsilon, const HMatrix& MatrixRHSID) const

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

void HOperatorSetX.SolveMatrix(
[in] VARIANT MatrixLHSID, [in] VARIANT MatrixLHSType, [in] VARIANT Epsilon, [in] VARIANT MatrixRHSID, [out] VARIANT* MatrixResultID)

IHMatrixX* HMatrixX.SolveMatrix(
[in] BSTR MatrixLHSType, [in] double Epsilon, [in] IHMatrixX* MatrixRHSID)

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_matrixSolveMatrixsolve_matrixSolveMatrixSolveMatrix berechnet die Lösung eines linearen Gleichungssystems oder eines linearen Kleinsten-Quadrate Problems. Die Eingabematrizen MatrixLHSMatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHS und MatrixRHSMatrixRHSMatrixRHSMatrixRHSMatrixRHSmatrixRHS sind durch die Matrix Handles MatrixLHSIDMatrixLHSIDMatrixLHSIDMatrixLHSIDMatrixLHSIDmatrixLHSID und MatrixRHSIDMatrixRHSIDMatrixRHSIDMatrixRHSIDMatrixRHSIDmatrixRHSID gegeben. Die Anzahl der Zeilen der Matrizen MatrixLHSMatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHS und MatrixRHSMatrixRHSMatrixRHSMatrixRHSMatrixRHSmatrixRHS müssen identisch sein. Der Operator gibt das Matrix Handle MatrixResultIDMatrixResultIDMatrixResultIDMatrixResultIDMatrixResultIDmatrixResultID der Matrix MatrixResultMatrixResultMatrixResultMatrixResultMatrixResultmatrixResult zurück. Zugriff auf die Elemente der Matrix ist z.B. mit dem Operator get_full_matrixget_full_matrixGetFullMatrixget_full_matrixGetFullMatrixGetFullMatrix möglich.

Für lineare Gleichungssysteme werden die Gleichungen

  MatrixLHSMatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHS * MatrixResultMatrixResultMatrixResultMatrixResultMatrixResultmatrixResult = MatrixRHSMatrixRHSMatrixRHSMatrixRHSMatrixRHSmatrixRHS
gelöst. Hierfür muss die Matrix MatrixLHSMatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHS quadratisch und der Parameter EpsilonEpsilonEpsilonEpsilonEpsilonepsilon 0 sein. Der Matrixtyp der Matrix MatrixLHSMatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHS kann über den Parameter MatrixLHSTypeMatrixLHSTypeMatrixLHSTypeMatrixLHSTypeMatrixLHSTypematrixLHSType 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 MatrixLHSMatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHS nicht quadratisch sein. Die Kleinste-Quadrate Lösung wird mittels einer Singulärwertzerlegung der Matrix MatrixLHSMatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHS durch Minimieren von

  ||MatrixRHSMatrixRHSMatrixRHSMatrixRHSMatrixRHSmatrixRHS - MatrixLHSMatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHS * MatrixResultMatrixResultMatrixResultMatrixResultMatrixResultmatrixResult||
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 MatrixLHSMatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHS in diesem Fall einen Rangdefekt aufweisen. Als Matrixtyp muss MatrixLHSTypeMatrixLHSTypeMatrixLHSTypeMatrixLHSTypeMatrixLHSTypematrixLHSType = '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 MatrixLHSTypeMatrixLHSTypeMatrixLHSTypeMatrixLHSTypeMatrixLHSTypematrixLHSType = '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 MatrixLHSMatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHS die relevante Information der Matrix beinhalten. Der exakt untere Teil der Matrix wird nicht verwendet. Wird MatrixLHSTypeMatrixLHSTypeMatrixLHSTypeMatrixLHSTypeMatrixLHSTypematrixLHSType = 'lower_triangular'"lower_triangular""lower_triangular""lower_triangular""lower_triangular""lower_triangular" gewählt, so muss der untere Dreiecksteil der Eingabematrix MatrixLHSMatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHS die relevante Information der Matrix beinhalten. Der exakt obere Teil der Matrix wird nicht verwendet. Wird MatrixLHSTypeMatrixLHSTypeMatrixLHSTypeMatrixLHSTypeMatrixLHSTypematrixLHSType = 'tridiagonal'"tridiagonal""tridiagonal""tridiagonal""tridiagonal""tridiagonal" gesetzt, wird nur die Hauptdiagonale und die beiden Nebendiagonalen der Eingabematrix MatrixLHSMatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHS genutzt. Die anderen Teile der Matrix werden nicht verwendet. Wenn der verwendete Teil der Eingabematrix MatrixLHSMatrixLHSMatrixLHSMatrixLHSMatrixLHSmatrixLHS nicht vom spezifizierten Typ ist, wird eine Fehlerbehandlung durchgeführt.

Parallelisierung

Parameter

MatrixLHSIDMatrixLHSIDMatrixLHSIDMatrixLHSIDMatrixLHSIDmatrixLHSID (input_control)  matrix HMatrix, HTupleHTupleHMatrix, HTupleHMatrixX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Matrix Handle der Eingabematrix der linken Seite.

MatrixLHSTypeMatrixLHSTypeMatrixLHSTypeMatrixLHSTypeMatrixLHSTypematrixLHSType (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (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 HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

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

Defaultwert: 0.0

Wertevorschläge: 0.0, 2.2204e-16

MatrixRHSIDMatrixRHSIDMatrixRHSIDMatrixRHSIDMatrixRHSIDmatrixRHSID (input_control)  matrix HMatrix, HTupleHTupleHMatrix, HTupleHMatrixX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Matrix Handle der Eingabematrix der rechten Seite.

MatrixResultIDMatrixResultIDMatrixResultIDMatrixResultIDMatrixResultIDmatrixResultID (output_control)  matrix HMatrix, HTupleHTupleHMatrix, HTupleHMatrixX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Neues Matrix Handle mit der Lösung.

Ergebnis

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

Vorgänger

create_matrixcreate_matrixCreateMatrixcreate_matrixCreateMatrixCreateMatrix

Nachfolger

get_full_matrixget_full_matrixGetFullMatrixget_full_matrixGetFullMatrixGetFullMatrix, get_value_matrixget_value_matrixGetValueMatrixget_value_matrixGetValueMatrixGetValueMatrix

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


KlassenKlassenKlassenKlassen | | | | Operatoren