Sha256: 267386716800d26e6b972b48b6ed3186b5be68a0180f079adddd025ffb39dc58

Contents?: true

Size: 294 Bytes

Versions: 22

Compression:

Stored size: 294 Bytes

Contents

#!/usr/bin/env ruby
require("gsl")

v = GSL::Vector.alloc(1, 2, 6, 7, 8, 9, 3, 4, 5)

p v.heapsort { |a, b|
  b <=> a
}
p v

p v.heapsort! { |a, b|
  b <=> a
}
p v

v = GSL::Vector.alloc(1, 2, 6, 7, 8, 9, 3, 4, 5)
p v.heapsort_index { |a, b|
  a <=> b
}

p GSL.heapsort(v) { |a, b|
  b <=> a
}

Version data entries

22 entries across 22 versions & 4 rubygems

Version Path
gsl-2.1.0.3 examples/sort/heapsort.rb
gsl-2.1.0.2 examples/sort/heapsort.rb
gsl-2.1.0.1 examples/sort/heapsort.rb
gsl-2.1.0 examples/sort/heapsort.rb
gsl-1.16.0.6 examples/sort/heapsort.rb
rb-gsl-1.16.0.5 examples/sort/heapsort.rb
rb-gsl-1.16.0.4 examples/sort/heapsort.rb
rb-gsl-1.16.0.3 examples/sort/heapsort.rb
rb-gsl-1.16.0.3.rc1 examples/sort/heapsort.rb
gsl-nmatrix-1.15.3.2 examples/sort/heapsort.rb
gsl-nmatrix-1.15.3.1 examples/sort/heapsort.rb
rb-gsl-1.16.0.2 examples/sort/heapsort.rb
rb-gsl-1.16.0.1 examples/sort/heapsort.rb
rb-gsl-1.16.0 examples/sort/heapsort.rb
rb-gsl-1.15.3.2 examples/sort/heapsort.rb
rb-gsl-1.15.3.1 examples/sort/heapsort.rb
blackwinter-gsl-1.15.3.2 examples/sort/heapsort.rb
gsl-nmatrix-1.15.3.0 examples/sort/heapsort.rb
gsl-1.15.3 examples/sort/heapsort.rb
gsl-1.14.7 examples/sort/heapsort.rb