Sha256: fafdbaef3a6d9ea2e57341931eed8385a213e6473bb0ec84cbab6c225557c374
Contents?: true
Size: 669 Bytes
Versions: 3
Compression:
Stored size: 669 Bytes
Contents
class MPFR < Numeric @@error = MPFR('1e-12') def self.set_error_of_test(err) @error = err end def self.get_error_of_test @error end def check_error(other, error = nil) (self - other).abs < (error || @@error) end class Matrix def check_error(other, error = nil) err = error || @error column_size.times.all? do |i| row_siize.times.all? do |j| self[i][j].check_error(other[i][j], err) end end end end module Vector def check_error(other, error = nil) err = error || @error size.times.all? do |i| self[i].check_error(other[i], err) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
ruby-mpfr-0.0.17 | lib/mpfr/rspec.rb |
ruby-mpfr-0.0.16 | lib/mpfr/rspec.rb |
ruby-mpfr-0.0.15 | lib/mpfr/rspec.rb |