Module: NNLS

Defined in:
lib/nnls.rb,
ext/nnls/nnls.c

Class Method Summary collapse

Class Method Details

._nnlsObject



9
# File 'ext/nnls/nnls.c', line 9

static VALUE nnls_method(VALUE self, VALUE A, VALUE b, VALUE Aw, VALUE Ah);

.nnls(a, b, m, n) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/nnls.rb', line 4

def self.nnls(a, b, m, n)
  x, rnorm, status = self._nnls(a, b, m, n)

  case status
  when 2
    raise "The dimensions of the problem are bad (m = 0 or n = 0)"
  when 3
    raise "Iteration count exceeded (more than 3*n iterations)"
  end

  [x, rnorm]
end