Closed MitsunChieh closed 7 years ago
@MitsunChieh What's your usecase? Even being the author of the comment in the method, it is hard for me currently to imagine an abastract situation :)
Maybe you can replace the nil
values with 0
in the resulting vector using replace_nils
.
http://www.rubydoc.info/gems/daru/0.1.5/Daru/Vector#replace_nils-instance_method
In https://github.com/SciRuby/daru/blob/master/lib/daru/maths/arithmetic/vector.rb#L65
Two vectors with same index can be added. But if one vector has the index and the other one doesn't, it will return nil. Can some other methods just set the nil value as zero, so that they can be added?