stretchy NVector

Discussion in 'Ruby' started by Joel VanderWerf, Jun 30, 2008.

  1. Anyone know a way to make a NVector (from the narray extension)
    stretchy, i.e. support #push or #<< ?

    irb(main):001:0> v = NVector.float(1)
    => NVector.float(1):
    [ 0.0 ]
    irb(main):002:0> v << 1.0
    NoMethodError: undefined method `<<' for NVector.float(1):
    [ 0.0 ]:NVector
    from (irb):2

    The answer can't involve realloc on every append. Some kind of exp
    growth (like ruby arrays) would be fine.

    I'm looking for an efficient way to log float data in memory.

    --
    vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
     
    Joel VanderWerf, Jun 30, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Silkster

    CSS 3 Col stretchy layouts

    Silkster, Oct 5, 2006, in forum: HTML
    Replies:
    5
    Views:
    369
    Ed Mullen
    Oct 6, 2006
  2. Replies:
    3
    Views:
    867
    Neredbojias
    Feb 25, 2007
Loading...

Share This Page