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

Function print_matrix

kernel/numeric/mpr_base.cc:370–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

368 }
369}
370void print_matrix( matrix omat )
371{
372 int i,j;
373 int val;
374 Print(" matrix m[%d][%d]=(\n",MATROWS( omat ),MATCOLS( omat ));
375 for ( i= 1; i <= MATROWS( omat ); i++ )
376 {
377 for ( j= 1; j <= MATCOLS( omat ); j++ )
378 {
379 if ( (MATELEM( omat, i, j)!=NULL)
380 && (!nIsZero(pGetCoeff( MATELEM( omat, i, j)))))
381 {
382 val= n_Int(pGetCoeff( MATELEM( omat, i, j) ), currRing->cf);
383 if ( i==MATROWS(omat) && j==MATCOLS(omat) )
384 {
385 Print("%d ",val);
386 }
387 else
388 {
389 Print("%d, ",val);
390 }
391 }
392 else
393 {
394 if ( i==MATROWS(omat) && j==MATCOLS(omat) )
395 {
396 PrintS(" 0");
397 }
398 else
399 {
400 PrintS(" 0, ");
401 }
402 }
403 }
404 PrintLn();
405 }
406 PrintS(");\n");
407}
408#endif
409//<-
410

Callers 1

createMatrixMethod · 0.85

Calls 4

n_IntFunction · 0.85
PrintSFunction · 0.85
PrintFunction · 0.50
PrintLnFunction · 0.50

Tested by

no test coverage detected