Class: GSL4r::Block::GSL_Block

Inherits:
FFI::Struct
  • Object
show all
Includes:
Util::AutoPrefix
Defined in:
lib/gsl4r/block.rb

Constant Summary collapse

GSL_PREFIX =
"gsl_block_"
GSL_MODULE =
::GSL4r::Block

Instance Method Summary collapse

Methods included from Util::AutoPrefix

#method_missing

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class GSL4r::Util::AutoPrefix

Instance Method Details

#get_data(a_block) ⇒ Object



30
31
32
# File 'lib/gsl4r/block.rb', line 30

def get_data( a_block )
  return a_block.get_array_of_double(1,get_size(a_block))
end

#get_size(a_block) ⇒ Object



26
27
28
# File 'lib/gsl4r/block.rb', line 26

def get_size( a_block )
  return a_block.get_ulong(0)
end

#set_data(a_block, some_data) ⇒ Object



34
35
36
37
38
39
# File 'lib/gsl4r/block.rb', line 34

def set_data( a_block, some_data )
  if ( some_data.length >= get_size(a_block) )
    raise "data exceeds size of block"
  end
  a_block.put_array_of_double(1,some_data)
end