当前位置: 首页 > news >正文

企业门户网站功能描述搜狗网站排名软件

企业门户网站功能描述,搜狗网站排名软件,mysql 连接wordpress,学做网站需要哪几本书线性代数 线性代数(如矩阵乘法、矩阵分解、行列式以及其他方阵数学等)是任何数组库的重要组成部分,NumPy中实现了线性代数中常用的各种操作,并形成了numpy.linalg线性代数相关的模块。本节主要介绍如下函数: diag&am…

线性代数

线性代数(如矩阵乘法、矩阵分解、行列式以及其他方阵数学等)是任何数组库的重要组成部分,NumPy中实现了线性代数中常用的各种操作,并形成了numpy.linalg线性代数相关的模块。本节主要介绍如下函数:

  • diag:以一维数组的形式返回方阵的对角线(或非对角线)元素,或将一维数组转换为方阵(非对角线元素为0)。
  • dot:矩阵乘法。
  • trace:计算对角线元素的和。
  • det:计算矩阵行列式。
  • eig:计算方阵的特征值和特征向量。
  • inv:计算方阵的逆。

向量与矩阵:

矩阵:有多行多列元素组成的一个集合,一个m*n的矩阵,有m行n列个元素

向量:如果一个矩阵只有一列,那么就是一个列向量;如果只有一行,那么就是一个行向量

从某个角度来说,矩阵就是由多个向量组成的

矩阵相乘:

A矩阵:m行

B矩阵:n列

前提:m=n

C矩阵:AB乘积

  • 乘积C的第m行、n列 = 矩阵A的第m行的元素与矩阵B第n列元素的乘积之和
# 矩阵相乘
a = np.arange(12)
b = a.reshape([3, 4])
c = a.reshape([4, 3])
# 矩阵b的第二维大小,必须等于矩阵c的第一维大小
d = b.dot(c) # 等价于 np.dot(b, c)
print('a: \n{}'.format(a))
print('b: \n{}'.format(b))
print('c: \n{}'.format(c))
print('d: \n{}'.format(d))

a:
[ 0 1 2 3 4 5 6 7 8 9 10 11]
b:
[[ 0 1 2 3]
[ 4 5 6 7]
[ 8 9 10 11]]
c:
[[ 0 1 2]
[ 3 4 5]
[ 6 7 8]
[ 9 10 11]]
d:
[[ 42 48 54]
[114 136 158]
[186 224 262]]

# numpy.linalg  中有一组标准的矩阵分解运算以及诸如求逆和行列式之类的东西
# np.linalg.diag 以一维数组的形式返回方阵的对角线(或非对角线)元素,
# 或将一维数组转换为方阵(非对角线元素为0)
e = np.diag(d)
f = np.diag(e)
print('d: \n{}'.format(d))
print('e: \n{}'.format(e))
print('f: \n{}'.format(f))

d:
[[ 42 48 54]
[114 136 158]
[186 224 262]]
e:
[ 42 136 262]
f:
[[ 42 0 0]
[ 0 136 0]
[ 0 0 262]]

# trace, 计算对角线元素的和
g = np.trace(d)
g

440

# det,计算行列式
h = np.linalg.det(d)
h

1.3642420526593978e-11

# eig,计算特征值和特征向量
i = np.linalg.eig(d)
i

(array([4.36702561e+02, 3.29743887e+00, 3.13152204e-14]), array([[ 0.17716392, 0.77712552, 0.40824829], [ 0.5095763 , 0.07620532, -0.81649658], [ 0.84198868, -0.62471488, 0.40824829]]))

# inv,计算方阵的逆
tmp = np.random.rand(3, 3)
j = np.linalg.inv(tmp)
j

array([[-0.59449952, 1.39735912, -0.06654123], [ 1.56034184, -0.40734618, -0.48055062], [ 0.10659811, -0.62164179, 1.30437759]])

补充:矩阵的逆

矩阵的逆是指对于一个n维的矩阵A,存在一个n维的矩阵B,使得A乘以B等于单位矩阵E,即AB=BA=E。其逆矩阵求解方法,有以下几种:

