MCPcopy Create free account
hub / github.com/Singular/Singular / mp_Mult

Function mp_Mult

libpolys/polys/matpol.cc:206–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206matrix mp_Mult(matrix a, matrix b, const ring R)
207{
208 int i, j, k;
209 int m = MATROWS(a);
210 int p = MATCOLS(a);
211 int q = MATCOLS(b);
212
213 if (p!=MATROWS(b))
214 {
215/*
216* Werror("cannot multiply %dx%d matrix and %dx%d matrix",
217* m,p,b->rows(),q);
218*/
219 return NULL;
220 }
221 matrix c = mpNew(m,q);
222
223 for (i=0; i<m; i++)
224 {
225 for (k=0; k<p; k++)
226 {
227 poly aik;
228 if ((aik=MATELEM0(a,i,k))!=NULL)
229 {
230 for (j=0; j<q; j++)
231 {
232 poly bkj;
233 if ((bkj=MATELEM0(b,k,j))!=NULL)
234 {
235 poly *cij=&(MATELEM0(c,i,j));
236 poly s = pp_Mult_qq(aik /*MATELEM0(a,i,k)*/, bkj/*MATELEM0(b,k,j)*/, R);
237 (*cij)/*MATELEM0(c,i,j)*/ = p_Add_q((*cij) /*MATELEM0(c,i,j)*/ ,s, R);
238 }
239 }
240 }
241 }
242 }
243 for(i=m*q-1;i>=0;i--) p_Normalize(c->m[i], R);
244 return c;
245}
246
247matrix mp_Transp(matrix a, const ring R)
248{

Callers 9

mp_DetMuFunction · 0.85
jjTIMES_MAFunction · 0.85
luInverseFromLUDecompFunction · 0.85
hessenbergFunction · 0.85
mpTrafoFunction · 0.85
firstWalkStep64Function · 0.85
walkStep64Function · 0.85
unperturbedFirstStep64Function · 0.85
fractalRec64Function · 0.85

Calls 4

mpNewFunction · 0.85
pp_Mult_qqFunction · 0.85
p_Add_qFunction · 0.85
p_NormalizeFunction · 0.85

Tested by

no test coverage detected