Class: HenselCode::FinitePadicExpansion
- Defined in:
- lib/hensel_code/finite_padic_expansion.rb
Overview
finite p-adic expansion hensel code class
Instance Attribute Summary
Attributes inherited from PAdicBase
#exponent, #hensel_code, #n, #prime, #rational
Instance Method Summary collapse
Methods inherited from PAdicBase
#*, #+, #-, #/, #denominator, #initialize, #numerator, #replace_exponent, #replace_hensel_code, #replace_prime, #replace_rational, #to_r
Methods included from PAdicVerifier
#different_prime_and_different_exponent?, #different_prime_and_same_exponent?, #incompatible_operand_type?, #same_prime_and_different_exponent?, #valid?
Methods included from Tools
#eea_core, #extended_gcd, #mod_inverse, #random_distinct_primes, #random_integer, #random_prime, #random_rational
Constructor Details
This class inherits a constructor from HenselCode::PAdicBase
Instance Method Details
#inspect ⇒ Object
24 25 26 |
# File 'lib/hensel_code/finite_padic_expansion.rb', line 24 def inspect "[HenselCode: #{polynomial_form}, prime: #{prime}, exponent: #{exponent}, modulus: #{modulus}]" end |
#modulus ⇒ Object
6 7 8 |
# File 'lib/hensel_code/finite_padic_expansion.rb', line 6 def modulus prime end |
#to_a ⇒ Object
10 11 12 |
# File 'lib/hensel_code/finite_padic_expansion.rb', line 10 def to_a hensel_code end |
#to_s ⇒ Object
18 19 20 21 22 |
# File 'lib/hensel_code/finite_padic_expansion.rb', line 18 def to_s hensel_code.map.with_index do |h, i| "#{h}#{polynomial_variable(i)}" end.join(" + ") end |
#to_truncated ⇒ Object
14 15 16 |
# File 'lib/hensel_code/finite_padic_expansion.rb', line 14 def to_truncated TruncatedFinitePadicExpansion.new(prime, exponent, rational) end |