@@ -189,12 +189,12 @@ def pretty_print(q) #:nodoc:
189
189
end
190
190
end
191
191
else # dim 2
192
- q . group ( 0 , "\n [\n " , "]" ) do
192
+ q . group ( 0 , "\n [\n " , "]" ) do
193
193
self . each_row . with_index do |row , i |
194
- q . group ( 1 , " [" , "]" ) do
194
+ q . group ( 1 , " [" , "]\n " ) do
195
195
q . seplist ( self . dim > 2 ? row . to_a [ 0 ] : row . to_a , lambda { q . text ", " } , :each_with_index ) { |v , j | q . text v . inspect . rjust ( longest [ j ] ) }
196
196
end
197
- q . breakable
197
+ q . breakable unless i == self . shape [ 0 ] - 1
198
198
end
199
199
end
200
200
end
@@ -269,14 +269,14 @@ def cols
269
269
end
270
270
271
271
# Return the main diagonal or antidiagonal a matrix. Only works with 2D matrices.
272
- #
272
+ #
273
273
# == Arguments
274
- #
275
- # * +main_diagonal+ - Defaults to true. If passed 'false', then will return the
274
+ #
275
+ # * +main_diagonal+ - Defaults to true. If passed 'false', then will return the
276
276
# antidiagonal of the matrix.
277
- #
277
+ #
278
278
# == References
279
- #
279
+ #
280
280
# * http://en.wikipedia.org/wiki/Main_diagonal
281
281
def diagonal main_diagonal = true
282
282
diag_size = [ cols , rows ] . min
@@ -367,9 +367,9 @@ def complex_dtype?
367
367
368
368
##
369
369
# call-seq:
370
- #
370
+ #
371
371
# object_dtype?() -> Boolean
372
- #
372
+ #
373
373
# Checks if dtype is a ruby object
374
374
def object_dtype?
375
375
dtype == :object
@@ -960,9 +960,9 @@ def inject(sym)
960
960
return self . map_stored . inject ( sym )
961
961
end
962
962
963
- # Returns the index of the first occurence of the specified value. Returns
963
+ # Returns the index of the first occurence of the specified value. Returns
964
964
# an array containing the position of the value, nil in case the value is not found.
965
- #
965
+ #
966
966
def index ( value )
967
967
index = nil
968
968
@@ -972,7 +972,7 @@ def index(value)
972
972
index = yields
973
973
break
974
974
end
975
- end
975
+ end
976
976
977
977
index
978
978
end
@@ -995,7 +995,7 @@ def clone_structure(capacity = nil)
995
995
#
996
996
# call-seq:
997
997
# repeat(count, axis) -> NMatrix
998
- #
998
+ #
999
999
# * *Arguments* :
1000
1000
# - +count+ -> how many times NMatrix should be repeated
1001
1001
# - +axis+ -> index of axis along which NMatrix should be repeated
0 commit comments