You are here: Symbol Reference > MtxVec Namespace > Classes > TMtx Class > public > TMtx.ConditionNr Property
MtxVec VCL
ContentsIndex
PreviousUpNext
TMtx.ConditionNr Property

Stores the condition number reciprocial value after the call to LUSolve.

Pascal
property ConditionNr: double;

The property is set by the LUSolve method. It contains the calling matrix condition number reciprocial value after the call to LUSolve method and if ConditionNumber property was not cnNone. If the ConditionNr (inverse of condition number) is a very small number (thus the condition number is very large), then the calling matrix is ill-conditioned and the error in the solution will also be large. The condition number is used for analyzing the errors in the solution of a system of linear equations. 

In practice, most computations are performed with rounding errors. Besides, you often need to solve a system Ax = b where the data (the elements of A and b) are not known exactly. Therefore, it's important to understand how the data errors and rounding errors can affect the solution x. If x is the exact solution of Ax = b, and x + dx is the exact solution of a perturbed problem (A + dA)x = (b + db), then 

 

 

In other words, relative errors in A or b may be amplified in the solution vector x by a factor k(A) = ||A|| ||A -1 || called the condition number of A. The norm used to calculate the condition number is set by the ConditionNumber property. 

Rounding errors have the same effect as relative perturbations c(n)e in the original data. Here e is the machine precision, and c(n) is a modest function of the matrix order n. The corresponding solution error is ||dx||/||x|| <= c(n)k(A)e. (The value of c(n) is seldom greater than 10n), Thus, if your matrix A is ill-conditioned (that is, its condition number k(A) is very large), then the error in the solution x is also large; you may even encounter a complete loss of precision. This loss can be greatly reduced by enabling the RefineSolution property.

var X,B: TVec; A: TMtx; begin CreateIt(X,B); CreateIt(A); try B.SetIt(False,[0,2]); A.SetIt(2,2,false,[1,2, 3,4]); // 2x2, not complex matrix A.RefineSolution := True; A.ConditionNumber := cnNormInf; A.LUSolve(B,X); finally FreeIt(B,X); FreeIt(A); end; end;
Examples on GitHub
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!