{"id":485044,"date":"2026-06-25T15:34:21","date_gmt":"2026-06-25T15:34:21","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=485044"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=485044","title":{"rendered":"Pet-project: \u043c\u0438\u043d\u0438-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0430\u043b\u0433\u0435\u0431\u0440\u0435"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041e\u0434\u043d\u0430\u0436\u0434\u044b \u043c\u0435\u043d\u044f \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0441\u0432\u043e\u0435\u043c \u043e\u043f\u044b\u0442\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432. \u0422\u0430\u043a \u043a\u0430\u043a \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0438\u0439 \u043e\u043f\u044b\u0442 \u0443 \u043c\u0435\u043d\u044f \u0431\u044b\u043b \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435, \u0442\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u044f \u043c\u043e\u0433 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u0441\u043a\u043e\u043c \u043e\u043f\u044b\u0442\u0435, \u043b\u0438\u0431\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 pet-\u043f\u0440\u043e\u0435\u043a\u0442.\u042f \u0432\u044b\u0431\u0440\u0430\u043b \u0442\u0435\u043c\u0443 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0430\u043b\u0433\u0435\u0431\u0440\u044b.<\/p>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u043e \u0434\u0432\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430: \u0441 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c \u043d\u0430 Qt \u043b\u0438\u0431\u043e \u0432 \u0432\u0438\u0434\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 backend-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435. \u042f \u0432\u044b\u0431\u0440\u0430\u043b \u0432\u0442\u043e\u0440\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443.<\/p>\n<p>\u0412 \u0445\u043e\u0434\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b:<\/p>\n<pre><code>- \u041a\u0430\u043a \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438  \u0438 \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0451 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f?- \u0421\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u0440\u043e\u0441\u0442\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u0451\u0442  \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043e\u0442 2D \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u043a \u043f\u043b\u043e\u0441\u043a\u0438\u043c \u043c\u0430\u0442\u0440\u0438\u0446\u0430\u043c?- \u041a\u0430\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0435\u0441\u0442\u044c?  \u041a\u0430\u043a\u0438\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430?- \u0420\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u0445 \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u0445,  \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c\u044b\u0445 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u0442\u0438\u0445 \u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0439.   \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 LU.<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u0438 \u043d\u0435 \u0441\u0442\u0430\u0432\u0438\u0442 \u0441\u0432\u043e\u0435\u0439 \u0446\u0435\u043b\u044c\u044e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0430 Eigen \u0438\u043b\u0438 Armadillo.<\/p>\n<h3>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430<\/h3>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432:<\/p>\n<pre><code>-   \u0425\u0440\u0430\u043d\u0435\u043d\u0438\u0435 (MatrixBase.hpp,FlatMatrix.hpp)-   \u0414\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044f(LU.hpp)    - \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 PA = LU    - \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c Ax = b    - \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f    - \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h3>LU-\u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044f.<\/h3>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 LU-\u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0441 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u043c \u0432\u044b\u0431\u043e\u0440\u043e\u043c \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 (partial pivoting). \u0412 \u0445\u043e\u0434\u0435 \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u0435\u0440\u0445\u043d\u0435-\u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 U \u0438 \u043d\u0438\u0436\u043d\u0435-\u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 L. \u041e\u043d\u0438 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0432 \u043e\u0434\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u0435 (in-place). \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u0442\u0435\u0441\u0442\u0430\u0445, \u0433\u0434\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e PA=LU. \u0412 \u043a\u043b\u0430\u0441\u0441\u0435 \u0435\u0441\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0442\u0438\u043f\u0430\u043c\u0438 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u044f\u0442\u043e\u0439, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u0440\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u0442\u0440\u0438\u0446 U \u0438 L \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0432 \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u0434\u0440\u043e\u0431\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043f\u043e\u0442\u0435\u0440\u0435 \u0434\u0440\u043e\u0431\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0438\u0437-\u0437\u0430 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438, \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u043a \u0438\u0441\u043a\u0430\u0436\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043a\u0440\u0430\u0442\u043a\u043e:<\/p>\n<ol>\n<li>\n<p>\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u043e\u043f\u043e\u0440\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442. \u0421\u0430\u043c\u044b\u0439 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0441\u0442\u043e\u043b\u0431\u0446\u0435 k. \u041c\u0435\u0442\u043e\u0434:pivoting<\/p>\n<\/li>\n<li>\n<p>\u041c\u0435\u043d\u044f\u0435\u043c \u043e\u043f\u043e\u0440\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439<\/p>\n<\/li>\n<li>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0438 L(\u043d\u0438\u0436\u043d\u044f\u044f \u0447\u0430\u0441\u0442\u044c \u043c\u0430\u0442\u0440\u0438\u0446\u044b) \u0438 U(\u0432\u0435\u0440\u0445\u043d\u044f\u044f \u0447\u0430\u0441\u0442\u044c \u043c\u0430\u0442\u0440\u0438\u0446\u044b), \u043c\u0435\u0442\u043e\u0434: elimination<\/p>\n<\/li>\n<\/ol>\n<p><img decoding=\"async\" class=\"formula\" source=\"L_{i,k} = A_{i,k}\/A_{k,k}\" alt=\"L_{i,k} = A_{i,k}\/A_{k,k}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/3c\/3c9\/3c9b4b5aa22e3b3184432b5e875df9ee.svg\" width=\"120\" height=\"16\" data-width=\"15.418\" data-height=\"2.347\" data-vertical-align=\"-0.65\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/3c\/3c9\/3c9b4b5aa22e3b3184432b5e875df9ee.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/3c\/3c9\/3c9b4b5aa22e3b3184432b5e875df9ee.svg 781w\" loading=\"lazy\" decode=\"async\"\/><img decoding=\"async\" class=\"formula\" source=\"U_{i,j} = U_{i,j} - L_{i,k} * U_{k,j}\" alt=\"U_{i,j} = U_{i,j} - L_{i,k} * U_{k,j}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6\/62\/628\/628c7e771c5e84ffc58d7ff9f5318edd.svg\" width=\"168\" height=\"16\" data-width=\"21.926\" data-height=\"2.211\" data-vertical-align=\"-0.666\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6\/62\/628\/628c7e771c5e84ffc58d7ff9f5318edd.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6\/62\/628\/628c7e771c5e84ffc58d7ff9f5318edd.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<ol start=\"4\">\n<li>\n<p>\u0422\u0430\u043c \u0436\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f signP \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u0442\u0440\u0438\u0446\u044b U \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0437\u043d\u0430\u043a\u0430 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u043a \u0433\u0434\u0435 signP \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f 1 \u0438\u043b\u0438 -1 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0447\u0451\u0442\u043d\u043e\u0441\u0442\u0438 \u0447\u0438\u0441\u043b\u0430 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u043a \u0441\u0442\u0440\u043e\u043a.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"cpp\">  template&lt;typename T, typename MatrixType&gt;    void LU&lt;T, MatrixType&gt;::decomposition() {        if (matrix.getRows() != matrix.getCols())        throw std::runtime_error(\"Matrix must be square for LU decomposition\");        int n = matrix.getRows();        initP();        for (int k = 0; k &lt; n; ++k) {            int pivot = pivoting(k);            if(pivot != k) {                for (int j = 0; j &lt; n; j++) {                    std::swap(matrix(k,j), matrix(pivot,j));                }                                std::swap(P[k], P[pivot]);                signP = -signP;            }            if (std::abs(matrix(k,k)) &lt;= eps) {                throw std::runtime_error(\"Matrix is singular or nearly singular at pivot \" + std::to_string(k));            }            elimination(k);        }    }<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h3>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h3>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e. <img decoding=\"async\" class=\"formula inline\" source=\"PA=LU\" alt=\"PA=LU\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/83\/83a\/83a4c70c7ff4762d47dceca183cc7a4b.svg\" width=\"72\" height=\"12\" data-width=\"9.689\" data-height=\"1.805\" data-vertical-align=\"-0.186\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/83\/83a\/83a4c70c7ff4762d47dceca183cc7a4b.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/83\/83a\/83a4c70c7ff4762d47dceca183cc7a4b.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 PA. \u041a\u0430\u0436\u0434\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0435\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0431\u0435\u0440\u0451\u0442\u0441\u044f \u0438\u0437 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0432\u0435\u043a\u0442\u043e\u0440\u0443 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u043a:<\/p>\n<p><img decoding=\"async\" class=\"formula\" source=\"PA_{i,j} = A_{P[i],j}\" alt=\"PA_{i,j} = A_{P[i],j}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f\/f1\/f1f\/f1f090992be5f3c75332d5217980c98d.svg\" width=\"104\" height=\"16\" data-width=\"13.888\" data-height=\"2.42\" data-vertical-align=\"-0.8\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f\/f1\/f1f\/f1f090992be5f3c75332d5217980c98d.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f\/f1\/f1f\/f1f090992be5f3c75332d5217980c98d.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u0430\u0442\u0440\u0438\u0446\u0430 PA \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044e \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u0447\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b P \u043d\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u0443\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u0443 A. \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u043c\u0430\u0442\u0440\u0438\u0446\u044b L \u0438 U \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b. \u0418 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 LU \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 PA.<\/p>\n<pre><code class=\"cpp\">TEST_F(LU_Inplace_Test,decomposition) {    FlatMatrix&lt;double&gt;exp = {        {6, 3, 4},        {5.0\/6, -4.5, -19.0\/3},        {1.0\/3, -8.0\/9, 1.0\/27}    };    std::vector&lt;int&gt; P = lu-&gt;getP();    int n = A.getRows();    FlatMatrix&lt;double&gt; PA = A;    for (int i = 0; i &lt; n; i++) {        for(int j = 0; j &lt; n; j++) {            PA(i,j) = A(P[i],j);        }    }    auto m = std::move(lu-&gt;getMatrix());    auto L = extractL&lt;double&gt;(m);    auto U = extractU&lt;double&gt;(m);    auto LUproduct = L*U;    compare&lt;double, FlatMatrix&lt;double&gt;&gt;(PA,LUproduct);}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h2>\u041e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043c\u0430\u0442\u0440\u0438\u0446<\/h2>\n<p>\u041e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u043c\u043e\u0436\u043d\u043e \u0441\u0432\u0435\u0441\u0442\u0438 \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b AX=I. \u041f\u043e\u0441\u043b\u0435 \u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438 LU \u0432\u0438\u0434\u0430 PA=LU \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430. \u041a\u0430\u0436\u0434\u044b\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u043f\u0440\u044f\u043c\u043e\u0439(<img decoding=\"async\" class=\"formula inline\" source=\"L*y=b\" alt=\"L*y=b\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/39\/396\/3961f279f39cd58c32467c27ee654023.svg\" width=\"64\" height=\"16\" data-width=\"8.774\" data-height=\"2.034\" data-vertical-align=\"-0.464\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/39\/396\/3961f279f39cd58c32467c27ee654023.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/39\/396\/3961f279f39cd58c32467c27ee654023.svg 781w\" loading=\"lazy\" decode=\"async\"\/>) \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439(<img decoding=\"async\" class=\"formula inline\" source=\"U*x=y\" alt=\"U*x=y\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6\/65\/654\/654799d980c55dbe44f0f49ffa2b4b6f.svg\" width=\"72\" height=\"16\" data-width=\"9.292\" data-height=\"2.009\" data-vertical-align=\"-0.464\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6\/65\/654\/654799d980c55dbe44f0f49ffa2b4b6f.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6\/65\/654\/654799d980c55dbe44f0f49ffa2b4b6f.svg 781w\" loading=\"lazy\" decode=\"async\"\/>) \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438. \u0414\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 <img decoding=\"async\" class=\"formula inline\" source=\"L_{ii}\" alt=\"L_{ii}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/2\/29\/296\/2962178ecbd2ed907be2fe859daa5679.svg\" width=\"16\" height=\"12\" data-width=\"2.832\" data-height=\"1.902\" data-vertical-align=\"-0.357\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/2\/29\/296\/2962178ecbd2ed907be2fe859daa5679.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/2\/29\/296\/2962178ecbd2ed907be2fe859daa5679.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u043d\u0435\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u044c \u0432 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0435 \u0440\u0430\u0432\u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0435.<\/p>\n<h3>\u041f\u0440\u044f\u043c\u0430\u044f \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430<\/h3>\n<p><img decoding=\"async\" class=\"formula\" source=\"y_{i} = b_{i} - \\sum_{j=0}^{i-1}(L_{ij}*y_{j})\" alt=\"y_{i} = b_{i} - \\sum_{j=0}^{i-1}(L_{ij}*y_{j})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b\/b3\/b35\/b35b9653ec0f319ffbe15f685e6b9167.svg\" width=\"168\" height=\"48\" data-width=\"21.4\" data-height=\"6.908\" data-vertical-align=\"-2.888\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b\/b3\/b35\/b35b9653ec0f319ffbe15f685e6b9167.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b\/b3\/b35\/b35b9653ec0f319ffbe15f685e6b9167.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<p>L \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e \u043d\u0438\u0436\u043d\u0438\u0439 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a \u043c\u0430\u0442\u0440\u0438\u0446\u044b. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <img decoding=\"async\" class=\"formula inline\" source=\"b\" alt=\"b\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/92\/92e\/92eb5ffee6ae2fec3ad71c777531578f.svg\" width=\"12\" height=\"12\" data-width=\"0.971\" data-height=\"1.595\" data-vertical-align=\"-0.025\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/92\/92e\/92eb5ffee6ae2fec3ad71c777531578f.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/92\/92e\/92eb5ffee6ae2fec3ad71c777531578f.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u044d\u0442\u043e \u0432\u0435\u043a\u0442\u043e\u0440 \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b <img decoding=\"async\" class=\"formula inline\" source=\"e_{P^{-1}(i)}\" alt=\"e_{P^{-1}(i)}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6\/67\/67b\/67b8678ce867dad639a11fb91207b727.svg\" width=\"40\" height=\"12\" data-width=\"5.907\" data-height=\"1.816\" data-vertical-align=\"-0.816\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6\/67\/67b\/67b8678ce867dad639a11fb91207b727.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6\/67\/67b\/67b8678ce867dad639a11fb91207b727.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0433\u0434\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 <img decoding=\"async\" class=\"formula inline\" source=\"(P^{-1})_{i}\" alt=\"(P^{-1})_{i}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f\/f3\/f35\/f35a71d5c4c023c29196cd130e8facca.svg\" width=\"48\" height=\"16\" data-width=\"6.557\" data-height=\"2.565\" data-vertical-align=\"-0.566\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f\/f3\/f35\/f35a71d5c4c023c29196cd130e8facca.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f\/f3\/f35\/f35a71d5c4c023c29196cd130e8facca.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u043e\u0434 \u043d\u043e\u0432\u044b\u0439 \u0432\u0435\u043a\u0442\u043e\u0440 b \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0448\u0430\u0433\u0435, \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0432 \u043c\u0435\u0442\u043e\u0434 \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0441 \u0435\u0434\u0438\u043d\u0438\u0446\u0435\u0439 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u0435 b.<\/p>\n<p>\u041c\u0435\u0442\u043e\u0434 \u043f\u0440\u044f\u043c\u043e\u0439 \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b:<\/p>\n<pre><code class=\"cpp\">    void forwardSubstitution(std::vector&lt;T&gt;&amp; y, int b_pos) const;<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041c\u0435\u0442\u043e\u0434 \u043f\u0440\u044f\u043c\u043e\u0439 \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439:<\/p>\n<pre><code class=\"cpp\">    void forwardSubstitution(std::vector&lt;T&gt;&amp; y, const std::vector&lt;T&gt;&amp; b) const;<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h3>\u041e\u0431\u0440\u0430\u0442\u043d\u0430\u044f \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430:<\/h3>\n<p><img decoding=\"async\" class=\"formula\" source=\"x_{i} = \\frac{        y_{i} - \\sum_{j=i+1}^{n-1}U_{ij}*x_{j}    }{        U_{ii}    }\" alt=\"x_{i} = \\frac{        y_{i} - \\sum_{j=i+1}^{n-1}U_{ij}*x_{j}    }{        U_{ii}    }\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f\/fb\/fb8\/fb83bf522e9aa33bd2e4426eef5a2a29.svg\" width=\"200\" height=\"48\" data-width=\"25.336\" data-height=\"6.066\" data-vertical-align=\"-2.468\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f\/fb\/fb8\/fb83bf522e9aa33bd2e4426eef5a2a29.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f\/fb\/fb8\/fb83bf522e9aa33bd2e4426eef5a2a29.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<p>U \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e \u0432\u0435\u0440\u0445\u043d\u0438\u0439 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a \u043c\u0430\u0442\u0440\u0438\u0446\u044b. \u041c\u0435\u0442\u043e\u0434 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438:<\/p>\n<pre><code class=\"cpp\">void backwardSubstitution(std::vector&lt;T&gt;&amp; x, const std::vector&lt;T&gt;&amp; y, int n) const;<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041c\u0435\u0442\u043e\u0434 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 LU \u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438:<\/p>\n<pre><code class=\"cpp\">   template&lt;typename T, typename MatrixType&gt;    MatrixType LU&lt;T, MatrixType&gt;::inv() const {        int n = matrix.getRows();        MatrixType X(n,n);        std::vector&lt;int&gt; invP = initInvP();        std::vector&lt;T&gt;  y(n), x(n);        for(int i = 0; i &lt; n; ++i) {            int b_pos = invP[i];            forwardSubstitution(y, b_pos, n);            backwardSubstitution(x, y, n);            for (int k = 0; k &lt; n; ++k) {                X(k,i) = x[k];            }        }        return X;    }<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h2>\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f LU<\/h2>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0431\u044b\u043b\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0431\u044b\u043b\u0430 \u043d\u0430 2D \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u0445 \u0441 \u0440\u0430\u0437\u0434\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043c\u0430\u0442\u0440\u0438\u0446\u0430\u043c\u0438 L U. \u0426\u0435\u043b\u044c \u0432\u044b\u0431\u043e\u0440\u0430 2D \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0442\u0440\u0438\u0446 L \u0438 U \u0431\u044b\u043b\u0430 \u0432 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u044b\u043c \u0441 \u044f\u0432\u043d\u044b\u043c\u0438 \u0448\u0430\u0433\u0430\u043c\u0438 \u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0438. \u041d\u043e \u0432 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434. \u0412 \u0445\u043e\u0434\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u044b\u043b \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043a \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044e \u0432 \u043f\u043b\u043e\u0441\u043a\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u0435 \u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044e L \u0438 U \u0432 \u043e\u0434\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u0435.<\/p>\n<p>\u0411\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438 \u0431\u044b\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u044b \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445:<\/p>\n<p>\u0424\u043b\u0430\u0433\u0438: -O2 -march=native \u041f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440: 12th Gen Intel\u00ae Core\u2122 i5-12450H (2.00 GHz)<\/p>\n<p>\u0420\u0430\u0441\u0447\u0451\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0420\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c \u043c\u0430\u0442\u0440\u0438\u0446\u044b<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0412\u0440\u0435\u043c\u044f 1D (\u0441\u0435\u043a)<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0412\u0440\u0435\u043c\u044f 2D (\u0441\u0435\u043a)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">100<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000496401<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000506527<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">200<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.003534928<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.003630623<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">500<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.05805729<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.060738964<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">1000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.5343732<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.609300800<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">2000<\/p>\n<\/td>\n<td>\n<p align=\"left\">4.9897967<\/p>\n<\/td>\n<td>\n<p align=\"left\">5.809301900<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0412\u044b\u0438\u0433\u0440\u044b\u0448 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439. \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0431\u043b\u043e\u0447\u043d\u0443\u044e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e LU.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0431\u043b\u043e\u0447\u043d\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0438 \u043c\u0430\u0442\u0440\u0438\u0446<\/h3>\n<p>\u0414\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u0430\u043c\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u044d\u0442\u043e \u043c\u0430\u0442\u0440\u0438\u0447\u043d\u043e\u0435 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0420\u0430\u0437\u043c\u0435\u0440 \u043c\u0430\u0442\u0440\u0438\u0446\u044b<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041d\u0430\u0438\u0432\u043d\u043e\u0435 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435(\u0441\u0435\u043a)<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0411\u043b\u043e\u0447\u043d\u043e\u0435 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435(\u0441\u0435\u043a)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">100<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000407549<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000220149<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">200<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.003438727<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.001530490<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">500<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.065543789<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.024170236<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">1000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.729244900<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.193491350<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">2000<\/p>\n<\/td>\n<td>\n<p align=\"left\">24.194000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.546728100<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0431\u044b\u043b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438.<\/p>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435<\/p>\n<pre><code class=\"cmake\">cmake_minimum_required(VERSION 3.14)project(RandomMathApp LANGUAGES CXX)find_package(LinearAlgebra REQUIRED)add_executable(random_math_app main.cpp)target_link_libraries(random_math_app PRIVATE LinearAlgebra::LinearAlgebra)target_compile_features(random_math_app PRIVATE cxx_std_17)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0437\u0430\u0434\u0430\u0447\u0443 \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0438\u0445 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043e\u0432. \u0414\u0430\u043d\u0430 \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 X \u0438 \u0432\u0435\u043a\u0442\u043e\u0440 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439. \u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0435: <img decoding=\"async\" class=\"formula inline\" source=\"B = (X^T X)^{-1} X^T y\" alt=\"B = (X^T X)^{-1} X^T y\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/3c\/3c3\/3c3105179e5ea13e3b1b047863e2f796.svg\" width=\"144\" height=\"16\" data-width=\"18.478\" data-height=\"2.583\" data-vertical-align=\"-0.566\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/3c\/3c3\/3c3105179e5ea13e3b1b047863e2f796.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/3c\/3c3\/3c3105179e5ea13e3b1b047863e2f796.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b XTX \u0441 \u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0435\u0439 LU. \u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"cpp\">#include &lt;iostream&gt;#include &lt;decompose\/LU\/LU.hpp&gt;#include &lt;matrix\/FlatMatrix.hpp&gt;#include &lt;decompose\/LU\/Inversion.hpp&gt;#include &lt;memory&gt;int main() {    using namespace LinearAlgebra;        FlatMatrix&lt;double&gt; X = {        {1,1},        {1,2},        {1,3},        {1,4}    };    ColumnVector&lt;double&gt; y = {2,4,5,7};    auto XT = ~X;    auto XTX = XT*X;    auto XTy = XT*y;    auto lu = LU&lt;double,FlatMatrix&lt;double&gt;&gt;(std::move(XTX));    auto Xinv = lu.inv();        auto B = Xinv * XTy;       std::cout &lt;&lt; \"Input data:\\n\";    std::cout &lt;&lt; \"X: \" &lt;&lt; X &lt;&lt; \"\\n\";    std::cout &lt;&lt; \"y:\" &lt;&lt; std::endl;    for (int i = 0; i &lt; y.size(); i++)    {        std::cout&lt;&lt;y[i]&lt;&lt;\"\\n\";    }    std::cout &lt;&lt; std::endl;    std::cout &lt;&lt; \"Computing linear regression coefficients \"            &lt;&lt; \"B0 and B1 using the least squares method B = (X^T X)^-1 X^T y:\\n\";    std::cout &lt;&lt; \"B0 = \" &lt;&lt; B[0] &lt;&lt; \"\\n\";    std::cout &lt;&lt; \"B1 = \" &lt;&lt; B[1] &lt;&lt; std::endl;}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h3>\u0427\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c<\/h3>\n<pre><code>- \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0439(QR,SVD)- \u041f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e- \u0421\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h3>\u0412\u044b\u0432\u043e\u0434<\/h3>\n<p>\u0412 \u0445\u043e\u0434\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u044b\u043b\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0430\u043b\u0433\u0435\u0431\u0440\u044b \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 LU-\u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\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, \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f \u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043c\u0430\u0442\u0440\u0438\u0446.<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0435 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u043f\u043b\u043e\u0441\u043a\u043e\u0435 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043c\u0430\u0442\u0440\u0438\u0446 L \u0438 U \u0432 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0434\u0430\u0451\u0442 \u043b\u0438\u0448\u044c \u0443\u043c\u0435\u0440\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u0440\u043e\u0441\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0412 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0431\u043b\u043e\u0447\u043d\u043e\u0433\u043e \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0442, \u0447\u0442\u043e \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043a\u044d\u0448-\u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430, \u043c\u043e\u0433\u0443\u0442 \u0434\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u044d\u0444\u0444\u0435\u043a\u0442.<\/p>\n<p>\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438, \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b \u0433\u043b\u0443\u0431\u0436\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432, \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043d\u0430 C++ \u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u0445 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<h3>\u0421\u0441\u044b\u043b\u043a\u0438<\/h3>\n<p>\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439: <a href=\"https:\/\/github.com\/web-dev137\/linear-library\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/web-dev137\/linear-library<\/a><\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f: <a href=\"https:\/\/github.com\/web-dev137\/random-math-app\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/web-dev137\/random-math-app<\/a><\/p>\n<\/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=\"https:\/\/habr.com\/ru\/articles\/1051974\/\">https:\/\/habr.com\/ru\/articles\/1051974\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u041e\u0434\u043d\u0430\u0436\u0434\u044b \u043c\u0435\u043d\u044f \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0441\u0432\u043e\u0435\u043c \u043e\u043f\u044b\u0442\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432. \u0422\u0430\u043a \u043a\u0430\u043a \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0438\u0439 \u043e\u043f\u044b\u0442 \u0443 \u043c\u0435\u043d\u044f \u0431\u044b\u043b \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435, \u0442\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u044f \u043c\u043e\u0433 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u0441\u043a\u043e\u043c \u043e\u043f\u044b\u0442\u0435, \u043b\u0438\u0431\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 pet-\u043f\u0440\u043e\u0435\u043a\u0442.\u042f \u0432\u044b\u0431\u0440\u0430\u043b \u0442\u0435\u043c\u0443 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0430\u043b\u0433\u0435\u0431\u0440\u044b.\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u043e \u0434\u0432\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430: \u0441 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c \u043d\u0430 Qt \u043b\u0438\u0431\u043e \u0432 \u0432\u0438\u0434\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 backend-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435. \u042f \u0432\u044b\u0431\u0440\u0430\u043b \u0432\u0442\u043e\u0440\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443.\u0412 \u0445\u043e\u0434\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b:- \u041a\u0430\u043a \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438  \u0438 \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0451 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f?- \u0421\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u0440\u043e\u0441\u0442\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u0451\u0442  \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043e\u0442 2D \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u043a \u043f\u043b\u043e\u0441\u043a\u0438\u043c \u043c\u0430\u0442\u0440\u0438\u0446\u0430\u043c?- \u041a\u0430\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0435\u0441\u0442\u044c?  \u041a\u0430\u043a\u0438\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430?- \u0420\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u0445 \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u0445,  \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c\u044b\u0445 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u0442\u0438\u0445 \u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0439.   \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 LU.\u041f\u0440\u043e\u0435\u043a\u0442 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u0438 \u043d\u0435 \u0441\u0442\u0430\u0432\u0438\u0442 \u0441\u0432\u043e\u0435\u0439 \u0446\u0435\u043b\u044c\u044e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0430 Eigen \u0438\u043b\u0438 Armadillo.\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430\u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432:-   \u0425\u0440\u0430\u043d\u0435\u043d\u0438\u0435 (MatrixBase.hpp,FlatMatrix.hpp)-   \u0414\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044f(LU.hpp)    &#8212; \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 PA = LU    &#8212; \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c Ax = b    &#8212; \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f    &#8212; \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044bLU-\u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044f.\u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 LU-\u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0441 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u043c \u0432\u044b\u0431\u043e\u0440\u043e\u043c \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 (partial pivoting). \u0412 \u0445\u043e\u0434\u0435 \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u0435\u0440\u0445\u043d\u0435-\u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 U \u0438 \u043d\u0438\u0436\u043d\u0435-\u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 L. \u041e\u043d\u0438 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0432 \u043e\u0434\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u0435 (in-place). \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u0442\u0435\u0441\u0442\u0430\u0445, \u0433\u0434\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e PA=LU. \u0412 \u043a\u043b\u0430\u0441\u0441\u0435 \u0435\u0441\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0442\u0438\u043f\u0430\u043c\u0438 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u044f\u0442\u043e\u0439, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u0440\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u0442\u0440\u0438\u0446 U \u0438 L \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0432 \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u0434\u0440\u043e\u0431\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043f\u043e\u0442\u0435\u0440\u0435 \u0434\u0440\u043e\u0431\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0438\u0437-\u0437\u0430 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438, \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u043a \u0438\u0441\u043a\u0430\u0436\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439.\u0415\u0441\u043b\u0438 \u043a\u0440\u0430\u0442\u043a\u043e:\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u043e\u043f\u043e\u0440\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442. \u0421\u0430\u043c\u044b\u0439 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0441\u0442\u043e\u043b\u0431\u0446\u0435 k. \u041c\u0435\u0442\u043e\u0434:pivoting\u041c\u0435\u043d\u044f\u0435\u043c \u043e\u043f\u043e\u0440\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439\u0414\u0430\u043b\u0435\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0438 L(\u043d\u0438\u0436\u043d\u044f\u044f \u0447\u0430\u0441\u0442\u044c \u043c\u0430\u0442\u0440\u0438\u0446\u044b) \u0438 U(\u0432\u0435\u0440\u0445\u043d\u044f\u044f \u0447\u0430\u0441\u0442\u044c \u043c\u0430\u0442\u0440\u0438\u0446\u044b), \u043c\u0435\u0442\u043e\u0434: elimination\u0422\u0430\u043c \u0436\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f signP \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u0442\u0440\u0438\u0446\u044b U \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0437\u043d\u0430\u043a\u0430 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u043a \u0433\u0434\u0435 signP \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f 1 \u0438\u043b\u0438 -1 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0447\u0451\u0442\u043d\u043e\u0441\u0442\u0438 \u0447\u0438\u0441\u043b\u0430 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u043a \u0441\u0442\u0440\u043e\u043a.  template&lt;typename T, typename MatrixType&gt;    void LU&lt;T, MatrixType&gt;::decomposition() {        if (matrix.getRows() != matrix.getCols())        throw std::runtime_error(&#171;Matrix must be square for LU decomposition&#187;);        int n = matrix.getRows();        initP();        for (int k = 0; k &lt; n; ++k) {            int pivot = pivoting(k);            if(pivot != k) {                for (int j = 0; j &lt; n; j++) {                    std::swap(matrix(k,j), matrix(pivot,j));                }                                std::swap(P[k], P[pivot]);                signP = -signP;            }            if (std::abs(matrix(k,k)) &lt;= eps) {                throw std::runtime_error(&#171;Matrix is singular or nearly singular at pivot &#187; + std::to_string(k));            }            elimination(k);        }    }\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e.  \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 PA. \u041a\u0430\u0436\u0434\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0435\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0431\u0435\u0440\u0451\u0442\u0441\u044f \u0438\u0437 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0432\u0435\u043a\u0442\u043e\u0440\u0443 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u043a:\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u0430\u0442\u0440\u0438\u0446\u0430 PA \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044e \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u0447\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b P \u043d\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u0443\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u0443 A. \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u043c\u0430\u0442\u0440\u0438\u0446\u044b L \u0438 U \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b. \u0418 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 LU \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 PA.TEST_F(LU_Inplace_Test,decomposition) {    FlatMatrix&lt;double&gt;exp = {        {6, 3, 4},        {5.0\/6, -4.5, -19.0\/3},        {1.0\/3, -8.0\/9, 1.0\/27}    };    std::vector&lt;int&gt; P = lu-&gt;getP();    int n = A.getRows();    FlatMatrix&lt;double&gt; PA = A;    for (int i = 0; i &lt; n; i++) {        for(int j = 0; j &lt; n; j++) {            PA(i,j) = A(P[i],j);        }    }    auto m = std::move(lu-&gt;getMatrix());    auto L = extractL&lt;double&gt;(m);    auto U = extractU&lt;double&gt;(m);    auto LUproduct = L*U;    compare&lt;double, FlatMatrix&lt;double&gt;&gt;(PA,LUproduct);}\u041e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u041e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u043c\u043e\u0436\u043d\u043e \u0441\u0432\u0435\u0441\u0442\u0438 \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b AX=I. \u041f\u043e\u0441\u043b\u0435 \u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438 LU \u0432\u0438\u0434\u0430 PA=LU \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430. \u041a\u0430\u0436\u0434\u044b\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u043f\u0440\u044f\u043c\u043e\u0439() \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439() \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438. \u0414\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430  \u043d\u0435\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u044c \u0432 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0435 \u0440\u0430\u0432\u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0435.\u041f\u0440\u044f\u043c\u0430\u044f \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430L \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e \u043d\u0438\u0436\u043d\u0438\u0439 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a \u043c\u0430\u0442\u0440\u0438\u0446\u044b. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438  \u044d\u0442\u043e \u0432\u0435\u043a\u0442\u043e\u0440 \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b  \u0433\u0434\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u043e\u0437\u0438\u0446\u0438\u0438  \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u043e\u0434 \u043d\u043e\u0432\u044b\u0439 \u0432\u0435\u043a\u0442\u043e\u0440 b \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0448\u0430\u0433\u0435, \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0432 \u043c\u0435\u0442\u043e\u0434 \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0441 \u0435\u0434\u0438\u043d\u0438\u0446\u0435\u0439 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u0435 b.\u041c\u0435\u0442\u043e\u0434 \u043f\u0440\u044f\u043c\u043e\u0439 \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b:    void forwardSubstitution(std::vector&lt;T&gt;&amp; y, int b_pos) const;\u041c\u0435\u0442\u043e\u0434 \u043f\u0440\u044f\u043c\u043e\u0439 \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439:    void forwardSubstitution(std::vector&lt;T&gt;&amp; y, const std::vector&lt;T&gt;&amp; b) const;\u041e\u0431\u0440\u0430\u0442\u043d\u0430\u044f \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430:U \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e \u0432\u0435\u0440\u0445\u043d\u0438\u0439 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a \u043c\u0430\u0442\u0440\u0438\u0446\u044b. \u041c\u0435\u0442\u043e\u0434 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438:void backwardSubstitution(std::vector&lt;T&gt;&amp; x, const std::vector&lt;T&gt;&amp; y, int n) const;\u041c\u0435\u0442\u043e\u0434 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 LU \u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438:   template&lt;typename T, typename MatrixType&gt;    MatrixType LU&lt;T, MatrixType&gt;::inv() const {        int n = matrix.getRows();        MatrixType X(n,n);        std::vector&lt;int&gt; invP = initInvP();        std::vector&lt;T&gt;  y(n), x(n);        for(int i = 0; i &lt; n; ++i) {            int b_pos = invP[i];            forwardSubstitution(y, b_pos, n);            backwardSubstitution(x, y, n);            for (int k = 0; k &lt; n; ++k) {                X(k,i) = x[k];            }        }        return X;    }\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f LU\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0431\u044b\u043b\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0431\u044b\u043b\u0430 \u043d\u0430 2D \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u0445 \u0441 \u0440\u0430\u0437\u0434\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043c\u0430\u0442\u0440\u0438\u0446\u0430\u043c\u0438 L U. \u0426\u0435\u043b\u044c \u0432\u044b\u0431\u043e\u0440\u0430 2D \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0442\u0440\u0438\u0446 L \u0438 U \u0431\u044b\u043b\u0430 \u0432 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u044b\u043c \u0441 \u044f\u0432\u043d\u044b\u043c\u0438 \u0448\u0430\u0433\u0430\u043c\u0438 \u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0438. \u041d\u043e \u0432 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434. \u0412 \u0445\u043e\u0434\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u044b\u043b \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043a \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044e \u0432 \u043f\u043b\u043e\u0441\u043a\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u0435 \u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044e L \u0438 U \u0432 \u043e\u0434\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u0435.\u0411\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438 \u0431\u044b\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u044b \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445:\u0424\u043b\u0430\u0433\u0438: -O2 -march=native \u041f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440: 12th Gen Intel\u00ae Core\u2122 i5-12450H (2.00 GHz)\u0420\u0430\u0441\u0447\u0451\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b\u0420\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c \u043c\u0430\u0442\u0440\u0438\u0446\u044b\u0412\u0440\u0435\u043c\u044f 1D (\u0441\u0435\u043a)\u0412\u0440\u0435\u043c\u044f 2D (\u0441\u0435\u043a)1000.0004964010.0005065272000.0035349280.0036306235000.058057290.06073896410000.53437320.60930080020004.98979675.809301900\u0412\u044b\u0438\u0433\u0440\u044b\u0448 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439. \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0431\u043b\u043e\u0447\u043d\u0443\u044e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e LU.\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0431\u043b\u043e\u0447\u043d\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0438 \u043c\u0430\u0442\u0440\u0438\u0446\u0414\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u0430\u043c\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u044d\u0442\u043e \u043c\u0430\u0442\u0440\u0438\u0447\u043d\u043e\u0435 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435.\u0420\u0430\u0437\u043c\u0435\u0440 \u043c\u0430\u0442\u0440\u0438\u0446\u044b\u041d\u0430\u0438\u0432\u043d\u043e\u0435 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435(\u0441\u0435\u043a)\u0411\u043b\u043e\u0447\u043d\u043e\u0435 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435(\u0441\u0435\u043a)1000.0004075490.0002201492000.0034387270.0015304905000.0655437890.02417023610000.7292449000.193491350200024.1940000001.546728100\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f.\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0431\u044b\u043b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438.\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435cmake_minimum_required(VERSION 3.14)project(RandomMathApp LANGUAGES CXX)find_package(LinearAlgebra REQUIRED)add_executable(random_math_app main.cpp)target_link_libraries(random_math_app PRIVATE LinearAlgebra::LinearAlgebra)target_compile_features(random_math_app PRIVATE cxx_std_17)\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0437\u0430\u0434\u0430\u0447\u0443 \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0438\u0445 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043e\u0432. \u0414\u0430\u043d\u0430 \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 X \u0438 \u0432\u0435\u043a\u0442\u043e\u0440 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439. \u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0435:  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b XTX \u0441 \u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0435\u0439 LU. \u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430:#include &lt;iostream&gt;#include &lt;decompose\/LU\/LU.hpp&gt;#include &lt;matrix\/FlatMatrix.hpp&gt;#include &lt;decompose\/LU\/Inversion.hpp&gt;#include &lt;memory&gt;int main() {    using namespace LinearAlgebra;        FlatMatrix&lt;double&gt; X = {        {1,1},        {1,2},        {1,3},        {1,4}    };    ColumnVector&lt;double&gt; y = {2,4,5,7};    auto XT = ~X;    auto XTX = XT*X;    auto XTy = XT*y;    auto lu = LU&lt;double,FlatMatrix&lt;double&gt;&gt;(std::move(XTX));    auto Xinv = lu.inv();        auto B = Xinv * XTy;       std::cout &lt;&lt; &#171;Input data:\\n&#187;;    std::cout &lt;&lt; &#171;X: &#187; &lt;&lt; X &lt;&lt; &#171;\\n&#187;;    std::cout &lt;&lt; &#171;y:&#187; &lt;&lt; std::endl;    for (int i = 0; i &lt; y.size(); i++)    {        std::cout&lt;&lt;y[i]&lt;&lt;&#171;\\n&#187;;    }    std::cout &lt;&lt; std::endl;    std::cout &lt;&lt; &#171;Computing linear regression coefficients &#187;            &lt;&lt; &#171;B0 and B1 using the least squares method B = (X^T X)^-1 X^T y:\\n&#187;;    std::cout &lt;&lt; &#171;B0 = &#187; &lt;&lt; B[0] &lt;&lt; &#171;\\n&#187;;    std::cout &lt;&lt; &#171;B1 = &#187; &lt;&lt; B[1] &lt;&lt; std::endl;}\u0427\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c- \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0439(QR,SVD)- \u041f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e- \u0421\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443\u0412\u044b\u0432\u043e\u0434\u0412 \u0445\u043e\u0434\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u044b\u043b\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0430\u043b\u0433\u0435\u0431\u0440\u044b \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 LU-\u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\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, \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f \u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043c\u0430\u0442\u0440\u0438\u0446.\u041f\u0440\u043e\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0435 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u043f\u043b\u043e\u0441\u043a\u043e\u0435 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043c\u0430\u0442\u0440\u0438\u0446 L \u0438 U \u0432 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0434\u0430\u0451\u0442 \u043b\u0438\u0448\u044c \u0443\u043c\u0435\u0440\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u0440\u043e\u0441\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0412 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0431\u043b\u043e\u0447\u043d\u043e\u0433\u043e \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0442, \u0447\u0442\u043e \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043a\u044d\u0448-\u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430, \u043c\u043e\u0433\u0443\u0442 \u0434\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u044d\u0444\u0444\u0435\u043a\u0442.\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438, \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b \u0433\u043b\u0443\u0431\u0436\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432, \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043d\u0430 C++ \u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u0445 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.\u0421\u0441\u044b\u043b\u043a\u0438\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439: https:\/\/github.com\/web-dev137\/linear-library\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f: https:\/\/github.com\/web-dev137\/random-math-app\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 https:\/\/habr.com\/ru\/articles\/1051974\/<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-485044","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/485044","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=485044"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/485044\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=485044"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=485044"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=485044"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}