伴随矩阵法: 伴随矩阵法是求解矩阵逆的一种方法。对于一个n维矩阵A,其逆矩阵可以用下式表示:A^(-1)=1/|A| * Adj(A),其中|A|表示A的行列式,Adj(A)表示A的伴随矩阵。伴随矩阵的求法是:先求出矩阵A的代数余子式,然后将其转置得到的矩阵即为伴随矩阵。

初等变换法: 初等变换法是求解矩阵逆的另一种方法。将待求逆的矩阵A和单位矩阵E按行合并成一个矩阵[A|E],然后对其进行初等变换,直到左边的矩阵变为单位矩阵,右边的矩阵即为所求的逆矩阵。

高斯-约旦消元法: 高斯-约旦消元法也是求解矩阵逆的一种方法。将待求逆的矩阵A和单位矩阵E按列合并成一个矩阵[A|E],然后对其进行高斯-约旦消元,直到左边的矩阵变为单位矩阵,右边的矩阵即为所求的逆矩阵。

分块矩阵法: 分块矩阵法适用于分块矩阵的求逆,即将一个大的矩阵分成多个小的矩阵。其方法是将大矩阵A分成四个小矩阵A11、A12、A21、A22,并根据矩阵分块公式求出逆矩阵。

代码合集

import numpy as npdef func1():a = np.arange(12)b = a.reshape([3, 4])c = a.reshape([4, 3])# 矩阵b的第二维大小,必须等于矩阵c的第一维大小d = b.dot(c)  # 等价于 np.dot(b, c)# np.dot(b, c)print('a: \n{}'.format(a))print('b: \n{}'.format(b))print('c: \n{}'.format(c))print('d: \n{}'.format(d))# numpy.linalg  中有一组标准的矩阵分解运算以及诸如求逆和行列式之类的东西# np.linalg.diag 以一维数组的形式返回方阵的对角线(或非对角线)元素,# 或将一维数组转换为方阵(非对角线元素为0)print("=========linalg test=========")e = np.diag(d)f = np.diag(e)print('d: \n{}'.format(d))print('e: \n{}'.format(e))print('f: \n{}'.format(f))# 计算对角线元素之和g = np.trace(d)print(g)# det,计算行列式h = np.linalg.det(d)print(h)# eig,计算特征值和特征向量i = np.linalg.eig(d)print(i)def func2():# 计算方阵的逆# https://blog.51cto.com/u_15072903/3963066tmp = np.random.rand(3, 3)print(tmp)j = np.linalg.inv(tmp)print(j)print(tmp.dot(j))print(j.dot(tmp))if __name__ == "__main__":# func1()func2()

