{"id":287902,"date":"2018-08-16T14:18:52","date_gmt":"2018-08-16T10:18:52","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=287902"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2018-08-16T10:18:52","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=287902","title":{"rendered":"\u0415\u0449\u0435 \u043f\u0440\u043e \u043c\u0435\u0442\u043e\u0434\u044b \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0445 \u0430\u043b\u0433\u0435\u0431\u0440\u0430\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439"},"content":{"rendered":"\n<div data-io-article-url=\"https:\/\/habr.com\/post\/418627\/\" class=\"post__text post__text-html js-mediator-article\">\u0420\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043f\u0440\u043e \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u043e\u0447\u0435\u043d\u044c \u0442\u0440\u0443\u0434\u043d\u043e, \u043d\u043e \u043c\u043d\u0435 \u044d\u0442\u0430 \u0442\u0435\u043c\u0430 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0439 \u0438 \u0447\u0440\u0435\u0437\u0432\u044b\u0447\u0430\u0439\u043d\u043e \u0432\u0430\u0436\u043d\u043e\u0439, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432\u0441\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0447\u0430\u0441\u0442\u043e. \u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"https:\/\/habr.com\/post\/418241\/\"> \u041f\u043e\u0447\u0435\u043c\u0443 \u0413\u0430\u0443\u0441\u0441? <\/a> \u0431\u044b\u043b \u043e\u043f\u0438\u0441\u0430\u043d \u043c\u0435\u0442\u043e\u0434 \u0413\u0430\u0443\u0441\u0441\u0430 (\u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0441 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043c\u0438) \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b. \u041e\u0434\u043d\u0430\u043a\u043e, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u043a\u0440\u0438\u0442\u0438\u043a\u0443 <a href=\"https:\/\/habr.com\/users\/sinn3r\/\" class=\"user_link\">Sinn3r<\/a>, \u044f \u0440\u0435\u0448\u0438\u043b \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b. <br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u041d\u0430\u0447\u043d\u0435\u043c \u0441\u043d\u0430\u0447\u0430\u043b\u0430<\/h4>\n<p>  \u0418\u0442\u0430\u043a, \u043f\u0443\u0441\u0442\u044c \u043d\u0430\u043c \u0441\u043d\u043e\u0432\u0430 \u043d\u0443\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0445 \u0430\u043b\u0433\u0435\u0431\u0440\u0430\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/08d\/9fa\/efb\/08d9faefbe272bdf8fbb80773542e343.svg\" alt=\"$n$\" data-tex=\"inline\"><\/math>. \u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u044f\u0440\u043a\u0438\u0445 \u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/024\/ddc\/98c\/024ddc98c545fea48a62d07f16a2d1bf.svg\" alt=\"$LU$\" data-tex=\"inline\"><\/math>-\u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b. <\/p>\n<p>  \u042d\u0442\u043e \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c. \u041f\u0443\u0441\u0442\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0445 \u0430\u043b\u0433\u0435\u0431\u0440\u0430\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439 (\u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u043c \u0432\u0438\u0434\u0435): <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/ce3\/642\/4b6\/ce36424b6ee64ead86b213b25abd5ea6.svg\" alt=\"$ Ax = b,$\" data-tex=\"display\"><\/math><\/p>\n<p> \u0433\u0434\u0435 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6ac\/5e7\/c00\/6ac5e7c00bbb45398a6ab947dafd3ab9.svg\" alt=\"$A = (a_{ij})$\" data-tex=\"inline\"><\/math> \u2014 \u0441\u0442\u0440\u0430\u0448\u043d\u0430\u044f \u0438 \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u0430\u044f <u>\u043d\u0435\u0432\u044b\u0440\u043e\u0436\u0434\u0435\u043d\u043d\u0430\u044f<\/u> \u043c\u0430\u0442\u0440\u0438\u0446\u0430. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0435\u0435 \u0432 \u0432\u0438\u0434\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0430\u0442\u0440\u0438\u0446: <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/bf3\/27c\/835\/bf327c835e27115ebbb60a80820500fa.svg\" alt=\"$L = (l_{ij})$\" data-tex=\"inline\"><\/math> \u2014 \u043d\u0438\u0436\u043d\u044f\u044f \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430, \u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/344\/65c\/fb4\/34465cfb4d5df76152d400c29eccb259.svg\" alt=\"$U=(u_{ij})$\" data-tex=\"inline\"><\/math> \u2014 \u0432\u0435\u0440\u0445\u043d\u044f\u044f \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430. \u0422\u043e\u0433\u0434\u0430 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u0438\u0434:   <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/e26\/bda\/796\/e26bda7968e03169af225219af2869c6.svg\" alt=\"$ LUx = b.$\" data-tex=\"display\"><\/math><\/p>\n<p> \u0415\u0441\u043b\u0438 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u0442\u044c <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/bb5\/eb4\/82b\/bb5eb482be4da3c73d823ddd2a90cb57.svg\" alt=\"$Ux = y$\" data-tex=\"inline\"><\/math>, \u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0437 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c:   <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/2da\/b7a\/133\/2dab7a1336116be896fa6759a0ee2cf1.svg\" alt=\"$ Ly = b,$\" data-tex=\"display\"><\/math><\/p>\n<\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/df8\/be1\/74d\/df8be174d44b24bfd596aa85ee72d538.svg\" alt=\"$Ux = y.$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u0445 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e (\u0432 \u0441\u0438\u043b\u0443 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043c\u0430\u0442\u0440\u0438\u0446\u044b <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a5a\/4e0\/afa\/a5a4e0afaec84939dbfda220172b2be0.svg\" alt=\"$L$\" data-tex=\"inline\"><\/math> \u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d07\/cc5\/b26\/d07cc5b26db621faab45e0e0b54ede62.svg\" alt=\"$U$\" data-tex=\"inline\"><\/math> \u2014 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u044b\u0435). \u041d\u043e \u043b\u0435\u0433\u043a\u043e \u043b\u0438 \u043d\u0430\u0439\u0442\u0438 \u044d\u0442\u0438 \u043c\u0430\u0442\u0440\u0438\u0446\u044b? \u0418\u0442\u0430\u043a, \u0437\u0430\u0434\u0430\u0447\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0437\u0430\u0434\u0430\u0447\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/024\/ddc\/98c\/024ddc98c545fea48a62d07f16a2d1bf.svg\" alt=\"$LU$\" data-tex=\"inline\"><\/math>-\u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u044b.<\/p>\n<p>  \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0449\u0435\u0433\u043e <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/024\/ddc\/98c\/024ddc98c545fea48a62d07f16a2d1bf.svg\" alt=\"$LU$\" data-tex=\"inline\"><\/math>-\u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e <a href=\"https:\/\/habr.com\/sandbox\/35982\/\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u0410 \u043c\u044b \u043f\u043e\u043a\u0430 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u043c\u0435\u0442\u043e\u0434. <\/p>\n<h4>\u041c\u0435\u0442\u043e\u0434 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043e\u0433\u043e \u043a\u043e\u0440\u043d\u044f<\/h4>\n<p>  \u041d\u0430\u043b\u043e\u0436\u0438\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u043b\u044c\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u043d\u0430 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/493\/c1c\/008\/493c1c008018df9bed4910321f29ff00.svg\" alt=\"$A$\" data-tex=\"inline\"><\/math>. \u041f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u0431\u044b\u043b\u0430 \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0430\u044f, \u0442\u043e \u0435\u0441\u0442\u044c <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/5e7\/d29\/7ce\/5e7d297cefa35098ed26c56c86a74f07.svg\" alt=\"$a_{ij} = a_{ji}$\" data-tex=\"inline\"><\/math> \u0438\u043b\u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/df3\/74a\/d33\/df374ad3340f76a036ed4519768392e9.svg\" alt=\"$A^t = A$\" data-tex=\"inline\"><\/math>. \u0422\u0430\u043a\u0443\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u0432\u0438\u0434\u0435   <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9f0\/a8c\/693\/9f0a8c6939042ee12e18fd13a7567233.svg\" alt=\"$A = S^tDS,$\" data-tex=\"display\"><\/math><\/p>\n<p> \u0433\u0434\u0435 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/cb6\/d45\/cf9\/cb6d45cf916546ae1085088c0c5dcd09.svg\" alt=\"$S$\" data-tex=\"inline\"><\/math> \u2014 \u0432\u0435\u0440\u0445\u043d\u044f\u044f \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430, <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c5e\/2ea\/3b6\/c5e2ea3b63d255f7a483773fe1d664b2.svg\" alt=\"$D$\" data-tex=\"inline\"><\/math> \u2014 \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u044c\u043d\u0430\u044f <u>\u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f<\/u> \u043c\u0430\u0442\u0440\u0438\u0446\u0430, \u043f\u0440\u0438\u0447\u0435\u043c \u0435\u0435 \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043f\u043e \u043c\u043e\u0434\u0443\u043b\u044e \u0440\u0430\u0432\u043d\u044b \u0435\u0434\u0438\u043d\u0438\u0446\u0435. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0434\u0432\u0443\u043c \u0434\u0440\u0443\u0433\u0438\u043c: <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4b3\/f55\/1d7\/4b3f551d7b696119d1f2e5bd0591d4e7.svg\" alt=\"$S^tDy = b,$\" data-tex=\"display\"><\/math><\/p>\n<\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8f9\/48f\/fc7\/8f948ffc74baccb93b5e15d305ea2a29.svg\" alt=\"$Sx = y,$\" data-tex=\"display\"><\/math><\/p>\n<p> \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u043e\u0436\u0435 \u0440\u0435\u0448\u0430\u044e\u0442\u0441\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u043e \u0432 \u0441\u0438\u043b\u0443 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043c\u0430\u0442\u0440\u0438\u0446 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/cb6\/d45\/cf9\/cb6d45cf916546ae1085088c0c5dcd09.svg\" alt=\"$S$\" data-tex=\"inline\"><\/math> \u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c5e\/2ea\/3b6\/c5e2ea3b63d255f7a483773fe1d664b2.svg\" alt=\"$D$\" data-tex=\"inline\"><\/math>. <\/p>\n<p>  \u0412\u044b\u0432\u043e\u0434 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0444\u043e\u0440\u043c\u0443\u043b \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u0438\u0439 \u0438 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0437\u0430 \u0440\u0430\u043c\u043a\u0430\u043c\u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438. \u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438, \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"http:\/\/algowiki-project.org\/ru\/%D0%A0%D0%B0%D0%B7%D0%BB%D0%BE%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5_%D0%A5%D0%BE%D0%BB%D0%B5%D1%86%D0%BA%D0%BE%D0%B3%D0%BE_(%D0%BC%D0%B5%D1%82%D0%BE%D0%B4_%D0%BA%D0%B2%D0%B0%D0%B4%D1%80%D0%B0%D1%82%D0%BD%D0%BE%D0%B3%D0%BE_%D0%BA%D0%BE%D1%80%D0%BD%D1%8F)\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u043d\u0430 Java, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u043e\u0433\u043e\u043d\u043a\u0438: <\/p>\n<pre><code class=\"java\">import java.io.FileNotFoundException; import java.io.FileReader; import java.io.PrintWriter; import java.util.Locale; import java.util.Scanner;  public class SquareRootMethod {      public static void main(String[] args) throws FileNotFoundException {         Scanner scanner = new Scanner(new FileReader(\"input.txt\"));         scanner.useLocale(Locale.US);          int n = scanner.nextInt();          double[][] a = new double[n + 1][n + 1];         double[] b = new double[n + 1];          for (int i = 1; i &lt;= n; i++) {             for (int j = 1; j &lt;= n; j++) {                 a[i][j] = scanner.nextDouble();             }             b[i] = scanner.nextDouble();         }          double[] x = new double[n + 1];          double[] d = new double[n + 1];         double[][] s = new double[n + 1][n + 1];          \/\/ for i = 1         d[1] = Math.signum(a[1][1]);         s[1][1] = Math.sqrt(Math.abs(a[1][1]));         for (int j = 2; j &lt;= n; j++) {             s[1][j] = a[1][j] \/ (s[1][1] * d[1]);         }          \/\/ for i &gt; 1         \/\/searching S and D matrix         for (int i = 2; i &lt;= n; i++) {             double sum = 0;             for (int k = 1; k &lt;= i - 1; k++) {                 sum += s[k][i] * s[k][i] * d[k];             }             d[i] = Math.signum(a[i][i] - sum);             s[i][i] = Math.sqrt(Math.abs(a[i][i] - sum));              double l = 1 \/ (s[i][i] * d[i]);             for (int j = i + 1; j &lt;= n; j++) {                 double SDSsum = 0;                 for (int k = 1; k &lt;= i - 1; k++) {                     SDSsum += s[k][i] * d[k] * s[k][j];                 }                 s[i][j] = l * (a[i][j] - SDSsum);             }         }          \/\/solve of the system (s^t * d)y = b         double[] y = new double[n + 1];         y[1] = b[1] \/ (s[1][1] * d[1]);          for (int i = 2; i &lt;= n; i++) {             double sum = 0;              for (int j = 1; j &lt;= i - 1; j++) {                 sum += s[j][i] * d[j] * y[j];             }              y[i] = (b[i] - sum) \/ (s[i][i] * d[i]);         }          \/\/solve of the system sx = y         x[n] = y[n] \/ s[n][n];          for (int i = n - 1; i &gt;= 1; i--) {             double sum = 0;              for (int k = i + 1; k &lt;= n; k++) {                 sum += s[i][k] * x[k];             }              x[i] = (y[i] - sum) \/ s[i][i];         }          \/\/output         PrintWriter pw = new PrintWriter(\"output.txt\");         for (int i = 1; i &lt;= n; i++) {             pw.printf(Locale.US, \"x%d = %f\\n\", i, x[i]);         }         pw.flush();         pw.close();              }  } <\/code><\/pre>\n<p>  <\/p>\n<h4>\u041c\u0435\u0442\u043e\u0434 \u043f\u0440\u043e\u0433\u043e\u043d\u043a\u0438<\/h4>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0438\u043c\u0435\u044e\u0449\u0438\u0435 \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 \u0442\u0440\u0435\u0445 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435. \u0422\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/ba3\/15b\/925\/ba315b925695458943f90269738405d0.svg\" alt=\"$Ax = b$\" data-tex=\"display\"><\/math><\/p>\n<p> \u043c\u0430\u0442\u0440\u0438\u0446\u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/493\/c1c\/008\/493c1c008018df9bed4910321f29ff00.svg\" alt=\"$A$\" data-tex=\"inline\"><\/math> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0440\u0435\u0445\u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439: <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/53f\/c74\/a8d\/53fc74a8d03c1cd4f7fdbb89da4f8e93.svg\" alt=\"$A = \\begin{pmatrix} \u0421_1 &amp; -B_1 &amp; 0 &amp; \\dots &amp; 0 &amp; 0 \\\\ -A_2 &amp; C_2 &amp; -B_2 &amp; \\dots &amp; 0 &amp; 0\\\\ \\vdots &amp; \\vdots &amp; \\vdots &amp; \\ddots &amp; \\vdots &amp; \\vdots \\\\ 0 &amp; 0 &amp; \\dots &amp; -A_{n-1} &amp; C_{n-1} &amp; -B_{n-1} \\\\ 0 &amp; 0 &amp; \\dots &amp; 0 &amp; -A_n &amp; C_n\\\\ \\end{pmatrix}. $\" data-tex=\"display\"><\/math><\/p>\n<p>  \u0421\u0440\u0430\u0437\u0443 \u0437\u0430\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0441\u0432\u044f\u0437\u044c \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439:   <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/747\/581\/072\/74758107264a6776aca72a0182813724.svg\" alt=\"$ x_{i-1} = \\alpha_{i-1} x_i + \\beta_{i-1},$\" data-tex=\"display\"><\/math><\/p>\n<p>  <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/311\/d3d\/d97\/311d3dd97b32ec90c5962b5f10e23ae7.svg\" alt=\"$\\alpha_k, \\beta_k$\" data-tex=\"inline\"><\/math> \u2014 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430. \u0415\u0441\u043b\u0438 \u043c\u044b \u043d\u0430\u0439\u0434\u0435\u043c \u0438\u0445 \u0438 \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u043e\u0434\u043d\u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u0442\u043e \u0441\u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0439\u0442\u0438 \u0438 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435.<\/p>\n<p>  \u0412\u044b\u0432\u043e\u0434 \u0444\u043e\u0440\u043c\u0443\u043b <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/33f\/b43\/c72\/33fb43c7299da237017c9b042d677610.svg\" alt=\"$\\alpha_1 = \\dfrac{B_1}{C_1}, \\ \\alpha_i = \\dfrac{B_i}{C_i - A_i\\alpha_{i-1}}, \\ i = \\overline{2,n},$\" data-tex=\"display\"><\/math><\/p>\n<\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b12\/265\/933\/b12265933322e3a9a89957d47549bf46.svg\" alt=\"$ \\beta_1 = \\dfrac{b_1}{C_1}, \\ \\beta_i = \\dfrac{b_i + A_i\\beta_{i-1}}{C_i - A_i\\alpha_{i-1}}, \\ i = \\overline{2,n}$\" data-tex=\"display\"><\/math><\/p>\n<p> \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9C%D0%B5%D1%82%D0%BE%D0%B4_%D0%BF%D1%80%D0%BE%D0%B3%D0%BE%D0%BD%D0%BA%D0%B8\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u041d\u0443 \u0438 \u0432 \u0438\u0442\u043e\u0433\u0435 <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/578\/ac2\/381\/578ac2381d5735cbfb0075f9876b316d.svg\" alt=\"$ x_n = \\dfrac{b_n + A_n\\beta_{n-1}}{C_n - A_n\\alpha_{n-1}}, \\ x_i = \\alpha_i x_{i+1} + \\beta_i, \\ i = n-1, n-2, \\dots, 1$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u041e\u0442\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0432 \u0444\u043e\u0440\u043c\u0443\u043b\u0430\u0445 \u043f\u043e\u0438\u0441\u043a\u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/07d\/6f7\/55e\/07d6f755ecc98065d00bc24ac4e07a2f.svg\" alt=\"$\\alpha_i, \\beta_i$\" data-tex=\"inline\"><\/math> \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u0447\u0438\u0441\u043b\u043e <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0bb\/e31\/f7d\/0bbe31f7d39832a27ee00328e7605968.svg\" alt=\"$C_i - A_i\\alpha_{i-1},$\" data-tex=\"inline\"><\/math>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043d\u0443\u043b\u0435\u043c, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c. \u041d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0438\u043c\u0435\u0435\u0442 \u043c\u0435\u0441\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 <i>\u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435<\/i>, \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0435\u0441\u0442\u044c <a href=\"http:\/\/math.phys.msu.ru\/data\/197\/5.pdf\">\u0437\u0434\u0435\u0441\u044c<\/a>: \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u0440\u043e\u0433\u043e\u043d\u043a\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c \u0438 \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u044b\u043c, \u0435\u0441\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0443\u0441\u043b\u043e\u0432\u0438\u044f: <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d7b\/0bd\/162\/d7b0bd16274f581fad5567076eb9fac7.svg\" alt=\"$C_1, C_n \\neq 0, A_i, B_i \\neq 0 \\ (i = \\overline{2,n}), $\" data-tex=\"display\"><\/math><\/p>\n<\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/2fd\/51e\/416\/2fd51e416e9501259d89b86ff9d02f3f.svg\" alt=\"$|C_i| \\geq |A_i| + |B_i|.$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0430 Java, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0448\u0430\u0435\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u0443   <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6dd\/711\/682\/6dd7116828028192e3e4f4208b347086.svg\" alt=\"$\\left\\{ \\begin{aligned} &amp;x_1 = 0,\\\\ &amp;x_{i-1} + \\xi x_{i+1} = \\dfrac{i}{n}, \\ (i = \\overline{2,n-1}), \\\\ &amp;x_n = 1, \\\\ \\end{aligned} \\right.$\" data-tex=\"display\"><\/math><\/p>\n<p> \u043f\u0440\u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f0e\/ecf\/9d1\/f0eecf9d1cd42437ba7247af90fa6c8d.svg\" alt=\"$\\xi = 2, n = 21$\" data-tex=\"inline\"><\/math>.<\/p>\n<pre><code class=\"java\">package SystemOfLinearAlgebraicEquations;  import java.io.FileNotFoundException; import java.io.FileReader; import java.io.PrintWriter; import java.util.Locale; import java.util.Scanner;  public class TridiagonalMatrixAlgorithm {  \tpublic static void main(String[] args) throws FileNotFoundException {  \t\tfinal int n = 21; \t\tdouble[] A = new double[n + 1]; \t\tdouble[] B = new double[n + 1]; \t\tdouble[] C = new double[n + 1]; \t\tdouble[] F = new double[n + 1]; \t\tdouble xi = 2; \t\t \t\tC[1] = 1; \t\tF[1] = 0; \t\tfor(int i = 2; i &lt;= n-1; i++) { \t\t\tA[i] = 1; \t\t\tC[i] = xi; \t\t\tB[i] = 1; \t\t\tF[i] =  - (double) i \/ n; \t\t} \t\tA[n] = 0; \t\tC[n] = 1; \t\tF[n] = 1;  \t\tdouble[] alpha = new double[n + 1]; \t\tdouble[] beta = new double[n + 1];  \t\t\/\/ right stroke \t\talpha[1] = B[1] \/ C[1]; \t\tbeta[1] = F[1] \/ C[1]; \t\tfor (int i = 2; i &lt;= n - 1; i++) { \t\t\tdouble denominator = C[i] - A[i] * alpha[i-1]; \t\t\talpha[i] = B[i] \/ denominator; \t\t\tbeta[i] = (F[i] + A[i] * beta[i - 1]) \/ denominator; \t\t}  \t\tdouble[] x = new double[n + 1];  \t\t\/\/ back stroke \t\tx[n] = (F[n] + A[n] * beta[n - 1]) \/ (C[n] - A[n] * alpha[n - 1]); \t\tfor (int i = n - 1; i &gt;= 1; i--) { \t\t\tx[i] = alpha[i] * x[i + 1] + beta[i]; \t\t}  \t\t\/\/ output \t\tPrintWriter pw = new PrintWriter(\"output.txt\"); \t\tfor (int i = 1; i &lt;= n; i = i + 5) { \t\t\tpw.printf(Locale.US, \"x%d = %f\\n\", i, x[i]); \t\t} \t\tpw.flush(); \t\tpw.close();  \t}  } <\/code><\/pre>\n<\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/post\/418627\/\"> https:\/\/habr.com\/post\/418627\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div data-io-article-url=\"https:\/\/habr.com\/post\/418627\/\" class=\"post__text post__text-html js-mediator-article\">\u0420\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043f\u0440\u043e \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u043e\u0447\u0435\u043d\u044c \u0442\u0440\u0443\u0434\u043d\u043e, \u043d\u043e \u043c\u043d\u0435 \u044d\u0442\u0430 \u0442\u0435\u043c\u0430 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0439 \u0438 \u0447\u0440\u0435\u0437\u0432\u044b\u0447\u0430\u0439\u043d\u043e \u0432\u0430\u0436\u043d\u043e\u0439, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432\u0441\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0447\u0430\u0441\u0442\u043e. \u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"https:\/\/habr.com\/post\/418241\/\"> \u041f\u043e\u0447\u0435\u043c\u0443 \u0413\u0430\u0443\u0441\u0441? <\/a> \u0431\u044b\u043b \u043e\u043f\u0438\u0441\u0430\u043d \u043c\u0435\u0442\u043e\u0434 \u0413\u0430\u0443\u0441\u0441\u0430 (\u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0441 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043c\u0438) \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b. \u041e\u0434\u043d\u0430\u043a\u043e, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u043a\u0440\u0438\u0442\u0438\u043a\u0443 <a href=\"https:\/\/habr.com\/users\/sinn3r\/\" class=\"user_link\">Sinn3r<\/a>, \u044f \u0440\u0435\u0448\u0438\u043b \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b.   <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-287902","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/287902","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=287902"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/287902\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=287902"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=287902"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=287902"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}