=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/engine/mat.c,v retrieving revision 1.12 retrieving revision 1.15 diff -u -p -r1.12 -r1.15 --- OpenXM_contrib2/asir2000/engine/mat.c 2004/08/18 06:30:07 1.12 +++ OpenXM_contrib2/asir2000/engine/mat.c 2005/12/21 23:18:16 1.15 @@ -45,13 +45,15 @@ * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. * - * $OpenXM: OpenXM_contrib2/asir2000/engine/mat.c,v 1.11 2004/07/26 07:15:46 saito Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/engine/mat.c,v 1.14 2005/06/03 07:16:16 saito Exp $ */ #include "ca.h" #include "../parse/parse.h" extern int StrassenSize; +/* remove miser type void mulmatmat_miser(); +*/ void addmat(vl,a,b,c) VL vl; @@ -103,6 +105,7 @@ MAT a,b,*c; } } +/* remove miser type void addmat_miser(vl,a,b,c,ar0,ac0,ar1,ac1,br0,bc0,br1,bc1) VL vl; MAT a,b,*c; @@ -197,6 +200,7 @@ int ar0,ac0,ar1,ac1,br0,bc0,br1,bc1; *c = t; } } +*/ void mulmat(vl,a,b,c) VL vl; @@ -242,7 +246,10 @@ Obj a,b,*c; case O_VECT: mulmatvect(vl,(MAT)a,(VECT)b,(VECT *)c); break; case O_MAT: + mulmatmat(vl, (MAT)a, (MAT)b, (MAT *)c); break; +/* remove miser type mulmatmat_miser(vl,(MAT)a,(MAT)b,(MAT *)c, 0,0, ((MAT)a)->row-1, ((MAT)a)->col-1, 0,0,((MAT)b)->row-1, ((MAT)b)->col-1); break; +*/ default: notdef(vl,a,b,c); break; } @@ -366,50 +373,6 @@ void mulmatmat(vl,a,b,c) VL vl; MAT a,b,*c; { -#if 0 - int arow,bcol,i,j,k,m; - MAT t; - pointer s,u,v; - pointer *ab,*tb; - - /* Mismach col and row */ - if ( a->col != b->row ) { - *c = 0; error("mulmat : size mismatch"); - } else { - arow = a->row; m = a->col; bcol = b->col; - MKMAt(t,arow,bcol); - for ( i = 0; i < arow; i++ ) - for ( j = 0, ab = BDY(a)[i], tb = BDY(t)[i]; j < bcol; j++ ) { - for ( k = 0, s = 0; k < m; k++ ) { - arf_mul(vl,(Obj)ab[k],(Obj)BDY(b)[k][j],(Obj *)&u); - arf_add(vl,(Obj)s,(Obj)u,(Obj *)&v); - s = v; - } - tb[j] = s; - } - *c = t; - } -} - -void Strassen(arg, c) -NODE arg; -Obj *c; -{ - AT a,b; - VL vl; - - /* tomo */ - a = (MAT)ARG0(arg); - b = (MAT)ARG1(arg); - vl = CO; - strassen(CO, a, b, c); -} - -void strassen(vl,a,b,c) -VL vl; -MAT a,b,*c; -{ -#endif int arow,bcol,i,j,k,m, h, arowh, bcolh; MAT t, a11, a12, a21, a22; MAT p, b11, b12, b21, b22; @@ -456,25 +419,6 @@ MAT a,b,*c; m++; pflag2 = 1; } -/* - MKMAT(aa, arow, m); - for (i = 0; i < a->row; i++) { - for (j = 0; j < a->col; j++) { - aa->body[i][j] = a->body[i][j]; - } - } - i = bcol/2; - j = bcol - i; - if (i != j) { - bcol++; - } - MKMAT(bb, m, bcol); - for (i = 0; i < b->row; i++) { - for ( j = 0; j < b->col; j++) { - bb->body[i][j] = b->body[i][j]; - } - } -*/ /* split matrix A and B */ a1row = arow/2; a1col = m/2; @@ -634,6 +578,8 @@ MAT a,b,*c; *c = t; } +#if 0 +/* remove miser type */ void mulmatmat_miser(vl,a,b,c,ar0,ac0,ar1,ac1,br0,bc0,br1,bc1) VL vl; MAT a,b,*c; @@ -806,6 +752,7 @@ int ar0, ac0, ar1, ac1, br0, bc0, br1, bc1; } *c = t; } +#endif void mulmatvect(vl,a,b,c) VL vl; @@ -823,9 +770,11 @@ VECT *c; else if ( a->col != b->len ) { *c = 0; error("mulmatvect : size mismatch"); } else { +#if 0 for ( i = 0; i < b->len; i++ ) if ( BDY(b)[i] && OID((Obj)BDY(b)[i]) > O_R ) error("mulmatvect : invalid argument"); +#endif arow = a->row; m = a->col; MKVECT(t,arow); for ( i = 0; i < arow; i++ ) {