Method: CArray#lu_solve

Defined in:
lib/carray-gsl/core.rb

#lu_solve(b) ⇒ Object



108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/carray-gsl/core.rb', line 108

def lu_solve (b)
  if self["@LU"]
    CArray.attach(self, b) {
      lu   = self["@LU"]
      perm = self["@perm"]
      return GSL::Linalg::LU.solve(lu, perm, b.gv).ca.v
    }
  else
    CArray.attach(self, b) {
      return GSL::Linalg::LU.solve(self.gm, b.gv).ca.v
    }
  end
end