bool _stdcall InverseMatrix(double a[], int n=dim) //求任意阶矩阵逆矩阵的函数
{ //采用高斯-约旦法
int is,js,i,j,k,l,u,v;
double d,p;
is=new int[n];
js=new int[n];
//第一步 全选主元
for (k=0; k<=n-1; k++)
{
d=00;
for (i=k; i<=n-1; i++)
for (j=k; j<=n-1; j++)
{
l=in+j;
p=fabs(a[l]);
if (p>d) //从第 k 行、第 k 列开始的右下角子阵中选取绝对值最大的元素并记住次元素所在的行号和列号
{
d=p;
is[k]=i;//记录行号
js[k]=j;//记录列号
}
}
if (d+10==10)
{
delete []is; delete []js;
for(i=0;i<n;i++)
a[i]=00;
return false;
}
//通过行交换和列交换将它交换到主元素位置上
if (is[k]!=k)
for (j=0; j<=n-1; j++)
{
u=kn+j; v=is[k]n+j;
p=a[u]; a[u]=a[v]; a[v]=p; //行交换
}
if (js[k]!=k)
for (i=0; i<=n-1; i++)
{
u=in+k; v=in+js[k];
p=a[u]; a[u]=a[v]; a[v]=p; //列交换
}
l=kn+k;
a[l]=10/a[l];
for (j=0; j<=n-1; j++)
if (j!=k)
{
u=kn+j;
a[u]=a[u]a[l];
}
for (i=0; i<=n-1; i++)
if (i!=k)
for (j=0; j<=n-1; j++)
if (j!=k)
{
u=in+j;
a[u]=a[u]-a[in+k]a[kn+j];
}
for (i=0; i<=n-1; i++)
if (i!=k)
{
u=in+k; a[u]=-a[u]a[l];
}
}
//根据记录的行号列号进行恢复
for (k=n-1; k>=0; k--)
{
if (js[k]!=k)
for (j=0; j<=n-1; j++)
{
u=kn+j; v=js[k]n+j;
p=a[u]; a[u]=a[v]; a[v]=p;
}
if (is[k]!=k)
for (i=0; i<=n-1; i++)
{
u=in+k; v=in+is[k];
p=a[u]; a[u]=a[v]; a[v]=p;
}
}
delete []is;
delete []js;
return true;
}
//矩阵乘法ab=c
void _stdcall Matrixmul(double a[], double b[],double c[],int m=dim,int n=dim,int k=dim)
{ //其中a为mn阶矩阵,b为nk阶矩阵
int i,j,l,u;
for (i=0; i<=m-1; i++)
for (j=0; j<=k-1; j++)
{
u=ik+j; c[u]=00;
for (l=0; l<=n-1; l++)
c[u]=c[u]+a[in+l]b[lk+j];
}
return;
}
这个两个函数一个求矩阵的逆,一个是矩阵相乘。你做个程序调用他们就可以了。当然这个方法的前提是系数矩阵可逆哈。According to the turn of China IDC and the match Di adviser unite to release of 《2009-2010 the middle of the year, country IDC business market research paper 》suggest, close till 2009 the end of every years, the China IDC market scale attains 7,280,000,000 dollars renminbi and together compares to increase 495% and increased soon to increase 87 percentage points a little bit in 2008IDC business category also from at the beginning of website and server entrust to the care of, application entrust to the care of etc the foundation business extend a network acceleration and load balanced, the network safe project, and virtual appropriation netetc increase in value business categoryThe IDC industry faces a rare development chanceHowever, the IDC of China industry still faces some problems now and want to solve first of is norm service level, break technique bottleneckThe market demands keeps on prosperous, however IDC profession but widespreadly the existence doesn't not take charge of dint, service market norm etc problem, serious check and supervision IDC the development of the professionNot a few service companies of qualificationses who don't have IDC, pass to rent IDC that IDC serves a company an engine room development IDC business, because of this part of business enterprises not norm, the service ability, and technique troopsetc can not follow and make the customer serve to can not get a guaranteeCalculated to have some to have the service company of service ability, proceeded from vigorous competition pressure, not a few business enterprises also at product quality kimono duty the company greatly give discount and make customer misery;Company's good people and bad people mixed up of various service, letting the customer also being recognized with difficulty very much do not, the real large service company is deeply harmed by he/sheAt the same time, flowing out of the problems, such as attack and Jiang corpse networketc of the last few years virus, wood horse and worm, spam and DDOS now, make the IDC safe problem played more strong more, IDC the customer's data safety and business continuous faces to biggest endanger;On the other hand, the network unites a mutual communication problem to make with each other IDC business service quality is subjected to influenceThe business enterprise chooses the service company of IDC usually needs to consider the service's company of connect into whether the business district of the network and oneself matches, this makes the business of many service companies developed to be subjected to a very great check and supervisionSafety with with each other allied the mutual communication technique want to have a right way service company to strengthen technique innovation
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)