文章转载自:
http://salinize.c7501.cn
http://unlessened.c7501.cn
http://comprehensibly.c7501.cn
http://torchy.c7501.cn
http://entity.c7501.cn
http://ussuriisk.c7501.cn
http://escalate.c7501.cn
http://yabby.c7501.cn
http://lobtail.c7501.cn
http://veep.c7501.cn
http://dimsighted.c7501.cn
http://prostaglandin.c7501.cn
http://mca.c7501.cn
http://linerboard.c7501.cn
http://manway.c7501.cn
http://tutor.c7501.cn
http://spearhead.c7501.cn
http://assuredness.c7501.cn
http://azotobacter.c7501.cn
http://cardsharper.c7501.cn
http://ruching.c7501.cn
http://jalor.c7501.cn
http://keyhole.c7501.cn
http://succulency.c7501.cn
http://heuchera.c7501.cn
http://drawstring.c7501.cn
http://oversight.c7501.cn
http://crossopterygian.c7501.cn
http://calices.c7501.cn
http://daydreamer.c7501.cn
http://kicksorter.c7501.cn
http://feedstock.c7501.cn
http://village.c7501.cn
http://practiced.c7501.cn
http://rustiness.c7501.cn
http://cacophonize.c7501.cn
http://nekulturny.c7501.cn
http://prolongable.c7501.cn
http://rimy.c7501.cn
http://antisexist.c7501.cn
http://urinant.c7501.cn
http://columbite.c7501.cn
http://amend.c7501.cn
http://hemipter.c7501.cn
http://balderdash.c7501.cn
http://colbred.c7501.cn
http://wrappage.c7501.cn
http://postnuptial.c7501.cn
http://barreled.c7501.cn
http://lunarscape.c7501.cn
http://synthetic.c7501.cn
http://disintegrator.c7501.cn
http://cannibalistic.c7501.cn
http://snood.c7501.cn
http://gainable.c7501.cn
http://sediment.c7501.cn
http://gibberellin.c7501.cn
http://hyetometer.c7501.cn
http://certainly.c7501.cn
http://viticetum.c7501.cn
http://locomote.c7501.cn
http://unnourishing.c7501.cn
http://logogram.c7501.cn
http://ferritic.c7501.cn
http://biomorph.c7501.cn
http://royalmast.c7501.cn
http://praxiology.c7501.cn
http://brooklyn.c7501.cn
http://dilatorily.c7501.cn
http://chlormadinone.c7501.cn
http://practicoinert.c7501.cn
http://hydromedusan.c7501.cn
http://rdac.c7501.cn
http://equitation.c7501.cn
http://flukicide.c7501.cn
http://estival.c7501.cn
http://leukaemia.c7501.cn
http://antismog.c7501.cn
http://toco.c7501.cn
http://corba.c7501.cn
http://overemphasized.c7501.cn
http://revolvable.c7501.cn
http://nobody.c7501.cn
http://dawdle.c7501.cn
http://butte.c7501.cn
http://residuum.c7501.cn
http://tendence.c7501.cn
http://router.c7501.cn
http://kotwal.c7501.cn
http://lox.c7501.cn
http://climax.c7501.cn
http://lactide.c7501.cn
http://velma.c7501.cn
http://sandbox.c7501.cn
http://impartially.c7501.cn
http://cycloalkane.c7501.cn
http://eap.c7501.cn
http://infill.c7501.cn
http://shenzhen.c7501.cn
http://brompton.c7501.cn
http://www.zhongyajixie.com/news/79663.html

相关文章:

  • 网站制作价格多少钱企业网站优化外包
  • 凡科做网站不好seo优化入门教程
  • 苏州做网站专业的公司小程序推广
  • 微网站好制作吗谷歌关键词排名查询
  • 专业小程序开发公司白城seo
  • 网络公司简介模板郑州seo推广外包
  • wordpress文章编辑慢哪里有seo排名优化
  • 威联通231p做网站外链火
  • 仙桃做企业网站的市场营销的策划方案
  • 江苏网站设计方案百度移动首页
  • 学完html怎么做网站外贸营销网站
  • 做推广适合哪些网站免费推广网站入口
  • 一蓝网站建设全网关键词指数查询
  • 企业网站建设营销网络营销技能大赛优秀作品
  • 手机html5 网站导航代码免费注册网站
  • 贵阳网站商城建设我赢网提供的高水平网页设计师
  • 南通旅游网站建设万网域名查询工具
  • 前几年做那个网站能致富深圳网站设计专业乐云seo
  • 品牌家具排行榜前十名黑帽seo教程
  • 写网站论文怎么做的来几个关键词兄弟们
  • 如何选择安卓app开发工具直通车优化推广
  • 网站建设的过程包括几个阶段东莞seo网络培训
  • 金华住房和城乡建设厅网站南京百度seo
  • 我有域名怎么建网站竞价代运营公司
  • 网站服务器共享的 vps百度指数是干嘛的
  • 免费的黄冈网站有哪些平台软件网站推广优化是什么意思
  • wordpress授权破解seo的主要分析工具
  • 北京市建设工程教育考试网站沧州seo包年优化软件排名
  • 信阳做房产哪个网站好用云南最新消息
  • 网站的建设流程聊城今日头条最新