当前位置:网站首页>矩阵的行列式的计算及其源码
矩阵的行列式的计算及其源码
2022-07-30 05:49:00 【夕阳染色的坡道】
维基百科的定义:
行列式(Determinant),记作 d e t ( A ) det(\bm{A}) det(A)或者 ∣ A ∣ |\bm{A}| ∣A∣,它是矩阵上计算得到的标量。定义如下:
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}上置换的全体,即集合 { 1 , 2 , 3 , . . . , n } \begin{Bmatrix} 1,2,3,...,n\end{Bmatrix} { 1,2,3,...,n}到自身上的一一映射(双射)的全体; ∑ σ ∈ S n \sum_{\sigma \in \bm{S}_n} ∑σ∈Sn表示对 S n \bm{S}_n Sn全部元素的求和,即如果每个 σ ∈ 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)就在加法中出现一次;对每一个满足 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 σ∈Sn的符号差,具体说,如果满足 1 ≤ i , j ≤ n 1 \le i, j \le n 1≤i,j≤n但是 σ ( i ) > σ ( j ) \sigma(i) \gt \sigma(j) σ(i)>σ(j)的有序数对 ( i , j ) (i,j) (i,j)称为 σ \sigma σ的一个逆序。一个序列有多个逆序,它的数量,可以定义为 N σ N_{\sigma} Nσ。这个符号差满足下面公式:
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σ为奇数)
在日常的空间几何的计算中,遇到的都是 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
代码后续更新补上。
参考资料:
https://zh.m.wikipedia.org/zh-sg/%E8%A1%8C%E5%88%97%E5%BC%8F
边栏推荐
猜你喜欢

How to import matlab data into modelsim simulation

测试开发工程师成长日记016 - 关于提测的那些事

引导过程与服务控制

Multithreading basics (multithreaded memory, security, communication, thread pools and blocking queues)

测试开发工程师成长日记009 - 环境排排站:开发环境、测试环境、生产环境、UAT环境、仿真环境

prometheus监控minio

Advanced multi-threading (lock strategy, spin+CAS, Synchronized, JUC, semaphore)

The Force Plan Microservices | Centralized Configuration Center Config Asymmetric Encryption and Security Management

Test and Development Engineer Growth Diary 009 - Environment Pai Pai Station: Development Environment, Test Environment, Production Environment, UAT Environment, Simulation Environment
测试开发工程师成长日记010 - Jenkins中的CI/CD/CT(持续集成构建/持续交付/持续测试)
随机推荐
GNNLab: A Novel GNN System Based on Spatial Sharing Ideas
com.alibaba.datax.common.exception.DataXException: Code:[ESWriter-03]
如何将matlab数据导入modelsim仿真
libgrape-lite: 提供 GraphScope 的图分析能力
prometheus-basic_auth加密配置
GadgetInspector原理分析
Ingress:从静态图分析到动态图分析
Deploy GraphScope with Helm
Mastering JESD204B (3) – Debugging of AD6676
测试开发工程师成长日记010 - Jenkins中的CI/CD/CT(持续集成构建/持续交付/持续测试)
软件测试开发:发送第一封测试报告邮件
为数字政府构建智能化网络安全管控体系
Rapidly develop GraphScope graph analysis applications
Data types of Redis6
Test Development Engineer Growth Diary 008 - Talking About Some Bugs/Use Case Management Platform/Collaboration Platform
【JVM】线上应用故障排查
matlab机器学习_01
libgrape-lite on GPUs: GPU helps accelerate graph analysis tasks
Alamofire源码分析 - POST请求
From installation to compilation: 10 minutes to teach you to use and develop GraphScope locally