Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

strassen in c language.

#include<stdio.h>
#define N 8
void input(int n,int p[N][N])
{
 int i,j;
 for(i=0;i<n;i++)
 {
  printf("please input the %d line:\n",i+1);
  for(j=0;j<n;j++)
  {
  scanf("%d",&p[i][j]);
 }
}
 }
void output(int n,int p[N][N])
{
 int i,j;
 for(i=0;i<n;i++)
 {
 printf("\n");
 for(j=0;j<n;j++)
 {
  printf("%d",p[i][j]);
 }
}
 }
void MATRIX_ADD(int n,int X[][N],int Y[][N],int Z[][N])
{
 int i,j;
 for(i=0;i<n;i++)
 for(j=0;j<n;j++)
 Z[i][j]=X[i][j]+Y[i][j];
}
void MATRIX_SUB(int n,int X[][N],int Y[][N],int Z[][N])
{
 int i,j;
 for(i=0;i<n;i++)
 for(j=0;j<n;j++)
 Z[i][j]=X[i][j]-Y[i][j];
}
void MATRIX_MULTIPLY(int A[][N],int B[][N],int C[][N])
{
 int i,j,t;
 for(i=0;i<2;i++)
 for(j=0;j<2;j++)
 {
  C[i][j]=0;
  for(t=0;t<2;t++)
  C[i][j]=C[i][j]+A[i][t]*B[t][j];
 }
}
void STRASSEN(int n,int A[][N],int B[][N],int C[][N])
{
 int i,j;
 int A11[N][N],A12[N][N],A21[N][N],A22[N][N];
 int B11[N][N],B12[N][N],B21[N][N],B22[N][N];
 int C11[N][N],C12[N][N],C21[N][N],C22[N][N];
 int M1[N][N],M2[N][N],M3[N][N],M4[N][N],M5[N][N],M6[N][N],M7[N][N];
 int AA[N][N],BB[N][N],MM1[N][N],MM2[N][N];
 if(n==2)
 MATRIX_MULTIPLY(A,B,C);
 else
 {
  for(i=0;i<n/2;i++)
  for(j=0;j<n/2;j++)
  {
   A11[i][j]=A[i][j];
   A12[i][j]=A[i][j+n/2];
   A21[i][j]=A[i+n/2][j];
   A22[i][j]=A[i+n/2][j+n/2];
   B11[i][j]=B[i][j];
   B12[i][j]=B[i][j+n/2];
   B21[i][j]=B[i+n/2][j];
   B22[i][j]=B[i+n/2][j+n/2];
  }
  MATRIX_SUB(n/2,B12,B22,BB);
  STRASSEN(n/2,A11,BB,M1);
  MATRIX_ADD(n/2,A11,A12,AA);
  STRASSEN(n/2,AA,B22,M2);
  MATRIX_ADD(n/2,A21,A22,


Ïà¹ØÎĵµ£º

ÓеÀÄÑÌâÁ·Ï°Èü2ÖеÄcÌâ

ÃèÊö ¸ø¶¨Ò»¸öÕûÊýÐòÁУ¬ÅжÏÆäÖÐÓжàÉÙ¸öÊý£¬µÈÓÚÊýÁÐÖÐÆäËûÁ½¸öÊýµÄºÍ¡£ ±ÈÈ磬¶ÔÓÚÊýÁÐ1 2 3 4, Õâ¸öÎÊÌâµÄ´ð°¸¾ÍÊÇ2, ÒòΪ3 = 2 + 1, 4 = 1 + 3¡£ ÊäÈë µÚÒ»ÐÐÊÇÒ»¸öÕûÊýT£¬±íʾһ¹²ÓжàÉÙ×éÊý¾Ý¡£ 1<= T <= 100
½ÓÏÂÀ´µÄÿ×éÊý¾Ý¹²Á½ÐУ¬µÚÒ»ÐÐÊÇÊýÁÐÖÐÊýµÄ¸öÊýn ( 1 <= n <= 100)£¬µÚ¶þÐÐÊÇÓÉn¸öÕûÊý×é³ ......

´¿Java°æ¹¤ÐÐB2CÍøÒø½Ó¿Úµ÷ÓÃ×ܽá

1.Ê×ÏÈ¿´¶®¹Ù·½Îĵµ
2.icbc.jarÕâ¸öjar°üÒ»¶¨ÒªÒªµ½£¡ÕâÊǽøÐÐbase64¼ÓÃܽâÃÜ£¬ÒÔ¼°
ʹÓù¤ÐÐÖ¤ÊéÇ©ÃûµÄÖØÒª¹¤¾ßÀà¡£
3.²ÉÈ¡´¿Java±àÂ룬Ҫȷ±£ÓöÔÖ¤Ê飬·ÅÔÚDÅ̸ùĿ¼ÏÂ(ÆäËû·¾¶Òà¿É)¡£
4.±àдJSP½Ó¿ÚÒ³Ã棬×ֶαØÐëÓ빤ÐеÄÒ»Ò»¶ÔÓ¦¡£
¶øÇÒÈçtranDataµÈ×ֶνøÐÐbase64¼ÓÃܺó»òÕßÇ©Ãûºó ±ØÐëÒÔ"“Ë«ÒýºÅÀ©ÉϲŠ......

¹ØÓÚC/C++ÖÐÄÚ´æ¿Õ¼äµÄ»®·Ö

CAPTION: ¹ØÓÚC/C++ÖÐÄÚ´æ¿Õ¼äµÄ»®·Ö
AUTHOR: aIsland Õª×ÔÖйúITʵÑéÊÒ
DATE: 2010-05-30
E-MAIL: aIsland@live.cn
QQ: 418662213
P.S.
     1.Bolanlan|ËæÐÄhigh|aIsland Èý¸öÍøÃû¾ùΪ±¾ÈË
     2.ÉùÃ÷aIsland ËùÊÕ¼µÄËùÓÐÎÄÕÂÆäÖø×÷Ȩ¶¼ÊôÓÚÔ­´´×÷Õß
   ......

C/C++º¯Êý²ÎÊý,´«ÖµÓò´«Ö·µÄÇø±ð!!!

/*
* File: main.cpp
* Author: Vicky
*
* Created on 2010Äê5ÔÂ8ÈÕ, ÏÂÎç2:47
*/
#include <iostream>
using namespace std;
class A{
public:
A(){
cout << "Ö´Ðй¹Ô캯Êý´´½¨Ò»¸ö¶ÔÏó" << endl;
}
A(A&){
cout << "Ö´Ðп½±´º¯Êý¿½±´Ò»¸ö¶ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