Algosim documentation: ConditionNumber

ConditionNumber

Returns the condition number of a square and invertible matrix.

Syntax

Description

ConditionNumber(A, p) returns the condition number of A using the norm indicated by p:

p Norm
1 Maximum column sum norm
2 Spectral norm
∞︎ Maximum row sum norm

If omitted, p defaults to 2.

Examples

A ≔ RandomMatrix(5)
⎛ 0.0803360473365   0.0929777680431    0.278928309213    0.642947343877    0.987157364376⎞
⎜  0.342697718414    0.612430824433    0.269153424306     0.58255372569     0.99600150832⎟
⎜ 0.0330206281506  0.00476140133105    0.735411840491    0.692000418203    0.959642794449⎟
⎜  0.811440004734    0.338792154565   0.0695806613658    0.204648311716    0.590543785831⎟
⎝  0.847465471365    0.892586489441    0.787209609989    0.187690754188      0.9883011356⎠
'(1, 2, ∞) @ (p ↦ ConditionNumber(A, p))
76.6344026486
34.1408783308
68.5393865112