早教吧作业答案频道 -->其他-->
核主成分程序:结果中要具体组成主成分的系数,核函数是多项式核函数!
题目详情
核主成分程序:结果中要具体组成主成分的系数,核函数是多项式核函数!
▼优质解答
答案和解析
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;
}
看了 核主成分程序:结果中要具体组...的网友还看了以下:
判断:标况下,1摩尔H2和CO2的混合气体约为22.4升 ;决定气小体体积大的主要因素是分子体积的 2020-05-16 …
玛瑙是分泌体吗再讲讲玛瑙成因也成谢谢~俺课本上还配了张“玛瑙的分泌体”的图 2020-05-17 …
怎么分辨是奇函数还是偶函数?例题:下列函数中是偶函数的是?A.Y=2XB.Y=2cosX(求具体的 2020-06-04 …
三维看见的一个分段曲面,一部分是C1连续的,另一部分是常值函数,该曲面整体是C0连续的,问怎么实现 2020-06-15 …
关于分子如果拿水分子的大小和乒乓球相比,就好象拿乒乓球和地球相比一样,请问这说明什么(最主要的)? 2020-06-20 …
设函数f(x)和g(x)分别是R上的偶函数和奇函数,则下列结论恒成立的是().设函数f(x)和g( 2020-07-08 …
六年级填空题II1.把一个底面直径和高都是2分米的圆柱,切开后拼成一个近似长方体,这个长方体底面的 2020-07-31 …
积分求旋转体的体积当遇到两函数相交的部分是分开积分求体积差.什么时候是用两函数相减再积分?区别? 2020-07-31 …
在下面一段文字的横线处补写恰当的语句,使整段文字语意完整连贯,内容贴切,逻辑严密。每处不超过15个字 2020-12-03 …
知道一个函数fx是分段函数求fx的导数如果求出来导函数在分段点不连续要怎么继续写知道一个函数fx是分 2021-02-11 …