1/*==============================================================================
2|
3| NAME
4|
5| ppOperationCount.hpp
6|
7| DESCRIPTION
8|
9| Header file for operation counts for the primitive polynomial algorithm.
10| collection classes.
11|
12| User manual and technical documentation are described in detail in my web page at
13| http://seanerikoconnor.freeservers.com/Mathematics/AbstractAlgebra/PrimitivePolynomials/overview.html
14|
15| LEGAL
16|
17| Primpoly Version 16.3 - A Program for Computing Primitive Polynomials.
18| Copyright (C) 1999-2024 by Sean Erik O'Connor. All Rights Reserved.
19|
20| This program is free software: you can redistribute it and/or modify
21| it under the terms of the GNU General Public License as published by
22| the Free Software Foundation, either version 3 of the License, or
23| (at your option) any later version.
24|
25| This program is distributed in the hope that it will be useful,
26| but WITHOUT ANY WARRANTY; without even the implied warranty of
27| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28| GNU General Public License for more details.
29|
30| You should have received a copy of the GNU General Public License
31| along with this program. If not, see http://www.gnu.org/licenses/.
32|
33| The author's address is seanerikoconnor!AT!gmail!DOT!com
34| with the !DOT! replaced by . and the !AT! replaced by @
35|
36==============================================================================*/
37
38// Wrap this header file to prevent duplication if it is included
39// accidentally more than once.
40#ifndef __PP_STATISTICS_H__
41#define __PP_STATISTICS_H__
42
43
44/*=============================================================================
45 |
46 | NAME
47 |
48 | OperationCount
49 |
50 | DESCRIPTION
51 |
52 | Class for collecting statistics on operation counts for
53 | factoring and polynomial testing.
54 |
55 +============================================================================*/
56
57class OperationCount
58{
59 public:
60 OperationCount() ;
61
62 ~OperationCount() ;
63
64 OperationCount( const OperationCount & statistics ) ;
65
66 OperationCount & operator=( const OperationCount & statistics ) ;
67
68 friend ostream & operator<<( ostream & , const OperationCount & ) ;
69
70 // Allow direct access to this simple data type for convenience.
71 public:
72 ppuint n ; // Degree of the polynomial.
73 ppuint p ; // Modulus of the polynomial.
74
75 BigInt max_num_possible_poly ; // Number of possible degree n modulo p polynomials.
76 BigInt num_primitive_poly ; // Number of primitive degree n modulo p polynomials.
77 BigInt num_poly_tested ; // Number of polynomials tested.
78
79 BigInt num_gcds ; // Number of gcd computations.
80 BigInt num_primality_tests ; // Number primality tests.
81 BigInt num_squarings ; // Number of squarings.
82 BigInt num_trial_divides ; // Number of trial divisions.
83
84 BigInt num_free_of_linear_factors ; // Number of polynomials which have no linear factors.
85 BigInt num_where_const_coeff_is_primitive_root ; // Number of polynomials whose constant is a primitive root of p.
86 BigInt num_passing_const_coeff_test ; // Number of polynomials whose constant term passes a consistency check.
87 BigInt num_irreducible_to_power ; // Number of polynomials which are of the form irreducible poly to a power >= 1.
88 BigInt num_order_m ; // The number of polynomials which pass the x^m not an integer test.
89 BigInt num_order_r ; // The number of polynomials which pass the x^r = integer test.
90} ;
91
92#endif // __PP_STATISTICS_H__