当前位置:网站首页>The calculation of the determinant of the matrix and its source code
The calculation of the determinant of the matrix and its source code
2022-07-30 07:49:00 【sunset stained ramp】
维基百科的定义:
行列式(Determinant),记作 d e t ( A ) det(\bm{A}) det(A)或者 ∣ A ∣ |\bm{A}| ∣A∣,It is a scalar computed on a matrix.定义如下:
d e t ( A ) = ∑ σ ∈ S n s g n ( σ ) ∏ i = 1 n a i , σ ( i ) det(\bm{A}) = \sum_{\sigma \in \bm{S}_n}sgn(\sigma) \prod^{n}_{i=1}a_{i,\sigma(i)} det(A)=σ∈Sn∑sgn(σ)i=1∏nai,σ(i)
其中, S n \bm{S}_n Sn是集合 { 1 , 2 , 3 , . . . , n } \begin{Bmatrix} 1,2,3,...,n\end{Bmatrix} { 1,2,3,...,n}The whole of the replacement,即集合 { 1 , 2 , 3 , . . . , n } \begin{Bmatrix} 1,2,3,...,n\end{Bmatrix} { 1,2,3,...,n}A one-to-one mapping to itself(双射)的全体; ∑ σ ∈ S n \sum_{\sigma \in \bm{S}_n} ∑σ∈Sn表示对 S n \bm{S}_n SnThe sum of all elements,i.e. if each σ ∈ S n \sigma \in \bm{S}_n σ∈Sn出现一次, s g n ( σ ) ∏ i = 1 n a i , σ ( i ) sgn(\sigma) \prod^{n}_{i=1}a_{i,\sigma(i)} sgn(σ)∏i=1nai,σ(i)Just once in the addition;Satisfaction for every one 1 ≤ i , j ≤ n 1 \le i, j \le n 1≤i,j≤n的数据对 ( i , j ) (i,j) (i,j), a i , j a_{i,j} ai,j都是矩阵 A \bm{A} A的第 i i i行,第 j j j列的元素.
s g n ( σ ) sgn(\sigma) sgn(σ)是 σ ∈ S n \sigma \in \bm{S}_n σ∈Snsign difference,具体说,如果满足 1 ≤ i , j ≤ n 1 \le i, j \le n 1≤i,j≤n但是 σ ( i ) > σ ( j ) \sigma(i) \gt \sigma(j) σ(i)>σ(j)an ordered pair of numbers ( i , j ) (i,j) (i,j)称为 σ \sigma σ的一个逆序.A sequence has multiple inversions,它的数量,可以定义为 N σ N_{\sigma} Nσ.This sign difference satisfies the following formula:
s g n ( σ ) = 1 ; ( N σ 为偶数 ) s g n ( σ ) = − 1 ; ( N σ 为奇数 ) sgn(\sigma)=1;(N_{\sigma}为偶数) sgn(\sigma)=-1;(N_{\sigma}为奇数) sgn(σ)=1;(Nσ为偶数)sgn(σ)=−1;(Nσ为奇数)
In the calculation of daily space geometry,遇到的都是 3 × 3 3 \times 3 3×3的矩阵,它可以表示为:
A = [ a 11 a 12 a 13 a 21 a 22 a 23 a 31 a 32 a 33 ] \bm{A}=\begin{bmatrix} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{bmatrix} A=⎣⎡a11a21a31a12a22a32a13a23a33⎦⎤
通过定义,可以简化为如下:
d e t ( A ) = ∣ a 11 a 12 a 13 a 21 a 22 a 23 a 31 a 32 a 33 ∣ = a 11 a 22 a 33 + a 12 a 23 a 31 + a 13 a 21 a 32 − a 13 a 22 a 31 − a 11 a 23 a 32 − a 12 a 21 a 33 det(\bm{A}) = \begin{vmatrix} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{vmatrix}=a_{11}a_{22}a_{33} +a_{12}a_{23}a_{31}+a_{13}a_{21}a_{32}-a_{13}a_{22}a_{31}-a_{11}a_{23}a_{32}-a_{12}a_{21} a_{33} det(A)=∣∣a11a21a31a12a22a32a13a23a33∣∣=a11a22a33+a12a23a31+a13a21a32−a13a22a31−a11a23a32−a12a21a33
The code will be updated later.
参考资料:
https://zh.m.wikipedia.org/zh-sg/%E8%A1%8C%E5%88%97%E5%BC%8F
边栏推荐
- prometheus-basic_auth加密配置
- 用 GraphScope 像 NetworkX 一样做图分析
- Test Development Engineer Growth Diary 015 - Top 20 Test Interview Questions
- proftpd 配置文件说明
- Test Development Engineer Growth Diary 007 - Bug Priority Definition and Filling Specifications
- Selenium01
- 舒尔补(schur completement)
- How to create a shortcut without the "shortcut" suffix?
- Mastering JESD204B (2) – Debugging of AD6676
- 软件测试_01
猜你喜欢

prometheus监控minio

Mastering JESD204B (3) – Debugging of AD6676

Network Protocol 01 - Basic Concepts

Test development engineer growth diary 016 - those things about the test

Ingress:从静态图分析到动态图分析

Mastering JESD204B (1) – Debugging of AD6676

Network Protocol 04 - Physical and Data Link Layers

Linx common directory & file management commands & VI editor usage introduction

Vineyard: An open source distributed in-memory data management framework

Distance calculation from space vertex to straight line and its source code
随机推荐
Dachang's annual salary of 50w+ recruits test engineers with test platform development capabilities
How to create a shortcut without the "shortcut" suffix?
图解关系数据库设计思想,这也太形象了
idea内置翻译插件
Build an intelligent network security management and control system for digital government
使用 Helm 部署 GraphScope
debian problem
prometheus-basic_auth加密配置
Selenium01
Redis下载与安装
软件测试_01
GadgetInspector principle analysis
libgrape-lite: 提供 GraphScope 的图分析能力
测试开发工程师成长日记015 - 最强20道测试面试题
Selenium02
STL源码剖析:迭代器的概念理解,以及代码测试。
阿里一面:多线程顺序运行有多少种方法?
Event Delivery and Responder Chains
黑盒测试的概念及测试方法
用 GraphScope 像 NetworkX 一样做图分析