Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

二次型模块 #61

Open
HelloMrGeorge opened this issue Dec 4, 2021 · 0 comments
Open

二次型模块 #61

HelloMrGeorge opened this issue Dec 4, 2021 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@HelloMrGeorge
Copy link
Owner

HelloMrGeorge commented Dec 4, 2021

二次型模块 quad

class QuadSolver

Source: lam/quad/quadratic.py


二次型模块求解器,用于求二次型的标准型

QuadSolver(mat: MutableDenseMatrix)

用矩阵对象构造一个求解器。矩阵必须是对称矩阵,否则不能化标准型

Parameter

  • mat: MutableDenseMatrix

get_standardFrom()

返回矩阵的标准型,即矩阵对应二次型的标准型。

Return: MutableDenseMatrix


get_course()

返回化矩阵的标准型的过程。

Return: List[Tuple[MutableDenseMatrix, MutableDenseMatrix]]

以下面的过程的为例,如果公式不能正常显示,请下载documentation文件夹中对应名字的文档查看。

$
A_0 = \left[\begin{matrix}1 & 3 & 4 & 6\3 & 2 & 3 & 0\4 & 3 & 7 & 8\6 & 0 & 8 & 10\end{matrix}\right]
$


$
T_1 = \left[\begin{matrix}1 & -3 & -4 & -6\0 & 1 & 0 & 0\0 & 0 & 1 & 0\0 & 0 & 0 & 1\end{matrix}\right],
$
配平方项得
$
A_1 = T_1'A_0T_1 = \left[\begin{matrix}1 & 0 & 0 & 0\0 & -7 & -9 & -18\0 & -9 & -9 & -16\0 & -18 & -16 & -26\end{matrix}\right]
$


$
T_2 = \left[\begin{matrix}1 & 0 & 0 & 0\0 & 1 & - \frac{9}{7} & - \frac{18}{7}\0 & 0 & 1 & 0\0 & 0 & 0 & 1\end{matrix}\right],
$
配平方项得
$
A_2 = T_2'A_1T_2 = \left[\begin{matrix}1 & 0 & 0 & 0\0 & -7 & 0 & 0\0 & 0 & \frac{18}{7} & \frac{50}{7}\0 & 0 & \frac{50}{7} & \frac{142}{7}\end{matrix}\right]
$


$
T_3 = \left[\begin{matrix}1 & 0 & 0 & 0\0 & 1 & 0 & 0\0 & 0 & 1 & - \frac{25}{9}\0 & 0 & 0 & 1\end{matrix}\right],
$
配平方项得
$
A_3 = T_3'A_2T_3 = \left[\begin{matrix}1 & 0 & 0 & 0\0 & -7 & 0 & 0\0 & 0 & \frac{18}{7} & 0\0 & 0 & 0 & \frac{4}{9}\end{matrix}\right]
$

get_course()将返回一个列表,列表中的每个元素都是元组,元组中有两个元素分别是变数矩阵T和结果矩阵A。按上面的例子,返回值可以表示为[($T_1$, $A_1$), ($T_2$, $A_2$), ($T_3$, $A_3$)]

@HelloMrGeorge HelloMrGeorge changed the title 二次型模块概述 二次型模块 Jan 8, 2022
@HelloMrGeorge HelloMrGeorge added documentation Improvements or additions to documentation enhancement New feature or request labels Jan 8, 2022
@HelloMrGeorge HelloMrGeorge self-assigned this Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant