08.02.2015 Views

Sage Reference Manual: Matrices and Spaces of Matrices - Mirrors

Sage Reference Manual: Matrices and Spaces of Matrices - Mirrors

Sage Reference Manual: Matrices and Spaces of Matrices - Mirrors

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER<br />

TWENTYFOUR<br />

BENCHMARKS FOR MATRICES<br />

This file has many functions for computing timing benchmarks <strong>of</strong> various methods for r<strong>and</strong>om matrices with given<br />

bounds for the entries. The systems supported are <strong>Sage</strong> <strong>and</strong> Magma.<br />

The basic comm<strong>and</strong> syntax is as follows:<br />

sage: import sage.matrix.benchmark as b<br />

sage: print "starting"; import sys; sys.stdout.flush(); b.report([b.det_ZZ], ’Test’, systems=[’sage’]<br />

starting...<br />

======================================================================<br />

Test<br />

======================================================================<br />

...<br />

======================================================================<br />

sage.matrix.benchmark.MatrixVector_QQ(n=1000, h=100, system=’sage’, times=1)<br />

Compute product <strong>of</strong> square n matrix by r<strong>and</strong>om vector with num <strong>and</strong> denom bounded by h the given number <strong>of</strong><br />

times.<br />

INPUT:<br />

•n - matrix dimension (default: 300)<br />

•h - numerator <strong>and</strong> denominator bound (default: bnd)<br />

•system - either ‘sage’ or ‘magma’ (default: ‘sage’)<br />

•times - number <strong>of</strong> experiments (default: 1)<br />

EXAMPLES:<br />

sage: import sage.matrix.benchmark as b<br />

sage: ts = b.MatrixVector_QQ(500)<br />

sage: tm = b.MatrixVector_QQ(500, system=’magma’)<br />

# optional - magma<br />

sage.matrix.benchmark.charpoly_GF(n=100, p=16411, system=’sage’)<br />

Given a n x n matrix over GF with r<strong>and</strong>om entries, compute the charpoly.<br />

INPUT:<br />

•n - matrix dimension (default: 100)<br />

•p - prime number (default: 16411)<br />

•system - either ‘magma’ or ‘sage’ (default: ‘sage’)<br />

EXAMPLES:<br />

413

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!