class RQRCodeCore::QRPolynomial
Experimental RBS support (using type sampling data from the type_fusion
project).
# sig/rqrcode_core/qrcode/qr_polynomial.rbs class RQRCodeCore::QRPolynomial def get: (Integer index) -> Integer? def get_length: () -> untyped def initialize: (Array[Integer] num, Integer shift) -> void def mod: (RQRCodeCore::QRPolynomial e) -> RQRCodeCore::QRPolynomial def multiply: (RQRCodeCore::QRPolynomial e) -> RQRCodeCore::QRPolynomial end
def get(index)
Experimental RBS support (using type sampling data from the type_fusion
project).
def get: (Integer index) -> Integer?
This signature was generated using 307 samples from 1 application.
def get(index) @num[index] end
def get_length
Experimental RBS support (using type sampling data from the type_fusion
project).
def get_length: () -> untyped
This signature was generated using 23 samples from 1 application.
def get_length @num.size end
def initialize(num, shift)
Experimental RBS support (using type sampling data from the type_fusion
project).
def initialize: ((Integer | Integer | Integer | Integer | Integer | Integer | Integer | Integer | Integer | Integer | Integer | Integer | Integer | Integer | Integer | Integer | Integer) num, Integer shift) -> void
This signature was generated using 8 samples from 1 application.
def initialize(num, shift) raise QRCodeRunTimeError, "#{num.size}/#{shift}" if num.empty? offset = 0 while offset < num.size && num[offset] == 0 offset += 1 end @num = Array.new(num.size - offset + shift) (0...num.size - offset).each do |i| @num[i] = num[i + offset] end end
def mod(e)
Experimental RBS support (using type sampling data from the type_fusion
project).
def mod: (RQRCodeCore::QRPolynomial e) -> RQRCodeCore::QRPolynomial
This signature was generated using 1 sample from 1 application.
def mod(e) if get_length - e.get_length < 0 return self end ratio = QRMath.glog(get(0)) - QRMath.glog(e.get(0)) num = Array.new(get_length) (0...get_length).each do |i| num[i] = get(i) end (0...e.get_length).each do |i| tmp = num[i].nil? ? 0 : num[i] num[i] = tmp ^ QRMath.gexp(QRMath.glog(e.get(i)) + ratio) end QRPolynomial.new(num, 0).mod(e) end
def multiply(e)
Experimental RBS support (using type sampling data from the type_fusion
project).
def multiply: (RQRCodeCore::QRPolynomial e) -> RQRCodeCore::QRPolynomial
This signature was generated using 3 samples from 1 application.
def multiply(e) num = Array.new(get_length + e.get_length - 1) (0...get_length).each do |i| (0...e.get_length).each do |j| tmp = num[i + j].nil? ? 0 : num[i + j] num[i + j] = tmp ^ QRMath.gexp(QRMath.glog(get(i)) + QRMath.glog(e.get(j))) end end QRPolynomial.new(num, 0) end