Method: CsrMatrix::Functions#round

Defined in:
lib/csrmatrix/functions.rb

#round(ndig = 0) ⇒ Object

FIXME: I’m not sure whats going on here?



41
42
43
44
45
46
47
48
49
50
# File 'lib/csrmatrix/functions.rb', line 41

def round(ndig = 0)
    # identifies the round of a matrix (that is, each value rounded by a specific degree)
    # pre   integer of degree, existing matrix (matrix.not_null?)
    is_invariant?
    # post  rounded array
    for i in 0..self.val.count-1
        self.val[i] = self.val[i].round(ndig)
    end    
    self.val
end