mohawkjohn/nmatrix — pull request #4 by flipback (2012-07-15 17:52:59+00:00)
Title: Slicing for dense matrix.

I have finished work over the slicing operation for dense matrix.

Now:

```ruby
m = NMatrix(:dense, [3,3], (1..9).to_a)
# Slice and get refernce
r = m[1..2, 1..2] #=> 5 6
8 9
r.is_ref? #=>true
r[1,0..1] # slice and get ref again
#=> 8 9
# Slice and get copy
c = m.slice[1..2, 1..2] #=> 5 6
8 9
c.is_ref? #=>false
c == r #=> true
c.eql?(r ) #=> true! but the method eql? must be rigorous
# if attributes #dtypes, #stypes and #is_ref#
# are different but elements of matrix are equal it must return false

c.dot r # Work! But r will be copping to temp matrix!
c + r # Work also with copping.
...
```
I fixed segmentation bugs. Tested it on ubuntu with ruby1.9.3 for x86 and x64 platform.