extendmatrix 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,6 @@
1
+ === 0.2.2 / 2010-05-05
2
+ * Bug fix on Matrix#dup. Doesn't works on Ruby1.9.2
3
+
1
4
  === 0.2.1 / 2010-05-05
2
5
 
3
6
  * Works on Ruby 1.9.2. Fixed conflicts between old and new Matrix implementation
@@ -217,7 +217,7 @@ end
217
217
 
218
218
  class Matrix
219
219
 
220
- EXTENSION_VERSION="0.2.1"
220
+ EXTENSION_VERSION="0.2.2"
221
221
  include Enumerable
222
222
 
223
223
  attr_reader :rows, :wrap
@@ -312,10 +312,10 @@ class Matrix
312
312
  end
313
313
 
314
314
  #
315
- # Return a duplicate matrix
315
+ # Return a duplicate matrix, with all elements copied
316
316
  #
317
317
  def dup
318
- super
318
+ (self.class).rows(self.rows.dup)
319
319
  end
320
320
 
321
321
  def initialize_copy(orig)
@@ -238,7 +238,13 @@ describe "Matrix class extension:" do
238
238
  [0, 0, 0, 3]]
239
239
  Matrix.diag(m2, m2).should == a2
240
240
  end
241
-
241
+ it "dup" do
242
+ m=Matrix.build(4, 3){|i, j| i * 3 + j +1}
243
+ mm=m.dup
244
+ mm.object_id.should_not==m.object_id
245
+ m[0,0]=10
246
+ mm[0,0].should_not==m[0,0]
247
+ end
242
248
  it "equal_in_delta" do
243
249
  m = Matrix.build(4, 3){|i, j| i * 3 + j +1}
244
250
  Matrix.equal_in_delta?(m, m).should == true
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 1
9
- version: 0.2.1
8
+ - 2
9
+ version: 0.2.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Cosmin Bonchis
metadata.gz.sig CHANGED
Binary file