Analyze Running Time for Primpoly.¶
This notebook is called PrimpolyRunningTimeAnalysis.ipynb
¶
Run it using
jupyter lab PrimpolyRunningTimeAnalysis.ipynb
When you get done, please create an HTML version of this notebook for viewing on the web by running
jupyter nbconvert PrimpolyRunningTimeAnalysis.ipynb --to html
I urge you to do Kernel->Restart Kernel and Clear All Outputs , followed by Kernel->Restart Kernel and Run All Cells
- LEGAL
Primpoly Version 16.3 - A Program for Computing Primitive Polynomials.
Copyright (C) 1999-2024 by Sean Erik O'Connor. All Rights Reserved.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
The author's address is seanerikoconnor!AT!gmail!DOT!com
with the !DOT! replaced by . and the !AT! replaced by @
Modules, Libraries and Settings¶
Settings and magical thingies.¶
Use the Jupyterlab light theme so you can see your plot labels and titles, which are default black.
Reload all modules (except those excluded by %aimport) every time before executing the Python code typed.
In [1]:
%load_ext autoreload
%autoreload 2
Display plot output in the cell below.
In [2]:
%matplotlib inline
Matplotlib is building the font cache; this may take a moment.
Make the plots larger.
In [3]:
from IPython.display import display, HTML
display(HTML("<style>.container { width:100% !important; }</style>"))
System modules¶
In [4]:
import numpy as np # NumPy math matrix library.
import matplotlib.pyplot as plt # MatPlot library plotting
from time import time, ctime # Times and time arithmetic.
Import the Primpoly running time Python module.¶
In [5]:
from PrimpolyRunningTimeAnalysis import update_running_times_and_plot_all
Plot the running time.¶
How does the Primpoly time vary with polynomial degree?¶
In [6]:
update_running_times_and_plot_all()
Running Python Version 3.12.3
Primpoly p = 2 n = 2 running time = 0.4 Primpoly p = 2 n = 10 running time = 0.37 Primpoly p = 2 n = 30 running time = 0.37 Primpoly p = 2 n = 50 running time = 0.39 Primpoly p = 2 n = 70 running time = 0.41 Primpoly p = 2 n = 90 running time = 0.46 Primpoly p = 2 n = 100 running time = 1.11 Primpoly p = 2 n = 120 running time = 1.17 Primpoly p = 2 n = 140 running time = 1.9 Primpoly p = 2 n = 145 running time = 0.96 Primpoly p = 2 n = 150 running time = 1.61 Primpoly p = 2 n = 160 running time = 0.88 Primpoly p = 2 n = 180 running time = 4.89 Primpoly p = 2 n = 200 running time = 1.57 Primpoly p = 2 n = 202 running time = 3.73 Primpoly p = 2 n = 210 running time = 12.01 Primpoly p = 2 n = 300 running time = 9.84 Primpoly p = 2 n = 400 running time = 11.27 Primpoly p = 2 n = 500 running time = 93.05 Primpoly p = 2 n = 550 running time = 139.01