当前位置:网站首页>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
边栏推荐
猜你喜欢

PXE高效批量网络装机

04-packing and unpacking

Rapidly develop GraphScope graph analysis applications

Rodrigues:旋转矩阵的向量表达

OP tokens and non-transferable NFTs work to build a new digital democracy

Linx常见目录&文件管理命令&VI编辑器使用 介绍

从 Vertex 到 Subgraph 再到 PIE: 并行图计算编程模型概览

使用Apifox测试套件自动化测试接口

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

libgrape-lite: 提供 GraphScope 的图分析能力
随机推荐
测开基础知识01
Devops基本概念和原理
libgrape-lite on GPUs:GPU助力加速图分析任务
图解关系数据库设计思想,这也太形象了
多线程进阶(锁策略,自旋+CAS,Synchronized,JUC,信号量)
测试开发工程师成长日记010 - Jenkins中的CI/CD/CT(持续集成构建/持续交付/持续测试)
测试开发工程师成长日记015 - 最强20道测试面试题
Required request body is missing 问题解决
Test the basics 02
作为测试leader,考察求职者的几个方面
Advanced multi-threading (lock strategy, spin+CAS, Synchronized, JUC, semaphore)
测试开发工程师成长日记001 - 敏捷测试、CI/CD/CT、DecOps的一些介绍
Event Delivery and Responder Chains
Vineyard: 开源分布式内存数据管理框架
软件测试开发:发送第一封测试报告邮件
彻底删除openstack中镜像的记录
软件测试术语 - 场景测试
向量的导数运算和向量叉乘以及点乘的导数运算
prometheus-basic_auth加密配置
测试开发工程师成长日记008 - 浅谈一些Bug/用例管理平台/协作平台