{"id":183220,"date":"2013-06-13T18:09:02","date_gmt":"2013-06-13T14:09:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=183220"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=183220","title":{"rendered":"<span class=\"post_title\">\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0421\u041b\u0410\u0423 \u0441 \u043c\u0430\u0442\u0440\u0438\u0446\u0435\u0439 \u043e\u0431\u0449\u0435\u0433\u043e \u0432\u0438\u0434\u0430<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \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 (\u0421\u041b\u0410\u0423) \u0438\u0437 <i>m<\/i> \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439 \u0441 <i>n<\/i> \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c\u0438:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/group22x.narod.ru\/grenkin\/habr\/1.png\" alt=\"image\"\/><\/p>\n<p>  \u041c\u0430\u0442\u0440\u0438\u0446\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u043e\u0439 \u043d\u0435\u0432\u044b\u0440\u043e\u0436\u0434\u0435\u043d\u043d\u043e\u0439, \u043d\u043e \u0438 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u043e\u0439 \u0432\u044b\u0440\u043e\u0436\u0434\u0435\u043d\u043d\u043e\u0439 \u0438\u043b\u0438 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u043e\u0439.<br \/>  \u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u0439\u0442\u0438 \u0432\u0441\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043b\u0438\u0431\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0447\u0442\u043e \u043e\u043d\u0430 \u043d\u0435\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u0430 (\u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u0439).<\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043c\u0435\u0442\u043e\u0434 \u0413\u0430\u0443\u0441\u0441\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0421\u041b\u0410\u0423.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0421\u041b\u0410\u0423<\/h4>\n<p>  \u0412\u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u044b\u0445 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0441\u0442\u0443\u043f\u0435\u043d\u0447\u0430\u0442\u043e\u043c\u0443 \u0432\u0438\u0434\u0443:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/group22x.narod.ru\/grenkin\/habr\/2.png\" alt=\"image\"\/><\/p>\n<p>  \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043a \u0441\u0442\u0443\u043f\u0435\u043d\u0447\u0430\u0442\u043e\u043c\u0443 \u0432\u0438\u0434\u0443 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <i>\u043f\u0440\u044f\u043c\u044b\u043c \u0445\u043e\u0434\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0430 \u0413\u0430\u0443\u0441\u0441\u0430<\/i>.<br \/>  \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 <img decoding=\"async\" src=\"http:\/\/group22x.narod.ru\/grenkin\/habr\/3.png\" alt=\"image\"\/> \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f <i>\u0433\u043b\u0430\u0432\u043d\u044b\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438<\/i>, \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f <i>\u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u043c\u0438<\/i>.<br \/>  \u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u043d\u043e \u0447\u0438\u0441\u043b\u043e <img decoding=\"async\" src=\"http:\/\/group22x.narod.ru\/grenkin\/habr\/4.png\" alt=\"image\"\/>, \u0433\u0434\u0435 <img decoding=\"async\" src=\"http:\/\/group22x.narod.ru\/grenkin\/habr\/5.png\" alt=\"image\"\/>, \u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0435\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u0430.<\/p>\n<p>  \u041f\u0443\u0441\u0442\u044c <img decoding=\"async\" src=\"http:\/\/group22x.narod.ru\/grenkin\/habr\/6.png\" alt=\"image\"\/> \u0434\u043b\u044f \u0432\u0441\u0435\u0445 <img decoding=\"async\" src=\"http:\/\/group22x.narod.ru\/grenkin\/habr\/5.png\" alt=\"image\"\/>. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c <i>\u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0439 \u0445\u043e\u0434 \u043c\u0435\u0442\u043e\u0434\u0430 \u0413\u0430\u0443\u0441\u0441\u0430<\/i>.<br \/>  \u041f\u0435\u0440\u0435\u043d\u0435\u0441\u0435\u043c \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 \u043f\u0440\u0430\u0432\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439. \u041f\u043e\u043b\u0443\u0447\u0438\u043c<br \/>  <img decoding=\"async\" src=\"http:\/\/group22x.narod.ru\/grenkin\/habr\/7.png\" alt=\"image\"\/><br \/>  \u041f\u0440\u0438\u0434\u0430\u0434\u0438\u043c \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043d\u0430\u0439\u0434\u0435\u043c \u043f\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0435<br \/>  <img decoding=\"async\" src=\"http:\/\/group22x.narod.ru\/grenkin\/habr\/8.png\" alt=\"image\"\/><\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c <i>\u043f\u0440\u044f\u043c\u043e\u0439 \u0445\u043e\u0434 \u043c\u0435\u0442\u043e\u0434\u0430 \u0413\u0430\u0443\u0441\u0441\u0430 \u0441 \u0432\u044b\u0431\u043e\u0440\u043e\u043c \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043f\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0443<\/i>.<br \/>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0432 1-\u043c \u0441\u0442\u043e\u043b\u0431\u0446\u0435 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e \u043c\u043e\u0434\u0443\u043b\u044e \u044d\u043b\u0435\u043c\u0435\u043d\u0442 (\u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442). \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b 1-\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0440\u0430\u0432\u043d\u044b 0, \u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <i>x<\/i><sub>1<\/sub> \u0443\u0436\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0430, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <i>x<\/i><sub>2<\/sub>. \u0415\u0441\u043b\u0438 \u0436\u0435 \u043d\u0435 \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b 1-\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0440\u0430\u0432\u043d\u044b 0, \u0442\u043e \u043c\u0435\u043d\u044f\u0435\u043c \u043c\u0435\u0441\u0442\u0430\u043c\u0438 1-\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u0441\u0442\u0440\u043e\u043a\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u0430 \u0437\u0430\u0442\u0435\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <i>x<\/i><sub>1<\/sub> \u0438\u0437 2-\u0433\u043e, 3-\u0433\u043e, \u2026, <i>m<\/i>-\u0433\u043e \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439, \u0434\u043e\u043c\u043d\u043e\u0436\u0430\u044f 1-\u0435 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043d\u0430 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b <i>a<\/i><sub><i>i<\/i>,1<\/sub> \u0438 \u0432\u044b\u0447\u0438\u0442\u0430\u044f \u0435\u0433\u043e \u0438\u0437 \u0432\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439.<br \/>  \u041f\u043e\u0441\u043b\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <i>x<\/i><sub>1<\/sub> \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 <i>x<\/i><sub>2<\/sub>, <i>x<\/i><sub>3<\/sub> \u0438 \u0442.\u0434.<br \/>  \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0421\u041b\u0410\u0423 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0413\u0430\u0443\u0441\u0441\u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u043e\u0439 \u0432\u044b\u0440\u043e\u0436\u0434\u0435\u043d\u043d\u043e\u0439 \u0438\u043b\u0438 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u043e\u0439.<\/p>\n<h4>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h4>\n<p>  \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u2014 Gauss, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code>std::vector&lt;std::vector&lt;double&gt; &gt; Gauss( std::vector&lt;std::vector&lt;double&gt; &gt; a, std::vector&lt;double&gt; b); <\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u044b a \u0438 \u0432\u0435\u043a\u0442\u043e\u0440 \u043f\u0440\u0430\u0432\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439 b. \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u0435\u043a\u0442\u043e\u0440 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u044d\u0442\u043e\u0433\u043e \u0432\u0435\u043a\u0442\u043e\u0440\u0430, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u043c, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u043c \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u043f\u0440\u0438 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438 \u0447\u0438\u0441\u043b\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u0438\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. \u0415\u0441\u043b\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0435\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u0430, \u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0443\u0441\u0442\u043e\u0439 \u0432\u0435\u043a\u0442\u043e\u0440.<br \/>  \u0412\u0435\u043a\u0442\u043e\u0440, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0443\u0441\u0442\u0440\u043e\u0435\u043d \u0442\u0430\u043a: \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0447\u0438\u0441\u043b\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u0438\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u0430 <i>i<\/i>-\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 (<i>i<\/i> &gt; 1) \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u043f\u0440\u0438 <i>i<\/i>-\u0439 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439.<\/p>\n<p>  \u041f\u0440\u044f\u043c\u043e\u0439 \u0445\u043e\u0434 \u043c\u0435\u0442\u043e\u0434\u0430 \u0413\u0430\u0443\u0441\u0441\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f i \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f, \u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f j \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c (\u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0438\u0437 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439 \u0441 \u043d\u043e\u043c\u0435\u0440\u0430\u043c\u0438 1, 2, \u2026, <i>i<\/i>\u20131 \u0443\u0436\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441 \u043d\u043e\u043c\u0435\u0440\u0430\u043c\u0438 1, 2, \u2026, <i>j<\/i>\u20131). \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u0445\u043e\u0434\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u0413\u0430\u0443\u0441\u0441\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0435\u043a\u0442\u043e\u0440 jj, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043d\u043e\u043c\u0435\u0440\u0430 \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. \u0422\u0430\u043a\u0436\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f r, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0430\u044f \u0447\u0438\u0441\u043b\u043e \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445.<\/p>\n<pre><code>\/* \u041f\u0440\u044f\u043c\u043e\u0439 \u0445\u043e\u0434 \u043c\u0435\u0442\u043e\u0434\u0430 \u0413\u0430\u0443\u0441\u0441\u0430 *\/  std::vector&lt;int&gt; jj; int j = 0; int r = 0; for (int i = 0; i &lt; m; ++i) { \tdouble max_abs; \tint k_max; \twhile (j &lt;= n-1) { \t\t\/\/\u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e \u043c\u043e\u0434\u0443\u043b\u044e \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \t\tmax_abs = 0; \t\tk_max = i; \t\tfor (int k = i; k &lt; m; ++k) { \t\t\tif (fabs(a[k][j]) &gt; max_abs) { \t\t\t\tmax_abs = fabs(a[k][j]); \t\t\t\tk_max = k; \t\t\t} \t\t} \t\tif (!equal(max_abs, 0)) \t\t\tbreak; \t\t++j; \t} \tif (j &gt; n-1) \t\tbreak; \t++r; \tjj.push_back(j); \tif (k_max != i) { \t\t\/\/\u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043c\u0435\u0441\u0442\u0430\u043c\u0438 i-\u044e \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0441 k_max-\u0439 \t\tfor (int l = j; l &lt; n; ++l) \t\t\tswap_double(a[i][l], a[k_max][l]); \t\tswap_double(b[i], b[k_max]); \t} \t\/\/\u0434\u0435\u043b\u0438\u043c i-\u0435 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043d\u0430 a[i][j] \tfor (int l = j+1; l &lt; n; ++l) { \t\ta[i][l] \/= a[i][j]; \t} \tb[i] \/= a[i][j]; \ta[i][j] = 1; \t\/\/\u043f\u0443\u0442\u0451\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u044b\u0445 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439 \u043e\u0431\u043d\u0443\u043b\u0438\u0442\u044c \/\/\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b a[i+1][j], a[i+2][j], ..., a[m-1][j] \tfor (int k = i+1; k &lt; m; ++k) { \t\t\/\/\u0443\u043c\u043d\u043e\u0436\u0430\u0435\u043c i-\u0435 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043d\u0430 a[k][j] \/\/\u0438 \u0432\u044b\u0447\u0438\u0442\u0430\u0435\u043c \u0438\u0437 k-\u0433\u043e \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \t\tfor (int l = j+1; l &lt; n; ++l) \t\t\ta[k][l] -= a[i][l]*a[k][j]; \t\tb[k] -= b[i]*a[k][j]; \t\ta[k][j] = 0; \t} \t++j; } <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0441\u0442\u044c.<\/p>\n<pre><code>\/* \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043d\u0430 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0441\u0442\u044c *\/  bool flag = true; for (int i = r; i &lt; m; ++i) { \tif (!equal(b[i], 0)) { \t\tflag = false; \t\tbreak; \t} } if (!flag) { \t\/\/\u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0435\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u0430 \treturn ans; } <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f, \u043a\u0430\u043a\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u043c\u0438, \u0438 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<pre><code>\/* \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 *\/  int free_vars_count = n-r; ans.resize(n); for (int j = 0; j &lt; n; ++j) \tans[j].resize(free_vars_count + 1); if (r == 0) { \tfor (int j = 0; j &lt; n; ++j) \t\tans[j][j+1] = 1; } else { \tint c = 0; \tfor (int j = 0; j &lt; jj[0]; ++j) { \t\t++c; \t\tans[j][c] = 1; \t} \tfor (int i = 0; i &lt; r-1; ++i) { \t\tfor (int j = jj[i]+1; j &lt; jj[i+1]; ++j) { \t\t\t++c; \t\t\tans[j][c] = 1; \t\t} \t} \tfor (int j = jj[r-1]+1; j &lt; n; ++j) { \t\t++c; \t\tans[j][c] = 1; \t} } <\/code><\/pre>\n<p>  \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0439 \u0445\u043e\u0434 \u043c\u0435\u0442\u043e\u0434\u0430 \u0413\u0430\u0443\u0441\u0441\u0430, \u0432 \u0445\u043e\u0434\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445.<\/p>\n<pre><code>\/* \u041e\u0431\u0440\u0430\u0442\u043d\u044b\u0439 \u0445\u043e\u0434 \u043c\u0435\u0442\u043e\u0434\u0430 \u0413\u0430\u0443\u0441\u0441\u0430 *\/  for (int i = r-1; i &gt;= 0; --i) { \tans[jj[i]][0] = b[i]; \tfor (j = jj[i]+1; j &lt; n; ++j) \t\tans[jj[i]] = add(ans[jj[i]], mult(ans[j], -a[i][j])); } <\/code><\/pre>\n<p>  \u0412\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:  <\/p>\n<pre><code>\tconst double EPS = 1e-12;  \tbool equal(double a, double b) \t{ \t\treturn fabs(b-a) &lt;= EPS; \t}  \tvoid swap_double(double &a, double &b) \t{ \t\tdouble tmp = a; \t\ta = b; \t\tb = tmp; \t}  \tstd::vector&lt;double&gt; add(std::vector&lt;double&gt; a, std::vector&lt;double&gt; b) \t{ \t\tstd::vector&lt;double&gt; c; \t\tc.resize(a.size()); \t\tfor (int i = 0; i &lt; c.size(); ++i) \t\t\tc[i] = a[i] + b[i]; \t\treturn c; \t}  \tstd::vector&lt;double&gt; mult(std::vector&lt;double&gt; a, double k) \t{ \t\tstd::vector&lt;double&gt; c; \t\tc.resize(a.size()); \t\tfor (int i = 0; i &lt; c.size(); ++i) \t\t\tc[i] = a[i]*k; \t\treturn c; \t} <\/code><\/pre>\n<p>  \u0421\u0441\u044b\u043b\u043a\u0438:  <\/p>\n<ol>\n<li>\u041c\u0435\u0442\u043e\u0434 \u0413\u0430\u0443\u0441\u0441\u0430 \u2014 \u0412\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u044f. URL: <a href=\"http:\/\/ru.wikipedia.org\/wiki\/\u041c\u0435\u0442\u043e\u0434_\u0413\u0430\u0443\u0441\u0441\u0430\">ru.wikipedia.org\/wiki\/\u041c\u0435\u0442\u043e\u0434_\u0413\u0430\u0443\u0441\u0441\u0430<\/a><\/li>\n<li>\u041c\u0435\u0442\u043e\u0434 \u0413\u0430\u0443\u0441\u0441\u0430: \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0445 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439, \u043f\u0440\u0438\u043c\u0435\u0440\u044b, \u0440\u0435\u0448\u0435\u043d\u0438\u044f. <a href=\"http:\/\/www.cleverstudents.ru\">www.cleverstudents.ru<\/a>. URL: <a href=\"http:\/\/www.cleverstudents.ru\/solving_systems_Gauss_method.html\">www.cleverstudents.ru\/solving_systems_Gauss_method.html<\/a><\/li>\n<li>\u041c\u0435\u0442\u043e\u0434 \u0413\u0430\u0443\u0441\u0441\u0430 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0445 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439. \u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043e\u0440\u0442\u0430\u043b. URL: <a href=\"http:\/\/mathportal.net\/index.php\/linejnaya-algebra\/metod-gaussa-metod-zhordana-gaussa?showall=&#038;limitstart=\">mathportal.net\/index.php\/linejnaya-algebra\/metod-gaussa-metod-zhordana-gaussa?showall=&#038;limitstart=<\/a><\/li>\n<li>\u041c\u0435\u0442\u043e\u0434\u044b \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0413\u0430\u0443\u0441\u0441\u0430. MachineLearning. URL: <a href=\"http:\/\/www.machinelearning.ru\/wiki\/index.php?title=\u041c\u0435\u0442\u043e\u0434\u044b_\u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f_\u0413\u0430\u0443\u0441\u0441\u0430\">www.machinelearning.ru\/wiki\/index.php?title=\u041c\u0435\u0442\u043e\u0434\u044b_\u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f_\u0413\u0430\u0443\u0441\u0441\u0430<\/a><\/li>\n<\/ol>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/183220\/\"> http:\/\/habrahabr.ru\/post\/183220\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \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 (\u0421\u041b\u0410\u0423) \u0438\u0437 <i>m<\/i> \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439 \u0441 <i>n<\/i> \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c\u0438:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/group22x.narod.ru\/grenkin\/habr\/1.png\" alt=\"image\"\/><\/p>\n<p>  \u041c\u0430\u0442\u0440\u0438\u0446\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u043e\u0439 \u043d\u0435\u0432\u044b\u0440\u043e\u0436\u0434\u0435\u043d\u043d\u043e\u0439, \u043d\u043e \u0438 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u043e\u0439 \u0432\u044b\u0440\u043e\u0436\u0434\u0435\u043d\u043d\u043e\u0439 \u0438\u043b\u0438 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u043e\u0439.<br \/>  \u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u0439\u0442\u0438 \u0432\u0441\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043b\u0438\u0431\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0447\u0442\u043e \u043e\u043d\u0430 \u043d\u0435\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u0430 (\u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u0439).<\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043c\u0435\u0442\u043e\u0434 \u0413\u0430\u0443\u0441\u0441\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0421\u041b\u0410\u0423.  <\/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-183220","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/183220","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=183220"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/183220\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=183220"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=183220"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=183220"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}