早教吧作业答案频道 -->其他-->
核主成分程序:结果中要具体组成主成分的系数,核函数是多项式核函数!
题目详情
核主成分程序:结果中要具体组成主成分的系数,核函数是多项式核函数!
▼优质解答
答案和解析
the *getlist(int n=0){/*产生链表*/
the *p;
the *p1;
int i=0;
int j=0;
printf("请输入多项式的系数");
scanf("%d",j);
p=malloc(sizeof(the));
p1=p;
for(i=2;i=n;i++){
*p.i=j;
scanf("%d",j);
if(n!=i){
*p.next=malloc(sizeof(the));
p=*p.next;
}else{
*p.next=null;
}
}
return p;
}
int thesize(the *p){
int i=1;
while(*p.next!=null){
i++;
p=*p.next;
}
return i;
}
the* addthe(*p1,*p2){/*做加法*/
int size
if(thesize(*p1)thesize(*p2));
size=thesize(*p1);
else
size=thesize(*p2);
the *p;
p=getlist(size);
the *q;
int m,n,k,x,y;
for(k=0;ksize;k++){
m=thesize(*p1)-k;
n=thesize(*p2)-k;
if(m=0)
x=0;
else
x=getthevalue(m,p1).i;
if(n=0)
y=0;
else
y=getthevalue(n,p2).i;
q=getthevalue(k,p);
q.i=x+y;
}
}
the* getthevalue(int i;the *p){
the *p1=p;
int j=1;
while(ji){
p=*p.next;
j++;
}
return *p;
}
struct the{
the *next;
int i;
}
the *p;
the *p1;
int i=0;
int j=0;
printf("请输入多项式的系数");
scanf("%d",j);
p=malloc(sizeof(the));
p1=p;
for(i=2;i=n;i++){
*p.i=j;
scanf("%d",j);
if(n!=i){
*p.next=malloc(sizeof(the));
p=*p.next;
}else{
*p.next=null;
}
}
return p;
}
int thesize(the *p){
int i=1;
while(*p.next!=null){
i++;
p=*p.next;
}
return i;
}
the* addthe(*p1,*p2){/*做加法*/
int size
if(thesize(*p1)thesize(*p2));
size=thesize(*p1);
else
size=thesize(*p2);
the *p;
p=getlist(size);
the *q;
int m,n,k,x,y;
for(k=0;ksize;k++){
m=thesize(*p1)-k;
n=thesize(*p2)-k;
if(m=0)
x=0;
else
x=getthevalue(m,p1).i;
if(n=0)
y=0;
else
y=getthevalue(n,p2).i;
q=getthevalue(k,p);
q.i=x+y;
}
}
the* getthevalue(int i;the *p){
the *p1=p;
int j=1;
while(ji){
p=*p.next;
j++;
}
return *p;
}
struct the{
the *next;
int i;
}
看了 核主成分程序:结果中要具体组...的网友还看了以下:
知道第一项A1是2,A17是66,通项公式是序号N的一次函数,通项公式是什么 2020-04-09 …
二维数组A[m,n]按行序为主序存放在内存,每个数组元素占1个存储单元,则元素aij的地址计算公式是 2020-05-24 …
主机、外设不能并行工作的方式是( )A.程序查询方式B.中断方式C.通道方式D.外围处理机方式 2020-05-24 …
“劳力者治于人”运用的句式是( )。A.倒序句式B.判断句式C.主动句式D.被动句式 2020-05-31 …
法律上有严格规定的、关涉具体经济法主体权义的程序是( )A.正式程序B.非正式程序 C.诉 2020-06-06 …
研究下列表格,最符合其内容的学习主题是序号历史事件1清政府册封达赖、班禅;设置驻藏大臣2清政府组织 2020-06-11 …
研究下列表格,最符合其内容的学习主题是序号历史事件1清政府风风雨雨达赖、班禅、设置驻藏大臣2清朝平 2020-06-11 …
找规律2.算式“3+105”的序号是多少?序号:123456算式:1+152+203+151+20 2020-07-18 …
序号1,算式1+1,序号2,算式2+3,序号3,算式3+5,根据规律,序号40,算式是多少 2020-07-18 …
LabVIEW编个小程序,请高手解答!!创建一个VI子程序,该子程序的功能是用公式节点来产生一个模 2020-07-19 …