Script started on Fri Mar 17 06:59:05 2000 [crutan@brainiac Project]$ g++ testmatrix.C [crutan@brainiac Project]$ a.out Matrix 1 = 2 1.7 3.5 -2 1.6 1.7 3 -3.9 4 1.8 -3 -3.9 4 2.5 1 -1 2.8 1.5 -1 1.2 1.8 1.8 6 1.2 0.5 mat2 = 2.8 + mat::Matrix 2 = 4.8 4.5 6.3 0.8 4.4 4.5 5.8 -1.1 6.8 4.6 -0.2 -1.1 6.8 5.3 3.8 1.8 5.6 4.3 1.8 4 4.6 4.6 8.8 4 3.3 mat3 = mat2 + mat1::Matrix 3 = 6.8 6.2 9.8 -1.2 6 6.2 8.8 -5 10.8 6.4 -3.2 -5 10.8 7.8 4.8 0.8 8.4 5.8 0.8 5.2 6.4 6.4 14.8 5.2 3.8 mat4 = transpose(mat3)::Matrix 4 = 6.8 6.2 -3.2 0.8 6.4 6.2 8.8 -5 8.4 6.4 9.8 -5 10.8 5.8 14.8 -1.2 10.8 7.8 0.8 5.2 6 6.4 4.8 5.2 3.8 mat5 = mat4*mat3+2.6::Matrix 5 = 93.36 164.92 -47.76 75.48 66.92 78.64 275.16 -19 92.48 92.6 225.92 122.72 229.16 112.68 279.56 168.08 93.12 67.88 165.28 203.4 146.68 152.6 62.04 112.92 194.48 showing the previous matrices are unchnaged Matrix 1 = 2 1.7 3.5 -2 1.6 1.7 3 -3.9 4 1.8 -3 -3.9 4 2.5 1 -1 2.8 1.5 -1 1.2 1.8 1.8 6 1.2 0.5 mat2 -= mat5::Matrix 2 = -88.56 -160.42 54.06 -74.68 -62.52 -74.14 -269.36 17.9 -85.68 -88 -226.12 -123.82 -222.36 -107.38 -275.76 -166.28 -87.52 -63.58 -163.48 -199.4 -142.08 -148 -53.24 -108.92 -191.18 mat6 = (2.5*mat - mat3)+3.0::Matrix 6 = 1.2 1.05 14.95 -2.8 0.6 1.05 1.7 -1.75 4.6 1.1 -14.3 -1.75 2.2 3.45 -9.3 1.7 -0.8 -1.05 -0.3 0.8 1.5 1.1 13.2 0.8 0.45 Number of elements in mat 6 = 25 mat 7 = 4.0/mat::Matrix 7 = 0.73217 0.20046 -0.2613 -1.1253 0.15872 -0.60183 0.048505 -0.41068 0.89126 0.43357 -0.047454 -0.20596 0.1028 0.091062 0.46917 -0.61036 0.39092 0.17738 -0.13991 0.52687 1.5651 0.63709 0.75981 0.085564 -1.0268 mat *= mat7::Matrix 1 = 4 0 0 0 0 0 4 0 0 0 0 0 4 0 0 0 0 0 4 0 0 0 0 0 4 We want to solve the following set of equations: 2x + 4y + z = -4.75 -3x + 2y + 4z = -7.50 x - 2y + 2z = 6.00 We define linmat = 2 4 1 -3 2 4 1 -2 2 And we define linvec = -4.75 -7.5 6 Then the soltion vector is : 1.5 -2 0.25 [crutan@brainiac Project]$ exit Script done on Fri Mar 17 06:59:19 2000