Sha256: d5e4a694c99459def48c2a607f0bd529b064ed3d4693063e029e708108ebefff

Contents?: true

Size: 569 Bytes

Versions: 2

Compression:

Stored size: 569 Bytes

Contents

$:.unshift(File.dirname(__FILE__)+'/../lib/')
require 'statsample'
require 'test/unit'
class StatsampleGSLTestCase < Test::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)
    end
  end
end


Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
statsample-0.7.0 test/test_gsl.rb
statsample-0.6.7 test/test_gsl.rb