Sha256: c597f9fa69dbe9938a236ff32f8c3c0bb660a53815df4c81e116e05598648d15

Contents?: true

Size: 583 Bytes

Versions: 13

Compression:

Stored size: 583 Bytes

Contents

require(File.dirname(__FILE__)+'/helpers_tests.rb')


class StatsampleGSLTestCase < MiniTest::Unit::TestCase
  def test_matrix_to_gsl
    if Statsample.has_gsl?
      a=[1,2,3,4,20].to_vector(:scale)
      b=[3,2,3,4,50].to_vector(:scale)
      c=[6,2,3,4,3].to_vector(:scale)
      ds={'a'=>a,'b'=>b,'c'=>c}.to_dataset
      gsl=ds.to_matrix.to_gsl
      assert_equal(5,gsl.size1)
      assert_equal(3,gsl.size2)
      matrix=gsl.to_matrix
      assert_equal(5,matrix.row_size)
      assert_equal(3,matrix.column_size)
    else
      skip("Needs GSL extension")
    end
  end
end


Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
statsample-0.18.0 test/test_gsl.rb
statsample-0.17.0 test/test_gsl.rb
statsample-0.16.0 test/test_gsl.rb
statsample-0.15.1 test/test_gsl.rb
statsample-0.15.0 test/test_gsl.rb
statsample-0.14.1 test/test_gsl.rb
statsample-0.14.0 test/test_gsl.rb
statsample-0.13.1 test/test_gsl.rb
statsample-0.13.0 test/test_gsl.rb
statsample-0.12.0 test/test_gsl.rb
statsample-0.11.2 test/test_gsl.rb
statsample-0.11.1 test/test_gsl.rb
statsample-0.11.0 test/test_gsl.rb