27 August 2016 09:48:22 AM LINPACK_C_PRB C++ version Test the LINPACK_C library. TEST01 For a complex Hermitian positive definite matrix, CCHDC computes the Cholesky decomposition. The number of equations is N = 3 The matrix: (2.5281,0) (2.1341,-0.2147) (2.4187,0.2932) (2.1341,0.2147) (3.0371,0) (2.0905,1.1505) (2.4187,-0.2932) (2.0905,-1.1505) (2.7638,0) Decompose the matrix. The Cholesky factor U: (1.59,0) (1.3422,-0.135031) (1.52119,0.184403) (0,0) (1.10334,0) (0.0667523,0.632248) (0,0) (0,0) (0.107555,0) The product U^H * U: (2.5281,0) (2.1341,-0.2147) (2.4187,0.2932) (2.1341,0.2147) (3.0371,0) (2.0905,1.1505) (2.4187,-0.2932) (2.0905,-1.1505) (2.7638,0) TEST02 For a complex Hermitian positive definite matrix, CCHEX can shift columns in a Cholesky factorization. The number of equations is N = 3 The matrix: (2.5281,0) (2.1341,-0.2147) (2.4187,0.2932) (2.1341,0.2147) (3.0371,0) (2.0905,1.1505) (2.4187,-0.2932) (2.0905,-1.1505) (2.7638,0) The vector Z: (1,0) (2,0) (3,0) Decompose the matrix. The Cholesky factor U: (1.59,0) (1.3422,-0.135031) (1.52119,0.184403) (0,0) (1.10334,0) (0.0667523,0.632248) (0,0) (0,0) (0.107555,0) Right circular shift columns K = 1 through L = 3 Left circular shift columns K = 2 through L = 3 The shifted Cholesky factor U: (1.65039,0.200063) (1.33161,-0.535689) (1.46554,0) (0,0) (0.849984,-0.504457) (-0.135667,-0.59052) (0,0) (0,0) (-0.105082,-0.046296) The shifted vector Z: (1.28565,-0.722065) (1.47222,-0.393939) (3.08193,0.0693803) The shifted product U' * U: (2.7638,0) (2.0905,-1.1505) (2.4187,-0.2932) (2.0905,1.1505) (3.0371,0) (2.1341,0.2147) (2.4187,0.2932) (2.1341,-0.2147) (2.5281,0) TEST03 For a complex Hermitian matrix CCHUD updates a Cholesky decomposition. CTRSL solves a triangular linear system. In this example, we use CCHUD to solve a least squares problem R * b = z. The number of equations is P = 20 Solution vector # 1 (Should be (1,1) (2,0), (3,1) (4,0) ...) 1 (1.00001,0.999999) 2 (2.00001,-1.34442e-07) 3 (3,0.999997) 4 (4,-1.19079e-05) 5 (5.00001,0.999996) ...... .............. 16 (16,5.48219e-06) 17 (17,1) 18 (18,1.91262e-06) 19 (19,1.00001) 20 (20,1.93623e-06) TEST04 For a complex general band storage matrix: CGBCO factors the matrix and estimates the reciprocal condition number. The matrix order is N = 3 The lower band is ML = 1 The upper band is MU = 1 The matrix: (0.44986,-0.126667) (0.589627,0.26009) (0,0) (-0.843197,-0.34428) (0.39114,0.3234) (-0.236066,0.0774594) (0,0) (-0.139466,-0.156136) (0.0185991,-0.633214) Estimated reciprocal condition RCOND = 0.321778 TEST05 For a complex general band storage matrix: CGBFA factors the matrix; CGBSL solves a factored linear system. The matrix order is N = 3 The lower band is ML = 1 The upper band is MU = 1 The matrix: (0.44986,-0.126667) (0.589627,0.26009) (0,0) (-0.843197,-0.34428) (0.39114,0.3234) (-0.236066,0.0774594) (0,0) (-0.139466,-0.156136) (0.0185991,-0.633214) The right hand side: (-0.126158,0.196128) (-1.28988,-0.181063) (0.219757,-0.212515) Computed Exact Solution Solution (0.89285,0.0103136) (0.89285,0.0103136) (-0.560465,0.763795) (-0.560465,0.763795) (0.306357,0.0262752) (0.306357,0.0262752) TEST06 For a complex general band storage matrix: CGBFA factors the matrix. CGBDI computes the determinant. The matrix order is N = 3 The lower band is ML = 1 The upper band is MU = 1 The matrix: (0.44986,-0.126667) (0.589627,0.26009) (0,0) (-0.843197,-0.34428) (0.39114,0.3234) (-0.236066,0.0774594) (0,0) (-0.139466,-0.156136) (0.0185991,-0.633214) Determinant = (3.16224,-3.91854) * 10^ (-1,0) TEST07 For a complex general storage matrix: CGECO factors the matrix and estimates the reciprocal condition number. The matrix order is N = 3 The matrix: (0.44986,-0.126667) (0.39114,0.3234) (0.0185991,-0.633214) (-0.843197,-0.34428) (-0.139466,-0.156136) (0.89285,0.0103136) (0.589627,0.26009) (-0.236066,0.0774594) (-0.560465,0.763795) Estimated reciprocal condition RCOND = 0.0122937 TEST08 For a complex general storage matrix: CGEFA factors the matrix. CGESL solves a linear system. The matrix order is N = 3 The matrix: (0.44986,-0.126667) (0.39114,0.3234) (0.0185991,-0.633214) (-0.843197,-0.34428) (-0.139466,-0.156136) (0.89285,0.0103136) (0.589627,0.26009) (-0.236066,0.0774594) (-0.560465,0.763795) The right hand side: (0.606261,-0.391702) (-0.128146,-0.0786515) (-0.093079,0.57649) Computed Exact Solution Solution (0.306357,0.0262757) (0.306357,0.0262752) (0.500803,-0.779931) (0.500804,-0.779931) (0.350471,0.0165555) (0.350471,0.0165551) TEST09 For a complex general storage matrix: CGEFA factors the matrix. CGEDI computes the determinant or inverse. The matrix order is N = 3 The matrix: (0.44986,-0.126667) (0.39114,0.3234) (0.0185991,-0.633214) (-0.843197,-0.34428) (-0.139466,-0.156136) (0.89285,0.0103136) (0.589627,0.26009) (-0.236066,0.0774594) (-0.560465,0.763795) Determinant = (-3.63075,-5.58236) * 10^ (-2,0) The product inv(A) * A is (1,4.76837e-07) (-3.57628e-07,0) (-2.38419e-07,-4.76837e-07) (-1.19209e-06,-9.53674e-07) (1,0) (0,-9.53674e-07) (7.15256e-07,2.38419e-07) (0,-1.49012e-07) (1,4.76837e-07) TEST10 For a complex tridiagonal matrix: CGTSL solves a linear system. Matrix order N = 10 Computed Exact Solution Solution (0.999999,10) (1,10) (2,20) (2,20) (3,30) (3,30) (4,40) (4,40) (5,50) (5,50) (6,60) (6,60) (7.00001,70) (7,70) (8.00001,80) (8,80) (9.00001,90) (9,90) (10,100) (10,100) TEST11 For a complex Hermitian matrix: CHICO factors the matrix and estimates the reciprocal condition number. The matrix order is N = 3 The matrix: (0.218418,0) (0.468469,-0.858402) (-0.64583,0.380263) (0.468469,0.858402) (0.0661187,0) (0.39114,0.3234) (-0.64583,-0.380263) (0.39114,-0.3234) (0.043829,0) Estimated reciprocal condition RCOND = 0.235919 TEST12 For a complex Hermitian matrix: CHIFA factors the matrix. CHISL solves a linear system. The matrix order is N = 3 The matrix: (0.218418,0) (0.468469,-0.858402) (-0.64583,0.380263) (0.468469,0.858402) (0.0661187,0) (0.39114,0.3234) (-0.64583,-0.380263) (0.39114,-0.3234) (0.043829,0) The right hand side: (0.391451,1.34986) (0.418849,0.556888) (-0.437792,-0.182306) Computed Exact Solution Solution (0.737082,0.301125) (0.737082,0.301125) (-0.545643,0.389631) (-0.545643,0.389631) (0.254327,-0.830657) (0.254327,-0.830657) TEST13 For a complex hermitian matrix: CHIFA factors the matrix. CHIDI computes the determinant, inverse, or inertia. The matrix order is N = 3 The matrix: (0.218418,0) (0.468469,-0.858402) (-0.64583,0.380263) (0.468469,0.858402) (0.0661187,0) (0.39114,0.3234) (-0.64583,-0.380263) (0.39114,-0.3234) (0.043829,0) Determinant = -8.70062 * 10^ -1 The inertia: 2 1 0 The product inv(A) * A is (1,-2.98023e-08) (0,2.98023e-08) (-1.30385e-08,2.79397e-09) (0,0) (1,-1.49012e-08) (1.49012e-08,3.72529e-09) (0,0) (0,-5.96046e-08) (1,4.47035e-08) TEST14 For a complex Hermitian matrix using packed storage, CHPCO factors the matrix and estimates the reciprocal condition number. The matrix order is N = 3 The matrix: (0.218418,0) (0.468469,-0.858402) (0.589627,0.26009) (0.468469,0.858402) (0.561695,0) (0.39114,0.3234) (0.589627,-0.26009) (0.39114,-0.3234) (0.043829,0) Estimated reciprocal condition RCOND = 0.0340064 TEST15 For a complex Hermitian matrix, using packed storage, CHPFA factors the matrix. CHPSL solves a linear system. The matrix order is N = 3 The matrix: (0.218418,0) (0.468469,-0.858402) (0.589627,0.26009) (0.468469,0.858402) (0.561695,0) (0.39114,0.3234) (0.589627,-0.26009) (0.39114,-0.3234) (0.043829,0) The right hand side: (0.605839,0.293053) (0.148441,0.749981) (0.436654,0.278298) Computed Exact Solution Solution (0.737082,0.301125) (0.737082,0.301125) (-0.545643,0.389631) (-0.545643,0.389631) (0.254326,-0.830657) (0.254327,-0.830657) TEST16 For a complex hermitian matrix, using packed storage, CHPFA factors the matrix. CHPDI computes the determinant, inverse, or inertia. The matrix order is N = 3 The matrix: (0.218418,0) (0.468469,-0.858402) (0.589627,0.26009) (0.468469,0.858402) (0.561695,0) (0.39114,0.3234) (0.589627,-0.26009) (0.39114,-0.3234) (0.043829,0) Determinant = 1.21535 * 10^ -1 The inertia: 1 2 0 The product inv(A) * A is (1,0) (-2.08616e-07,1.19209e-07) (-7.07805e-08,-5.21541e-08) (1.19209e-07,0) (1,-1.19209e-07) (4.28408e-08,7.45058e-08) (4.76837e-07,-2.38419e-07) (2.38419e-07,4.76837e-07) (1,1.19209e-07) TEST17 For a complex positive definite hermitian band matrix, CPBCO estimates the reciprocal condition number. The matrix size is N = 3 Estimate the condition. Reciprocal condition = 0.153588 TEST18 For a complex positive definite hermitian band matrix, CPBDI computes the determinant as det = MANTISSA * 10^EXPONENT Determinant = 6.0957 * 10^ 1 TEST19 For a complex positive definite hermitian band matrix, CPBFA computes the LU factors. CPBSL solves a factored linear system. The matrix size is N = 3 Factor the matrix. Solve the linear system. The solution: (Should be roughly (1,2,3)): (1,-1.40053e-08) (2,0) (3,-7.12162e-08) TEST20 For a complex Hermitian positive definite matrix, CPOCO estimates the reciprocal condition number. The matrix size is N = 3 Estimate the condition. Reciprocal condition = 0.000601908 TEST21 For a complex Hermitian positive definite matrix, CPOFA computes the LU factors, CPODI computes the inverse or determinant. The matrix size is N = 3 Factor the matrix. Get the determinant and inverse. Determinant = 3.5602 * 10^ -2 First row of inverse: (75.841,0) (-14.1735,-44.2781) (-74.0824,31.3458) TEST22 For a complex Hermitian positive definite matrix, CPOFA computes the LU factors. CPOSL solves a factored linear system. The matrix size is N = 3 Factor the matrix. Solve the linear system. The solution: (Should be (1+2i),(3+4i),(5+6i): (1.00014,1.99994) (3.00001,4.0001) (4.99984,6) TEST23 For a complex Hermitian positive definite packed matrix, CPPCO estimates the reciprocal condition number. The matrix size is N = 3 Estimate the condition number. Reciprocal condition number = 0.000601908 TEST24 For a complex Hermitian positive definite packed matrix, CPPFA factors the matrix. CPPDI computes the inverse or determinant. The matrix size is N = 3 Factor the matrix. Get the determinant and inverse. Determinant = 3.5602 * 10^ -2 Inverse: (75.841,-0) (-14.1735,-44.2781) (-74.0824,31.3458) (-14.1735,44.2781) (29.5232,-0) (-5.22993,-49.5355) (-74.0824,-31.3458) (-5.22993,49.5355) (86.4448,-0) TEST25 For a complex Hermitian positive definite packed matrix, CPPFA factors the matrix. CPPSL solves a factored linear system. The matrix size is N = 3 Factor the matrix. Solve the linear system. The solution: (Should be (1+2i),(3+4i),(5+6i): (1.00012,2.00029) (2.99981,4.00002) (5,5.99967) TEST26 For a complex Hermitian positive definite tridiagonal matrix, CPTSL factors and solves a linear system. The matrix size is N = 3 Factor the matrix and solve the system. The solution: (Should be roughly (1,2,3)): (1,3.94898e-08) (2,-8.43695e-08) (3,5.0048e-08) CQRDC_TEST CQRDC computes the QR decomposition of a rectangular matrix, but does not return Q and R explicitly. Show how Q and R can be recovered using CQRSL. The matrix A is (0.44986,-0.126667) (0.39114,0.3234) (0.0185991,-0.633214) (-0.843197,-0.34428) (-0.139466,-0.156136) (0.89285,0.0103136) (0.589627,0.26009) (-0.236066,0.0774594) (-0.560465,0.763795) Decompose the matrix. The packed matrix A which describes Q and R: (-1.16437,0.327852) (-0.235472,-0.264983) (0.499111,-0.666416) (-0.593833,-0.462886) (0.105287,-0.4758) (-1.17033,0.14294) (0.410919,0.339078) (-0.378092,0.667708) (-0.0980391,0.0561287) The QRAUX vector, containing some additional information defining Q: (1.38636,7.45058e-09) (1.64126,0) (0,0) The R factor: (-1.16437,0.327852) (-0.235472,-0.264983) (0.499111,-0.666416) (0,0) (0.105287,-0.4758) (-1.17033,0.14294) (0,0) (0,0) (-0.0980391,0.0561287) The Q factor: (-0.386356,7.45058e-09) (-0.30976,0.699406) (0.270091,0.43893) (0.593833,0.462886) (-0.275053,-0.196159) (0.408954,0.389517) (-0.410919,-0.339078) (0.115216,-0.536164) (0.61396,0.196159) The product Q * R: (0.44986,-0.126667) (0.39114,0.3234) (0.0185992,-0.633214) (-0.843197,-0.34428) (-0.139466,-0.156136) (0.89285,0.0103136) (0.589627,0.26009) (-0.236066,0.0774594) (-0.560465,0.763795) TEST28 For a complex symmetric matrix: CSICO factors the matrix and estimates the reciprocal condition number. The matrix order is N = 3 The matrix: (0.44986,-0.126667) (-0.843197,-0.34428) (0.589627,0.26009) (-0.843197,-0.34428) (0.39114,0.3234) (-0.139466,-0.156136) (0.589627,0.26009) (-0.139466,-0.156136) (-0.236066,0.0774594) Estimated reciprocal condition RCOND = 0.0475323 TEST29 For a complex symmetric matrix: CSIFA factors the matrix. CSISL solves a linear system. The matrix order is N = 3 The matrix: (0.44986,-0.126667) (-0.843197,-0.34428) (0.589627,0.26009) (-0.843197,-0.34428) (0.39114,0.3234) (-0.139466,-0.156136) (0.589627,0.26009) (-0.139466,-0.156136) (-0.236066,0.0774594) The right hand side: (-1.35026,-0.298717) (0.309629,0.801288) (0.125892,-0.733086) Computed Exact Solution Solution (0.0185993,-0.633214) (0.0185991,-0.633214) (0.89285,0.0103135) (0.89285,0.0103136) (-0.560465,0.763795) (-0.560465,0.763795) TEST30 For a complex symmetric matrix: CSIFA factors the matrix. CSIDI computes the determinant or inverse. The matrix order is N = 3 The matrix: (0.44986,-0.126667) (-0.843197,-0.34428) (0.589627,0.26009) (-0.843197,-0.34428) (0.39114,0.3234) (-0.139466,-0.156136) (0.589627,0.26009) (-0.139466,-0.156136) (-0.236066,0.0774594) Determinant = (0.943843,0.996661) * 10^ (-1,0) The product inv(A) * A is (1,8.9407e-08) (0,-5.96046e-08) (-5.96046e-08,-7.45058e-09) (2.38419e-07,1.19209e-07) (1,5.96046e-08) (-1.19209e-07,-2.98023e-08) (2.38419e-07,1.19209e-07) (-1.78814e-07,-1.78814e-07) (1,2.98023e-08) TEST31 For a complex symmetric matrix in packed storage, CSPCO factors the matrix and estimates the reciprocal condition number. The matrix order is N = 3 The matrix: (0.44986,-0.126667) (-0.843197,-0.34428) (0.39114,0.3234) (-0.843197,-0.34428) (0.589627,0.26009) (-0.139466,-0.156136) (0.39114,0.3234) (-0.139466,-0.156136) (-0.236066,0.0774594) Estimated reciprocal condition RCOND = 0.0576192 TEST32 For a complex symmetric matrix in packed storage, CSPFA factors the matrix. CSPSL solves a linear system. The matrix order is N = 3 The matrix: (0.44986,-0.126667) (-0.843197,-0.34428) (0.39114,0.3234) (-0.843197,-0.34428) (0.589627,0.26009) (-0.139466,-0.156136) (0.39114,0.3234) (-0.139466,-0.156136) (-0.236066,0.0774594) The right hand side: (-1.28737,-0.485804) (0.487501,0.746809) (0.162288,-0.606224) Computed Exact Solution Solution (0.0185992,-0.633214) (0.0185991,-0.633214) (0.89285,0.0103139) (0.89285,0.0103136) (-0.560465,0.763795) (-0.560465,0.763795) TEST33 For a complex symmetric matrix in packed storage, CSPFA factors the matrix. CSPDI computes the determinant or inverse. The matrix order is N = 3 The matrix: (0.44986,-0.126667) (-0.843197,-0.34428) (0.39114,0.3234) (-0.843197,-0.34428) (0.589627,0.26009) (-0.139466,-0.156136) (0.39114,0.3234) (-0.139466,-0.156136) (-0.236066,0.0774594) Determinant = (0.788527,1.04145) * 10^ (-1,0) The product inv(A) * A is (1,0) (0,0) (-4.76837e-07,-2.38419e-07) (-5.96046e-08,1.04308e-07) (1,1.19209e-07) (-1.78814e-07,1.78814e-07) (2.98023e-08,-2.23517e-08) (0,2.98023e-08) (1,-4.47035e-08) TEST34 For an MxN matrix A in complex general storage, CSVDC computes the singular value decomposition: A = U * S * V^H Matrix rows M = 4 Matrix columns N = 3 The matrix A: (0.44986,-0.126667) (-0.139466,-0.156136) (-0.560465,0.763795) (-0.843197,-0.34428) (-0.236066,0.0774594) (0.306357,0.0262752) (0.589627,0.26009) (0.0185991,-0.633214) (0.500804,-0.779931) (0.39114,0.3234) (0.89285,0.0103136) (0.350471,0.0165551) Decompose the matrix. Singular values: 1 (1.72997,0) 2 (1.30087,0) 3 (0.560498,0) Left Singular Vector Matrix U: (0.000610419,-0.345582) (-0.646616,-0.103579) (-0.138959,0.473898) (0.370919,0.26507) (-0.351825,-0.0920352) (0.472598,0.309029) (-0.397698,-0.0478031) (0.389194,0.486806) (0.612414,0.327092) (0.187891,0.240285) (0.343893,0.349912) (0.0786283,0.421944) (0.100854,0.506073) (-0.398919,0.0116254) (-0.0505478,-0.593639) (0.461647,0.0797946) Right Singular Vector Matrix V: (0.590574,0) (-0.585488,0) (0.555362,0) (0.0169573,0.54449) (-0.373585,-0.0446885) (-0.411883,-0.626125) (-0.161381,0.573081) (0.156257,0.700874) (0.336346,0.129477) The product U * S * V^H (should equal A): (0.44986,-0.126667) (-0.139466,-0.156136) (-0.560465,0.763795) (-0.843197,-0.34428) (-0.236066,0.0774595) (0.306357,0.0262753) (0.589627,0.26009) (0.0185992,-0.633214) (0.500804,-0.779931) (0.39114,0.3234) (0.89285,0.0103135) (0.350471,0.0165551) TEST345 For an MxN matrix A in complex general storage, CSVDC computes the singular value decomposition: A = U * S * V^H Matrix rows M = 4 Matrix columns N = 4 The matrix A: (1,0) (1,0) (1,0) (1,0) (-0,-1) (-1,0) (1,0) (0,1) (-1,0) (-1,0) (1,0) (-1,0) (0,1) (1,0) (1,0) (-0,-1) Decompose the matrix. Singular values: 1 (2.82843,0) 2 (2,0) 3 (2,0) 4 (0,0) Left Singular Vector Matrix U: (0.353553,0.353553) (-0.0707106,0.494975) (-0.353553,0.353553) (0.0707107,0.494975) (-0.353553,-0.353553) (-0.0707107,0.494975) (-0.353553,0.353553) (-0.0707107,-0.494975) (-0.353553,-0.353553) (-0.0707107,0.494975) (0.353553,-0.353553) (0.0707107,0.494975) (0.353553,0.353553) (-0.0707106,0.494975) (0.353553,-0.353553) (-0.0707107,-0.494975) Right Singular Vector Matrix V: (0.5,0) (0,0) (-0.707107,0) (0.5,0) (0.5,0.5) (0,0) (2.98023e-08,2.98023e-08) (-0.5,-0.5) (0,0) (-0.141421,0.98995) (0,0) (0,0) (1.61064e-08,0.5) (0,0) (2.27779e-08,0.707107) (1.61064e-08,0.5) The product U * S * V^H (should equal A): (1.000000,0.000000) (1.000000,0.000000) (1.000000,-0.000000) (1.000000,0.000000) (0.000000,-1.000000) (-1.000000,0.000000) (1.000000,0.000000) (-0.000000,1.000000) (-1.000000,-0.000000) (-1.000000,-0.000000) (1.000000,0.000000) (-1.000000,-0.000000) (0.000000,1.000000) (1.000000,-0.000000) (1.000000,0.000000) (0.000000,-1.000000) TEST35 For a complex triangular matrix, CTRCO estimates the condition. Matrix order N = 3 Estimated reciprocal condition RCOND = 0.072614 TEST36 For a complex triangular matrix, CTRDI computes the determinant or inverse. Matrix order N = 3 Determinant = (-7.367152,1.310821) * 10^ -2.000000 The product inv(A) * A is (1.000000,-0.000000) (0.000000,0.000000) (0.000000,0.000000) (0.000000,-0.000000) (1.000000,0.000000) (0.000000,0.000000) (0.000000,0.000000) (0.000000,-0.000000) (1.000000,0.000000) TEST37 For a complex triangular matrix, CTRSL solves a linear system. Matrix order N = 10 Computed Exact Solution Solution (1.000000,9.999999) (1.000000,10.000000) (2.000000,19.999998) (2.000000,20.000000) (3.000001,30.000002) (3.000000,30.000000) (4.000009,40.000015) (4.000000,40.000000) (4.999999,50.000000) (5.000000,50.000000) (6.000003,59.999996) (6.000000,60.000000) (7.000008,70.000015) (7.000000,70.000000) (8.000010,80.000008) (8.000000,80.000000) (8.999985,90.000038) (9.000000,90.000000) (9.999968,100.000114) (10.000000,100.000000) LINPACK_C_PRB Normal end of execution. 27 August 2016 09:48:22 AM