def inv(a, driver:"getrf", uplo:'U')
    case driver
    when /(ge|sy|he|po)sv$/
      d = $1
      b = a.new_zeros.eye
      solve(a, b, driver:d, uplo:uplo)
    when /(ge|sy|he)tr[fi]$/
      d = $1
      lu, piv = lu_fact(a)
      lu_inv(lu, piv)
    when /potr[fi]$/
      lu = cho_fact(a, uplo:uplo)
      cho_inv(lu, uplo:uplo)
    else
      raise ArgumentError, "invalid driver: #{driver}"
    end
  end
def inv(a, driver:"getrf", uplo:'U')
    case driver
    when /(ge|sy|he|po)sv$/
      d = $1
      b = a.new_zeros.eye
      solve(a, b, driver:d, uplo:uplo)
    when /(ge|sy|he)tr[fi]$/
      d = $1
      lu, piv = lu_fact(a)
      lu_inv(lu, piv)
    when /potr[fi]$/
      lu = cho_fact(a, uplo:uplo)
      cho_inv(lu, uplo:uplo)
    else
      raise ArgumentError, "invalid driver: #{driver}"
    end
  end
Inverse matrix from square matrix `a`
 @param a [Numo::NArray] n-by-n square matrix  (>= 2-dimensinal NArray)
 @param driver [String or Symbol] choose LAPACK diriver
   ('ge'|'sy'|'he'|'po') + ("sv"|"trf")
   (optional, default='getrf')
 @param uplo [String or Symbol] optional, default='U'. Access upper
   or ('U') lower ('L') triangle. (omitted when driver:"ge")
 @return [Numo::NArray] The inverse matrix.
 @example
   Numo::Linalg.inv(a,driver:'getrf')
   => Numo::DFloat#shape=[2,2]
   [[-2, 1],
    [1.5, -0.5]]
   a.dot(Numo::Linalg.inv(a,driver:'getrf'))
   => Numo::DFloat#shape=[2,2]
   [[1, 0],
    [8.88178e-16, 1]]