summaryrefslogtreecommitdiff
path: root/factor_info.go
diff options
context:
space:
mode:
Diffstat (limited to 'factor_info.go')
-rw-r--r--factor_info.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/factor_info.go b/factor_info.go
index 62c3524..d2c9fc0 100644
--- a/factor_info.go
+++ b/factor_info.go
@@ -10,7 +10,7 @@ import (
// FactorInfo contains all of the information this program
// calculates about a radix.
-type FactorInfo struct {
+type factorInfo struct {
// The radix this info is about
Radix uint
// A representation of this radix as a product of prime numbers.
@@ -58,7 +58,7 @@ const (
maxExtended = 1 << 32
)
-func GetFactorInfo(radix uint, fullMap bool, largeCalc bool) *FactorInfo {
+func getFactorInfo(radix uint, fullMap bool, largeCalc bool) *factorInfo {
r_factors := factors.Factors(radix)
slices.Sort(r_factors)
@@ -89,13 +89,13 @@ func GetFactorInfo(radix uint, fullMap bool, largeCalc bool) *FactorInfo {
totativeCount := factors.Totient(radix)
totativeRatio := float64(totativeCount) / float64(radix)
- return &FactorInfo{radix, factors.PrimeFactorize(radix),
+ return &factorInfo{radix, factors.PrimeFactorize(radix),
r_factors, factors.Score(radix), totativeCount, totativeRatio,
factors.BasicRank(radix), r_type_ptr, mtc_ptr,
math.Log(float64(radix)), digitMap}
}
-func (fi *FactorInfo) WriteTo(w io.Writer) {
+func (fi *factorInfo) writeTo(w io.Writer) {
fmt.Fprintln(w, fi.Radix, "=", fi.PrimeFactorization)
fmt.Fprintf(w, "Factors: %v (Score: %.4f)\n", fi.Factors, fi.Score)
fmt.Fprintln(w, "2345 Rank:", fi.BasicRank)
@@ -119,7 +119,7 @@ func (fi *FactorInfo) WriteTo(w io.Writer) {
}
}
-func (fi *FactorInfo) WriteToCompact(w io.Writer) {
+func (fi *factorInfo) writeToCompact(w io.Writer) {
fmt.Fprintf(w, "%d = %s | σ(n)/n: %.2f | φ(n)/n: %.3f\n",
fi.Radix, fi.PrimeFactorization, fi.Score, fi.TotativeRatio)
if fi.Type != nil {