using System; using System.Collections.Generic; using System.Linq; using System.Text; using Azimuth.DenseLinearAlgebra; namespace Azimuth.UnitTests.DenseLinearAlgebra { public class UpperHessenberMatrixTests : UnitTestSharp.TestFixture { public class Ctor : UnitTestSharp.TestFixture { public void BasicMat() { var expected = new SquareMatrix(new Scalar[,] { {1, 2, 3, }, {4, 5, 6, }, {0, 7, 8, }, }); var mat = new UpperHessenbergMatrix(expected); CheckEqual(expected, mat); CheckEqual(3, mat.Size); CheckEqual(3, mat.ColumnCount); CheckEqual(3, mat.RowCount); } public void BasicArray() { var entries = new Scalar[,] { {1, 2, 3, }, {4, 5, 6, }, {0, 7, 8, }, }; var mat = new UpperHessenbergMatrix(entries); var expected = new SquareMatrix(entries); CheckEqual(expected, mat); CheckEqual(3, mat.Size); CheckEqual(3, mat.ColumnCount); CheckEqual(3, mat.RowCount); } } public class Accessor : UnitTestSharp.TestFixture { public void AccessBasic() { var entries = new Scalar[,] { {1, 2, 3, }, {4, 5, 6, }, {0, 7, 8, }, }; var mat = new UpperHessenbergMatrix(entries); var expected = new SquareMatrix(entries); CheckEqual(1, mat[0, 0]); CheckEqual(2, mat[0, 1]); CheckEqual(3, mat[0, 2]); CheckEqual(4, mat[1, 0]); CheckEqual(5, mat[1, 1]); CheckEqual(6, mat[1, 2]); CheckEqual(0, mat[2, 0]); CheckEqual(7, mat[2, 1]); CheckEqual(8, mat[2, 2]); } public void SetOnBand() { var entries = new Scalar[,] { {1, 2, 3, }, {4, 5, 6, }, {0, 7, 8, }, }; var mat = new UpperHessenbergMatrix(entries); mat[1, 2] = 3; CheckEqual(3, mat[1, 2]); } public void SetOffBand_Zero() { var entries = new Scalar[,] { {1, 2, 3, }, {4, 5, 6, }, {0, 7, 8, }, }; var mat = new UpperHessenbergMatrix(entries); var expected = new SquareMatrix(entries); mat[2, 0] = 0; } public void SetOffBand_Nonzero() { var entries = new Scalar[,] { {1, 2, 3, }, {4, 5, 6, }, {0, 7, 8, }, }; var mat = new UpperHessenbergMatrix(entries); var expected = new SquareMatrix(entries); CheckThrow(typeof(Exception)); mat[2, 0] = 1; } } public class CalculateEigenvalues : UnitTestSharp.TestFixture { public void Identity() { var mat = new UpperHessenbergMatrix(new Scalar[,] { {1, 0, 0, 0, }, {0, 1, 0, 0, }, {0, 0, 1, 0, }, {0, 0, 0, 1, }, }); var eigenvalues = mat.CalculateRealEigenvalues(); var expected = new Scalar[] { 1, 1, 1, 1, }; CheckEqualCommutative(expected, eigenvalues); } public void Diagonal() { var mat = new UpperHessenbergMatrix(new Scalar[,] { {1, 0, 0, 0, }, {0, 2, 0, 0, }, {0, 0, -3, 0, }, {0, 0, 0, -1, }, }); var eigenvalues = mat.CalculateRealEigenvalues(); var expected = new Scalar[] { -3, -1, 1, 2 }; CheckEqualCommutative(expected, eigenvalues); } public void ZeroMatrix() { var mat = new UpperHessenbergMatrix(new Scalar[,] { { 0, 0, 0, 0, }, { 0, 0, 0, 0, }, { 0, 0, 0, 0, }, { 0, 0, 0, 0, }, }); var eigenvalues = mat.CalculateRealEigenvalues(); var expected = new Scalar[] { 0, 0, 0, 0 }; CheckEqualCommutative(expected, eigenvalues); } public void NoReal() { var mat = new UpperHessenbergMatrix(new Scalar[,] { { 0.8, -0.6, 0, 0, }, { 0.6, 0.8, 0, 0, }, { 0, 0, 0.8, -0.6, }, { 0, 0, 0.6, 0.8, }, }); var eigenvalues = mat.CalculateRealEigenvalues(); var expected = new Scalar[] { }; CheckEqualCommutative(expected, eigenvalues); } public void x00() { var mat = new UpperHessenbergMatrix(new Scalar[,] { }); var eigenvalues = mat.CalculateRealEigenvalues(); var expected = new Scalar[] { }; CheckEqualCommutative(expected, eigenvalues); } public void x11() { var mat = new UpperHessenbergMatrix(new Scalar[,] { { 7, }, }); var eigenvalues = mat.CalculateRealEigenvalues(); var expected = new Scalar[] { 7, }; CheckEqualCommutative(expected, eigenvalues); } public void x22() { var mat = new UpperHessenbergMatrix(new Scalar[,] { { 4, 3, }, { 3, 4, }, }); var eigenvalues = mat.CalculateRealEigenvalues(); var expected = new Scalar[] { 1, 7, }; CheckEqualCommutative(expected, eigenvalues); } public void x33() { var mat = new UpperHessenbergMatrix(new Scalar[,] { { 1, 2, 3, }, { 4, 5, 6, }, { 0, 8, 9, }, }); var eigenvalues = mat.CalculateRealEigenvalues(); var expected = new Scalar[] { 14.893242553325800, }; CheckEqualCommutative(expected, eigenvalues); } public void x55() { var mat = new UpperHessenbergMatrix(new Scalar[,] { { 1, 2, 3, 4, 5 }, { 2, 2, 3, 2, 1 }, { 0, 1, 2, 1, 1 }, { 0, 0, 2, 2, 1 }, { 0, 0, 0, 1, 1 }, }); var eigenvalues = mat.CalculateRealEigenvalues(); var expected = new Scalar[] { 5.485788536193147, }; CheckEqualCommutative(expected, eigenvalues); } public void x66() { var mat = new UpperHessenbergMatrix(new Scalar[,] { { 7.000000000000000, 7.276068751089988, 5.812049373662239, -0.139700852436428, 9.015200635240408, 7.936343414048666, }, { 12.369316876852983, 4.130718954248365, 18.968509239938548, -1.207072582996759, 10.683308983004862, 2.415951310656580, }, { 0.000000000000000, -7.160341769381306, 2.447764803753486, -0.565593838239241, -4.181395925572754, -3.250955159201561, }, { 0.000000000000000, 0.000000000000000, -8.598770629747584, 2.915100285023692, -3.416857533555016, 5.722969260736876, }, { 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.046436231879865, -2.835100738826459, -10.979177930043305, }, { 0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000, 1.414293337412555, 5.341516695800912, }, }); var eigenValues = mat.CalculateRealEigenvalues(); var expected = new Scalar[] { 4, 3, }; CheckEqualCommutative(expected, eigenValues); } public void x1616() { var mat = new UpperHessenbergMatrix(new Scalar[,] { { 6, -7, -9, 7, -7, 3, 3, 9, 4, -7, -6, 1, 0, -3, 6, -2 }, { 2, 1, 0, 0, -1, -4, -1, 1, -7, 0, 3, -4, -2, -1, -10, -4 }, { 0, -4, -6, -6, 9, -8, 8, 8, -1, -1, -1, -2, 8, -8, -4, 5 }, { 0, 0, 8, -7, 3, -10, -8, 0, 8, -7, 7, -1, -7, -9, 8, 6 }, { 0, 0, 0, -2, -9, 1, -5, -9, 0, 9, -7, -2, -4, -4, 7, 9 }, { 0, 0, 0, 0, -9, 9, 0, -5, -5, -3, 7, -8, -1, -2, 2, 5 }, { 0, 0, 0, 0, 0, -4, 4, 9, 0, 4, -9, -7, -7, 2, -1, -8 }, { 0, 0, 0, 0, 0, 0, 1, -2, -5, 6, -8, -2, -2, 7, -8, -10 }, { 0, 0, 0, 0, 0, 0, 0, 1, -9, 5, -10, 7, 7, 7, 9, -8 }, { 0, 0, 0, 0, 0, 0, 0, 0, -7, -10, 6, -7, -1, 1, 4, -3 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, -3, -1, 8, -4, 2 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 1, -10, -4, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10, -9, 3, -1, -4 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -3, 1, 4, -6 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 6, 9 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 5 }, }); var eigenValues = mat.CalculateRealEigenvalues(); var expected = new Scalar[] { -14.15303053628267, -10.66884376190023, 13.97123505511950, 4.63339810648546, -4.02542691649254, -3.81575486956688, }; CheckEqualCommutative(expected, eigenValues); } public void x1616_NullRow() { var mat = new UpperHessenbergMatrix(new Scalar[,] { { 8, -6, -9, 7, 7, 7, 6, -2, 0, 1, 0, -10, 6, 7, -2, -7 }, { 5, 7, 5, 6, 2, 3, -10, -8, 4, -5, -1, -9, -1, 3, 4, -5 }, { 0, 9, 4, 7, 7, -6, -7, 0, 2, 1, 8, 5, -7, 7, 4, 6 }, { 0, 0, -2, 6, -1, 1, 4, -4, -1, 2, -6, 6, 5, 6, 2, 6 }, { 0, 0, 0, 8, -7, -1, -5, 0, -6, -3, -1, 0, -2, -2, 5, 0 }, { 0, 0, 0, 0, -9, -2, -2, 7, -3, 0, 0, 1, 7, -3, 2, 7 }, { 0, 0, 0, 0, 0, -10, 7, 3, 9, -9, -4, 3, -10, 5, -10, 8 }, { 0, 0, 0, 0, 0, 0, 3, -6, -10, 9, -7, -6, 9, 0, -7, -4 }, { 0, 0, 0, 0, 0, 0, 0, -7, 0, 3, 3, 4, -10, 1, -3, 8 }, { 0, 0, 0, 0, 0, 0, 0, 0, 3, -6, -6, 5, 9, 2, -6, 2 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, -7, -7, 5, -5, 4, -3, -4 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -5, 3, 0, -7, 7 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, -5, -3, -1, 1 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, -10, -10, -9 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10, -9, 8 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, }); var eigenValues = mat.CalculateRealEigenvalues(); var expected = new Scalar[] { -18.609437265080107, -15.550183034148326, -11.654703459672424, -10.689362912011779, -6.985319148966362, -2.489085229048183, 1.463460687524856, 0.000000000000000, }; CheckEqualCommutative(expected, eigenValues); } public void LargeBalancedProblem() { // Tests the shift in the QR implicit algorithm var mat = new UpperHessenbergMatrix(new Scalar[,] { {0, 0.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.5914642398}, {1, 0, 0.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0.5, 0, 0.25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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 0, 0.8406088192}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0.25, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0.5, 0, 0, 0, 0, 0, 0, 0, -0.2466699264}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 0, 0.5, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 0, 0.25, 0, 0, 0, 0, 0, 0.013773824}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0.125, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0.0625, 0, 0, 0, -0.0048529408}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0.03125, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0.015625, 0, 0.0222298112}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0.015625, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, -0.6442450944}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -14.98620022491962, 9.490800000000001e-006}, }); var expectedEigenvalues = new Scalar[] { -.8, -.8, 0, 0, .8, .8 }; var eigenValues = mat.CalculateRealEigenvalues(); CheckEqualCommutative(expectedEigenvalues, eigenValues); } public void UnbalancedLargeSparseProblem() { // Tests the shift in the QR implicit algorithm var mat = new UpperHessenbergMatrix(new Scalar[,] { { 0 , 0.5 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0.7957321199 }, { 1 , 0 , 0.5 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, { 0 , 0.5 , 0 , 0.5 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , -0.3009401784 }, { 0 , 0 , 0.5 , 0 , 0.5 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, { 0 , 0 , 0 , 0.5 , 0 , 0.5 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0.1389343692 }, { 0 , 0 , 0 , 0 , 0.5 , 0 , 0.5 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, { 0 , 0 , 0 , 0 , 0 , 0.5 , 0 , 0.5 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0.6918730825 }, { 0 , 0 , 0 , 0 , 0 , 0 , 0.5 , 0 , 0.5 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0.5 , 0 , 0.5 , 0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, 0 , 0 , 0.5 , 0 , 0.5 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0.5 , 0 , 0.5 , 0 , 0 , 0 , 0 , 0 , 0.0000067255 }, { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0.5 , 0 , 0.5 , 0 , 0 , 0 , 0 , 0 }, { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0.5 , 0 , 0.5 , 0 , 0 , 0 , -0.0000002962 }, { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0.5 , 0 , 0.5 , 0 , 0 , 0 }, { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0.5 , 0 , 0.5 , 0 , 0.0000000106 }, { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0.5 , 0 , 0.5 , 0 }, { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0.5 , 0 , -0.0000000003 }, { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , -32182619928.6688 , 0.0000094908 }, }); var expectedEigenvalues = new Scalar[] { -.8, -.8, 0, 0, .8, .8 }; var eigenValues = mat.CalculateRealEigenvalues(); CheckEqualCommutative(expectedEigenvalues, eigenValues); } } } }