Ticket #1372: MathTest.mo

File MathTest.mo, 454 bytes (added by Peter Aronsson, 14 years ago)
Line 
1model Test_Math_Matrices_norm
2 parameter Real A[:,:]=[1,10,1000;0.01,0,10;0.005,0.01,10];
3 Real x1;
4 Real x2;
5 Real x3;
6 Real x4;
7equation
8 x1=Modelica.Math.Matrices.norm(A, 1) "Should return 1020";
9 x2=Modelica.Math.Matrices.norm(A, 2) "Should return 1000.15";
10 x3=Modelica.Math.Matrices.norm(A, Modelica.Constants.inf) "Should return 1011";
11 x4=Modelica.Math.Matrices.norm(A) "Should return 1000.15";
12end Test_Math_Matrices_norm;