This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: package tensor


  Hello,

> I have prepared a package to do tensor manipulation.

  That's very nice! Thank you for the package.

  Now I am working on Ruby/GSL, a Ruby interface to GSL,
http://rubyforge.org/projects/rb-gsl/. I will include 
gsl_tensor support in the next release. It looks like

  yoshiki@maxwell[62] irb   (Ruby command-line interpreter)
  irb(main):001:0> require("gsl")
  irb(main):002:0> t = GSL::Tensor.alloc(2, 3)
  irb(main):003:0> t.set(123, 0, 1, 2)
  irb(main):004:0> t.get(0, 1, 2)
  => 123.0
  irb(main):005:0> t[1, 2, 2] = 9   # simple form
  irb(main):006:0> t[1, 2, 2]
  => 9.0

  A remark and a bug:

  * gsl_tensor_max_index() and other related functions
	store the results in a pointer to int*, but it must 
	be size_t* (conflict position2index()).
  * in gsl_tensor_copy(),
       memcpy(t->data, tt->data, tt->size);
       --->  memcpy(t->data, tt->data, sizeof(BASE)*tt->size);

  Yoshiki


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]