Module: StairCar::PMatrixCompare
- Included in:
- PMatrix
- Defined in:
- lib/stair_car/pmatrix/compare.rb
Instance Method Summary collapse
- #<(val) ⇒ Object
- #<=(val) ⇒ Object
-
#==(matrix2) ⇒ Object
Compares this matrix to another to see if they are the same (in values).
- #>(val) ⇒ Object
- #>=(val) ⇒ Object
- #any? ⇒ Boolean
- #find(matrix) ⇒ Object
Instance Method Details
#<(val) ⇒ Object
11 12 13 |
# File 'lib/stair_car/pmatrix/compare.rb', line 11 def <(val) map {|v| (v < val) ? 1 : 0 } end |
#<=(val) ⇒ Object
15 16 17 |
# File 'lib/stair_car/pmatrix/compare.rb', line 15 def <=(val) map {|v| (v <= val) ? 1 : 0 } end |
#==(matrix2) ⇒ Object
Compares this matrix to another to see if they are the same (in values)
29 30 31 |
# File 'lib/stair_car/pmatrix/compare.rb', line 29 def ==(matrix2) self.data.equals(matrix2.data) end |
#>(val) ⇒ Object
3 4 5 |
# File 'lib/stair_car/pmatrix/compare.rb', line 3 def >(val) map {|v| (v > val) ? 1 : 0 } end |
#>=(val) ⇒ Object
7 8 9 |
# File 'lib/stair_car/pmatrix/compare.rb', line 7 def >=(val) map {|v| (v >= val) ? 1 : 0 } end |
#any? ⇒ Boolean
23 24 25 |
# File 'lib/stair_car/pmatrix/compare.rb', line 23 def any? @data.cardinality > 0 end |
#find(matrix) ⇒ Object
19 20 21 |
# File 'lib/stair_car/pmatrix/compare.rb', line 19 def find(matrix) end |