实验源代码 //Warshall.cpp #include<stdio.h> void warshall(int k,int n) { int i , j, t; int temp[20][20]; for(int a=0;a<k;a++) { printf("请输入矩阵第%d 行元素:",a); for(int b=0;b<n;b++) { scanf ("%d",&temp[a][b]); } } for(i=0;i<k;i++){ for( j=0;j<k;j++){ if(temp[ j][i]==1) { for(t=0;t<n;t++) { temp[ j][t]=temp[i][t]||temp[ j][t]; } } } } printf("可传递闭包关系矩阵是:\n"); for(i=0;i<k;i++) { for( j=0;j<n;j++) { printf("%d", temp[i][ j]); } printf("\n"); } } void main() { printf("利用 Warshall 算法求二元关系的可传递闭包\n"); void warshall(int,int); int k , n; printf("请输入矩阵的行数 i: "); scanf("%d",&k); 四川大学实验报告 printf("请输入矩阵的列数 j: "); scanf("%d",&n); warshall(k,n); }
上传时间: 2016-06-27
上传用户:梁雪文以
批处理感知器算法的代码matlab w1=[1,0.1,1.1;1,6.8,7.1;1,-3.5,-4.1;1,2.0,2.7;1,4.1,2.8;1,3.1,5.0;1,-0.8,-1.3; 1,0.9,1.2;1,5.0,6.4;1,3.9,4.0]; w2=[1,7.1,4.2;1,-1.4,-4.3;1,4.5,0.0;1,6.3,1.6;1,4.2,1.9;1,1.4,-3.2;1,2.4,-4.0; 1,2.5,-6.1;1,8.4,3.7;1,4.1,-2.2]; w3=[1,-3.0,-2.9;1,0.5,8.7;1,2.9,2.1;1,-0.1,5.2;1,-4.0,2.2;1,-1.3,3.7;1,-3.4,6.2; 1,-4.1,3.4;1,-5.1,1.6;1,1.9,5.1]; figure; plot(w3(:,2),w3(:,3),'ro'); hold on; plot(w2(:,2),w2(:,3),'b+'); W=[w2;-w3];%增广样本规范化 a=[0,0,0]; k=0;%记录步数 n=1; y=zeros(size(W,2),1);%记录错分的样本 while any(y<=0) k=k+1; y=a*transpose(W);%记录错分的样本 a=a+sum(W(find(y<=0),:));%更新a if k >= 250 break end end if k<250 disp(['a为:',num2str(a)]) disp(['k为:',num2str(k)]) else disp(['在250步以内没有收敛,终止']) end %判决面:x2=-a2*x1/a3-a1/a3 xmin=min(min(w1(:,2)),min(w2(:,2))); xmax=max(max(w1(:,2)),max(w2(:,2))); x=xmin-1:xmax+1;%(xmax-xmin): y=-a(2)*x/a(3)-a(1)/a(3); plot(x,y)
上传时间: 2016-11-07
上传用户:a1241314660
#include<iom16v.h> #include<macros.h> #define uint unsigned int #define uchar unsigned char uint a,b,c,d=0; void delay(c) { for for(a=0;a<c;a++) for(b=0;b<12;b++); }; uchar tab[]={ 0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,
上传时间: 2013-10-21
上传用户:13788529953
题目:利用条件运算符的嵌套来完成此题:学习成绩>=90分的同学用A表示,60-89分之间的用B表示,60分以下的用C表示。 1.程序分析:(a>b)?a:b这是条件运算符的基本例子。
上传时间: 2015-01-08
上传用户:lifangyuan12
源代码\用动态规划算法计算序列关系个数 用关系"<"和"="将3个数a,b,c依次序排列时,有13种不同的序列关系: a=b=c,a=b<c,a<b=v,a<b<c,a<c<b a=c<b,b<a=c,b<a<c,b<c<a,b=c<a c<a=b,c<a<b,c<b<a 若要将n个数依序列,设计一个动态规划算法,计算出有多少种不同的序列关系, 要求算法只占用O(n),只耗时O(n*n).
上传时间: 2013-12-26
上传用户:siguazgb
We have a group of N items (represented by integers from 1 to N), and we know that there is some total order defined for these items. You may assume that no two elements will be equal (for all a, b: a<b or b<a). However, it is expensive to compare two items. Your task is to make a number of comparisons, and then output the sorted order. The cost of determining if a < b is given by the bth integer of element a of costs (space delimited), which is the same as the ath integer of element b. Naturally, you will be judged on the total cost of the comparisons you make before outputting the sorted order. If your order is incorrect, you will receive a 0. Otherwise, your score will be opt/cost, where opt is the best cost anyone has achieved and cost is the total cost of the comparisons you make (so your score for a test case will be between 0 and 1). Your score for the problem will simply be the sum of your scores for the individual test cases.
标签: represented integers group items
上传时间: 2016-01-17
上传用户:jeffery
The XML Toolbox converts MATLAB data types (such as double, char, struct, complex, sparse, logical) of any level of nesting to XML format and vice versa. For example, >> project.name = MyProject >> project.id = 1234 >> project.param.a = 3.1415 >> project.param.b = 42 becomes with str=xml_format(project, off ) "<project> <name>MyProject</name> <id>1234</id> <param> <a>3.1415</a> <b>42</b> </param> </project>" On the other hand, if an XML string XStr is given, this can be converted easily to a MATLAB data type or structure V with the command V=xml_parse(XStr).
标签: converts Toolbox complex logical
上传时间: 2016-02-12
上传用户:a673761058
#include "iostream" using namespace std; class Matrix { private: double** A; //矩阵A double *b; //向量b public: int size; Matrix(int ); ~Matrix(); friend double* Dooli(Matrix& ); void Input(); void Disp(); }; Matrix::Matrix(int x) { size=x; //为向量b分配空间并初始化为0 b=new double [x]; for(int j=0;j<x;j++) b[j]=0; //为向量A分配空间并初始化为0 A=new double* [x]; for(int i=0;i<x;i++) A[i]=new double [x]; for(int m=0;m<x;m++) for(int n=0;n<x;n++) A[m][n]=0; } Matrix::~Matrix() { cout<<"正在析构中~~~~"<<endl; delete b; for(int i=0;i<size;i++) delete A[i]; delete A; } void Matrix::Disp() { for(int i=0;i<size;i++) { for(int j=0;j<size;j++) cout<<A[i][j]<<" "; cout<<endl; } } void Matrix::Input() { cout<<"请输入A:"<<endl; for(int i=0;i<size;i++) for(int j=0;j<size;j++){ cout<<"第"<<i+1<<"行"<<"第"<<j+1<<"列:"<<endl; cin>>A[i][j]; } cout<<"请输入b:"<<endl; for(int j=0;j<size;j++){ cout<<"第"<<j+1<<"个:"<<endl; cin>>b[j]; } } double* Dooli(Matrix& A) { double *Xn=new double [A.size]; Matrix L(A.size),U(A.size); //分别求得U,L的第一行与第一列 for(int i=0;i<A.size;i++) U.A[0][i]=A.A[0][i]; for(int j=1;j<A.size;j++) L.A[j][0]=A.A[j][0]/U.A[0][0]; //分别求得U,L的第r行,第r列 double temp1=0,temp2=0; for(int r=1;r<A.size;r++){ //U for(int i=r;i<A.size;i++){ for(int k=0;k<r-1;k++) temp1=temp1+L.A[r][k]*U.A[k][i]; U.A[r][i]=A.A[r][i]-temp1; } //L for(int i=r+1;i<A.size;i++){ for(int k=0;k<r-1;k++) temp2=temp2+L.A[i][k]*U.A[k][r]; L.A[i][r]=(A.A[i][r]-temp2)/U.A[r][r]; } } cout<<"计算U得:"<<endl; U.Disp(); cout<<"计算L的:"<<endl; L.Disp(); double *Y=new double [A.size]; Y[0]=A.b[0]; for(int i=1;i<A.size;i++ ){ double temp3=0; for(int k=0;k<i-1;k++) temp3=temp3+L.A[i][k]*Y[k]; Y[i]=A.b[i]-temp3; } Xn[A.size-1]=Y[A.size-1]/U.A[A.size-1][A.size-1]; for(int i=A.size-1;i>=0;i--){ double temp4=0; for(int k=i+1;k<A.size;k++) temp4=temp4+U.A[i][k]*Xn[k]; Xn[i]=(Y[i]-temp4)/U.A[i][i]; } return Xn; } int main() { Matrix B(4); B.Input(); double *X; X=Dooli(B); cout<<"~~~~解得:"<<endl; for(int i=0;i<B.size;i++) cout<<"X["<<i<<"]:"<<X[i]<<" "; cout<<endl<<"呵呵呵呵呵"; return 0; }
标签: 道理特分解法
上传时间: 2018-05-20
上传用户:Aa123456789
1.05G2015-06-02 06:02 上海交大解码.rar 863KB2015-06-02 06:02 景桥播放器.rar 4.8M2015-06-02 06:02 大学课程专业软件.7z 6.6M2015-06-02 06:02 北师大ds专用播放器.rar 841KB2015-06-02 06:02 956浙江大学电子技术基础89讲视频教程(三分屏)(经典!).rar 7.12G2015-06-02 06:02 681 西北工业大学 高等数学下80讲 视频教程 3.52G2015-06-02 06:02 680 西北工业大学 高等数学上84讲 视频教程 3.41G2015-06-02 06:02 600西北工业大学电子技术64讲 视频教程 2.23G2015-06-02 06:02 599西北工业大学电工电子技术63讲 视频教程 2.68G2015-06-02 06:02 532浙江大学电工与电子技术32讲(csf版)视频教程 1.03G2015-06-02 06:02 349上海交大1327计算机应用基础25讲 视频教程 781.2M2015-06-02 06:02 336浙江大学计算机辅助数控编程技术 视频教程 1.06G2015-06-02 06:02 335上海交大2299计算机应用基础22讲 视频教程 819.8M2015-06-02 06:02 328上海交大2457计算机组成42讲 视频教程 1.62G2015-06-02 06:02 310浙江大学电子技术基础36讲(MP4版) 视频教程 1.7G2015-06-02 06:02 309浙江大学电子技术基础36讲(csf版) 视频教程 1.96G2015-06-02 06:02 290浙江大学电力电子技术32讲(csf版) 视频教程 1.43G2015-06-02 06:02 289浙江大学电力电子技术32讲(MP4版) 视频教程 1.07G2015-06-02 06:02 288浙江大学电力电子技术32讲(三分屏版) 视频教程 1.15G2015-06-02 06:02 287重庆大学电力电子技术113讲.rar 673.9M2015-06-02 06:02 286重庆大学模拟电子技术135讲.rar 2.14G2015-06-02 06:02 281武汉理工大学电工与电子技术71讲视频教程.rar 2.23G2015-06-02 06:02 219武汉理工大学计算机接口与通讯48讲视频教程.rar 974.2M2015-06-02 06:02 202 西安交大 高等数学下38讲 视频教程(www.study139.com提供).rar 461.5M2015-06-02 06:02 201高等数学 上 62讲 视频教程(www.study139.com提供)(1).rar 750.8M2015-06-02 06:02 2014-9-28--大学课程-密码.txt 2KB2015-06-02 06:02 2014-9-28----大学课程-密码.txt 2KB2015-06-02 06:02 2014-8-26-大学课程-密码.txt 1KB2015-06-02 06:02 2014-8-26--大学课程-密码.txt 1KB2015-06-02 06:02 2014-2---8---大学课程-密码.txt 3KB2015-06-02 06:02 2014-12---2---大学课程-密码.txt 3KB2015-06-02 06:02 2014-12---2----大学课程-密码.txt 3KB2015-06-02 06:02 2014-10---2----大学课程-密码.txt 2KB2015-06-02 06:02 2014-10----2----大学课程-密码.txt 2KB2015-06-02 06:02 176武汉理工大学模拟电子技术42讲视频教程.rar 1.57G2015-06-02 06:02 172武汉理工大学数字电子技术50讲视频教程.rar 1.23G2015-06-02 06:02 170上海交大2762电工电子技术36讲 视频教程 1.3G2015-06-02 06:02 169武汉理工大学武汉理工大学计算机软件技术基础31讲视频视频教程.rar 309.9M2015-06-02 06:02 1604002电子技术基础王小海 学习视频 1.28G2015-06-02 06:02 1604001电路原理范承志 学习视频 1.11G2015-06-02 06:02 150武汉理工大学高等数学104讲视频教程.rar 2.68G2015-06-02 06:02 139 上海交大 1453电子技术基础30讲 视频教程 1.66G2015-06-02 06:02 123 西安交大 数字电子技术69讲 视频教程 871M2015-06-02 06:02 121 西安交大 电工电子技术62讲 视频教程 616.1M2015-06-02 06:02 115 上海交大 2228电子技术基础40讲 视频教程 950.6M2015-06-02 06:02 114 上海交大 2228电子技术基础41讲 视频教程 113石油大学电路 视频教程 1.12G2015-06-02 06:02 113 西安交大 模拟电子技术70讲 视频教程 715.6M2015-06-02 06:02 099 西安交大 计算机网络原理54讲 视频教程 634.9M2015-06-02 06:02 097 西安交大 数字逻辑电路54讲 视频教程 091 东南大学 数字逻辑电路 1.75G2015-06-02 06:02 083 电子科技大学 计算机基础 视频教程 1.09G2015-06-02 06:02 082石油大学计算机组成原理 视频教程 1.16G2015-06-02 06:02 079西安电子科技大学模拟电子技术基础36讲+4辅导 视频教程 3.29G2015-06-02 06:02 075石油大学计算机操作系统 视频教程 1.22G2015-06-02 06:02 075 北师大 高等数学微积分(非经济类)视频教程 共77讲 146.9M2015-06-02 06:02 067哈工大电工电子技术基础64讲送讲义 4.13G2015-06-02 06:02 066西安电子科技大学高等数学(一)下36讲 1.77G2015-06-02 06:02 066 吉林大学 计算机操作系统 视频教程 1.66G2015-06-02 06:02 065西安电子科技大学高等数学(一)上36讲+4辅导 视频教程 063 吉林大学 电路电子技术 视频教程 6.06G2015-06-02 06:02 059 电子科技大学 射频模拟电路26讲 4.22G2015-06-02 06:02 058西安电子科技大学计算机系统结构31讲+4辅导 视频教程 1.59G2015-06-02 06:02 058 上海交大 2456计算机网络技术基础53讲 视频教程 054西安电子科技大学电子技术基础实验21讲 视频教程 051 东南大学 电路基础 1.03G2015-06-02 06:02 050西北工业大学电子技术64讲.rar 2.23G2015-06-02 06:02 049石油大学电力电子技术32讲 视频教程 420M2015-06-02 06:02 049 电子科技大学 电路分析基础68讲 视频教程 11.18G2015-06-02 06:02 047 哈工大 高等数学上下册98讲 3.17G2015-06-02 06:02 046石油大学数字电子技术 视频教程 1.02G2015-06-02 06:02 045天津大学_高等数学下_94讲.rar 9.32G2015-06-02 06:02 045石油大学模拟电子技术 视频教程 1.52G2015-06-02 06:02 044天津大学_高等数学上_95讲.rar 9.45G2015-06-02 06:02 044石油大学电路分析 视频教程 943.7M2015-06-02 06:02 044 电子科技大学 计算机系统结构34讲 5.12G2015-06-02 06:02 039 哈工大 计算机组成原理76讲 3.96G2015-06-02 06:02 032中南大学计算机原理与设计29讲 981.6M2015-06-02 06:02 029西安电子科技大学电子技术基础39讲视频教程 6.01G2015-06-02 06:02 029石油大学微积分 视频教程 2.9G2015-06-02 06:02 029 吉林大学 计算机组成原理 视频教程 1.42G2015-06-02 06:02 028 吉林大学 计算机系统结构 视频教程 028 哈工大 模拟电路76讲 1.66G2015-06-02 06:02 027中南大学计算机基础46讲 998.6M2015-06-02 06:02 027 哈工大 模拟电子技术40讲 1.65G2015-06-02 06:02 025 吉林大学 计算机网络基础 视频教程 1.3G2015-06-02 06:02 025 哈工大 数字电子技术基础52讲 1.66G2015-06-02 06:02 023 吉林大学 计算机接口技术及应用 视频教程 1.16G2015-06-02 06:02 022清华大学电子技术基础55讲视频教程(经典!!!) 4.53G2015-06-02 06:02 022 东南大学 东南大学计算机组成原理 视频教程 1.19G2015-06-02 06:02 019 北师大 高等数学(概率论)视频教程 共54讲 105.9M2015-06-02 06:02 018清华大学有机化学及实验49讲视频教程(经典!!! 018 北师大 高等数学(线性代数)视频教程 共66讲 129.5M2015-06-02 06:02 017 西安电子科技大学 电力电子技术50讲 视频教程 9.1G2015-06-02 06:02 017 北师大 高等数学(微积分)视频教程 共119讲 224.9M2015-06-02 06:02 014清华大学水力学39讲视频教程(经典!!! 2.7G2015-06-02 06:02 011华北电力大学数字电子技术基础43讲视频(经典!!!).rar 7.45G2015-06-02 06:02 010西南交大电子技术基础48讲 视频教程 2.23G2015-06-02 06:02 008清华大学计算机组成原理50讲视频教程(经典!!!) 4.27G2015-06-02 06:02 008南开大学计算机原理共34讲.rar 676.5M2015-06-02 06:02 008华北电力大学模拟电子技术基础51讲视频(经典!!!).rar 8.24G2015-06-02 06:02 007清华大学计算机语言与程序设计42讲视频教程(经典!!!) 3.37G2015-06-02 06:02 006清华大学计算机文化基础28讲视频教程(经典!!!) 3.77G2015-06-02 06:02 005 西安交大 电路100讲 视频教程 3.47G2015-06-02 06:02
标签: 电池
上传时间: 2013-06-25
上传用户:eeworm
专辑类-电子基础类专辑-153册-2.20G 21世纪大学新型参考教材系列-集成电路B-荒井-159页-2.8M.pdf
上传时间: 2013-05-16
上传用户:pkkkkp