Feature #10069 » implement_negate_for_matrix.patch
| NEWS | ||
|---|---|---|
|
by deleting the specified row and column.
|
||
|
* Matrix#cofactor(row, column) returns the (row, column) cofactor
|
||
|
which is obtained by multiplying the first minor by (-1)**(row + column).
|
||
|
* Matrix#@+ and Matrix#@- .
|
||
|
* Method
|
||
|
* New methods:
|
||
| lib/matrix.rb | ||
|---|---|---|
|
# * #inv
|
||
|
# * #**
|
||
|
# * #+@
|
||
|
# * #-@
|
||
|
#
|
||
|
# Matrix functions:
|
||
|
# * #determinant
|
||
| ... | ... | |
|
self
|
||
|
end
|
||
|
def -@
|
||
|
collect {|e| -e }
|
||
|
end
|
||
|
#--
|
||
|
# MATRIX FUNCTIONS -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
||
|
#++
|
||
| test/matrix/test_matrix.rb | ||
|---|---|---|
|
assert_equal(@m1, +@m1)
|
||
|
end
|
||
|
def test_negate
|
||
|
assert_equal(Matrix[[-1, -2, -3], [-4, -5, -6]], -@m1)
|
||
|
assert_equal(@m1, -(-@m1))
|
||
|
end
|
||
|
def test_rank
|
||
|
[
|
||
|
[[0]],
|
||
- « Previous
- 1
- 2
- Next »