Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/9413#discussion_r44046167
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/linalg/CholeskyDecomposition.scala 
---
    @@ -40,4 +40,20 @@ private[spark] object CholeskyDecomposition {
         assert(code == 0, s"lapack.dpotrs returned $code.")
         bx
       }
    +
    +  /**
    +   * Computes the inverse of a real symmetric positive definite matrix A
    +   * using the Cholesky factorization A = U**T*U.
    +   * The input arguments are modified in-place to store the inverse matrix.
    +   * @param UAi the upper triangular factor U from the Cholesky 
factorization A = U**T*U
    +   * @param k the dimension of A
    +   * @return the upper triangle of the (symmetric) inverse of A
    +   */
    +  def inverse(UAi: Array[Double], k: Int): Array[Double] = {
    +    val info = new intW(0)
    +    lapack.dpptri("U", k, UAi, info)
    +    val code = info.`val`
    +    assert(code == 0, s"lapack.dpptri returned $code.")
    --- End diff --
    
    This throws an AssertionError on failure.  It'd be better to throw a 
RuntimeError (or one based on the return code, though that may be too much 
trouble).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to