Sha256: df70e450cbd497171ecf696ebbbb6c6474de88be98d47678de6e841dde74b6fe

Contents?: true

Size: 1.49 KB

Versions: 7

Compression:

Stored size: 1.49 KB

Contents

require File.expand_path(File.dirname(__FILE__)) + '/spec_helper.rb'

describe MPFR::Matrix, "when marshaling" do
  before(:all) do
    MPFR.set_default_prec(128)
  end

  it "should be restore" do
    row = 8
    column = 3
    args = GenerateNumber.float_matrix_arguments(1000, row, column).map{ |a| MPFR::Matrix.new(a) }
    args.each do |m|
      m2 = Marshal.load(Marshal.dump(m))
      m2.should == m
    end
  end
end

describe MPFR::SquareMatrix, "when marshaling" do
  before(:all) do
    MPFR.set_default_prec(128)
  end

  it "should be restore" do
    row = 4
    column = 4
    args = GenerateNumber.float_matrix_arguments(1000, row, column).map{ |a| MPFR::SquareMatrix.new(a) }
    args.each do |m|
      m2 = Marshal.load(Marshal.dump(m))
      m2.should == m
    end
  end
end

describe MPFR::ColumnVector, "when marshaling" do
  before(:all) do
    MPFR.set_default_prec(128)
  end

  it "should be restore" do
    row = 1
    column = 6
    args = GenerateNumber.float_matrix_arguments(1000, row, column).map{ |a| MPFR::ColumnVector.new(a[0]) }
    args.each do |m|
      m2 = Marshal.load(Marshal.dump(m))
      m2.should == m
    end
  end
end

describe MPFR::RowVector, "when marshaling" do
  before(:all) do
    MPFR.set_default_prec(128)
  end

  it "should be restore" do
    row = 1
    column = 6
    args = GenerateNumber.float_matrix_arguments(1000, row, column).map{ |a| MPFR::RowVector.new(a[0]) }
    args.each do |m|
      m2 = Marshal.load(Marshal.dump(m))
      m2.should == m
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ruby-mpfr-0.0.14 spec/mpfr_matrix/mpfr_matrix_marshal_spec.rb
ruby-mpfr-0.0.13 spec/mpfr_matrix/mpfr_matrix_marshal_spec.rb
ruby-mpfr-0.0.12 spec/mpfr_matrix/mpfr_matrix_marshal_spec.rb
ruby-mpfr-0.0.11 spec/mpfr_matrix/mpfr_matrix_marshal_spec.rb
ruby-mpfr-0.0.10 spec/mpfr_matrix/mpfr_matrix_marshal_spec.rb
ruby-mpfr-0.0.9 spec/mpfr_matrix/mpfr_matrix_marshal_spec.rb
ruby-mpfr-0.0.8 spec/mpfr_matrix/mpfr_matrix_marshal_spec.rb