code: public void solve(DenseMatrix B) {
          if (B.nrows() != L.nrows()) {
              throw new IllegalArgumentException(String.format("Row dimensions do not agree: A is %d x %d, but B is %d x %d", L.nrows(), L.ncols(), B.nrows(), B.ncols()));
          }
  
          intW info = new intW(0);
          LAPACK.getInstance().dpotrs(NLMatrix.Lower, L.nrows(), B.ncols(), L.data(), L.ld(), B.data(), B.ld(), info);
  
          if (info.val < 0) {
              logger.error("LAPACK DPOTRS error code: {}", info.val);
              throw new IllegalArgumentException("LAPACK DPOTRS error code: " + info.val);
          }
      }
docs: Solve the linear system A * X = B. On output, B will be overwritten with
  the solution matrix.
  @param  B   the right hand side of linear systems.