Factorization of Gaussian integers
MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
numlib::factorGaussInt(n) returns the factorization
of the Gaussian integer
n into Gaussian primes.
Among associate primes, that one with smallest polar angle is chosen.
In the Gaussian integers, 3 remains prime while 5 does not:
The argument to
be any Gaussian integer, that is, every complex number of the form a + b i where a and b are
An integer, or a complex number whose real and imaginary part are integers
numlib::factorGaussInt returns a list
p1, a1, ..., pk, ak] where u is
a unit in the Gaussian integers, the pi are
Gaussian primes and the ai are
positive integers, such that .
used to factor the norm; this step takes most of the running time.
Hence, the running time of the algorithm mainly depends on the size
of the prime factors of the norm of