Allow Vector.zero to use T as type

This commit is contained in:
Chris 2019-07-09 20:02:07 -07:00
parent c2e97bbd44
commit c7bc6f4f5e
No known key found for this signature in database
GPG Key ID: 37DAEF5F446370A4
1 changed files with 1 additions and 1 deletions

View File

@ -60,7 +60,7 @@ module Apatite::LinearAlgebra
# Return a zero vector.
def self.zero(size)
raise ArgumentError.new("invalid size (#{size} for 0..)") if size < 0
array = Array.new(size, 0)
array = Array.new(size, T.new(0))
new(array)
end