a=array([[1,1/2,5,5,3],[2,1,7,7,5],[1/5,1/7,1,1/2,1/3], [1/5,1/7,2,1,1/2],[1/3,1/5,3,2,1]]) L,V=eigs(a,1) CR=(L-5)/4/1.12#计算一致性比率 W=V/sum(V);print("最大特征值是:",L) print("最大特征值对应的特征向量是:",V) print("CR=:",CR) B1=array([[1,1/3,1/2],[3,1,1/2],[2,2,1]]) L1,P1=eigs(B1,1);P1=P1/sum(P1) print("P!=:",P1) B2=array([[1,3,2],[1/3,1,2],[1/2,1/2,1]]) L2,P2=eigs(B2,1);P2=P2/sum(B2) print("P2=:",P2) B3=array([[1,4,3],[1/4,1,2],[1/3,1/2,1]]) L3,P3=eigs(B3,1);P3=P3/sum(B3) print("P3=:",P3) B4=array([[1,3,2],[1/3,1,2],[1/2,1/2,1]]) L4,P4=eigs(B4,1);P4=P4/sum(B4) print("P4=:",P4) B5=array([[1,2,3],[1/2,1,1/2],[1/3,2,1]]) L5,P5=eigs(B5,1);P5=P5/sum(B5) print("P5=:",P5) K=hstack([P1,P2,P3,P4,P5])@W print("K=:",K)
时间: 2023-09-30 15:05:31 浏览: 78
通过1 k ft (300m) CAT-5电缆传输SXGA视频信号
最大特征值是: [1.9045084]
最大特征值对应的特征向量是: [[ 0.10980572]
[ 0.17797955]
[ 0.02946309]
[ 0.05219738]
[ 0.0537653 ]]
CR=: -0.05138877133637659
P!=: [[0.32798528]
[0.65597056]
[0.65597056]]
P2=: [[0.32798528]
[0.65597056]
[0.65597056]]
P3=: [[0.32798528]
[0.65597056]
[0.65597056]]
P4=: [[0.32798528]
[0.65597056]
[0.65597056]]
P5=: [[0.32798528]
[0.65597056]
[0.65597056]]
K=: [[0.07310162]]
阅读全文