diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/LaFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/LaFunctions.java index 0cdad307d44951f8edddcd7751e223e7021d07f4..91c039ad0705d796950f313cfbeedf458a6689d3 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/LaFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/LaFunctions.java @@ -593,7 +593,7 @@ public class LaFunctions { } RDoubleVector result = (RDoubleVector) copyAttributesNode.execute(RDataFactory.createDoubleVector(aData, RDataFactory.INCOMPLETE_VECTOR), aIn); - setPivotAttrNode.execute(result, RRuntime.asLogical(piv)); + setPivotAttrNode.execute(result, RDataFactory.createIntVector(ipiv, false)); setRankAttrNode.execute(result, rank[0]); RList dn = getDimNamesNode.getDimNames(aIn); if (dn != null && dn.getDataAt(0) != null) { diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test index 0a6b1dce988003c6e5dcf6359cbe5a521c00005e..f31cfed5fb3c0f292ac3699c95a5ca4bbe4139c2 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test @@ -15467,6 +15467,16 @@ Error in chartr(c("abq"), "cd", c("agbc", "efb")) : Error in chartr(c(3, 2), c("q", "c"), c("abc", "efb")) : invalid 'old' argument +##com.oracle.truffle.r.test.builtins.TestBuiltin_chol.testChol# +#chol(matrix(c(4,2,2,3), ncol=2), pivot=TRUE) + [,1] [,2] +[1,] 2 1.000000 +[2,] 0 1.414214 +attr(,"pivot") +[1] 1 2 +attr(,"rank") +[1] 2 + ##com.oracle.truffle.r.test.builtins.TestBuiltin_chol.testChol# #{ chol(1) } [,1] diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_chol.java b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_chol.java index 508e6d1cc407060bc558b83507de440a65131a5d..480ddc86a6debe0dd04128851cd69ef42d2b555b 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_chol.java +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_chol.java @@ -44,5 +44,6 @@ public class TestBuiltin_chol extends TestBase { // the leading minor of order 2 is not positive definite // FastR output: Error in chol.default(m) : error code 2 from Lapack routine 'dpotrf' assertEval(Output.IgnoreErrorMessage, "{ m <- matrix(c(5,-5,-5,3),2,2) ; chol(m) }"); + assertEval("chol(matrix(c(4,2,2,3), ncol=2), pivot=TRUE)"); } }