seaza Posted March 30, 2012 Report Posted March 30, 2012 (edited) sall.am o inmultire d matrici reprezentate ca vectori, si incercam sa gasesc o "regula" ptr inmultire.matrice operator*(matrice x) { matrice u; u.setLC(x.linii, coloane); int aux1=linii; int aux2=x.coloane; int aux3=coloane; int i, l, c; if(x.coloane==linii){ for(l=0; l<aux3; l++) { for(c=0; c<aux1; c++) { complex sum; for(i=0; i<aux2; i++) sum=sum+(v[l*aux2+i])*(x.v[i*aux1+c]); u.v[l*aux1+c]=sum; } } }else cout<<"EROARE"; return u; }unde v este: complex v[nrlin*nrcol], intr o clasa mostenita din complex, by default nrlin si nrcol sunt date cu #define nrlin 10, respc. #define nrcol 10doar ca nu merge chiar asa bine...are cnva vreo mica idee unde e greseala ? Edited March 30, 2012 by seaza Quote