You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@systemml.apache.org by "Matthias Boehm (JIRA)" <ji...@apache.org> on 2017/02/09 15:22:41 UTC

[jira] [Resolved] (SYSTEMML-1167) problem with matrix indexing

     [ https://issues.apache.org/jira/browse/SYSTEMML-1167?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matthias Boehm resolved SYSTEMML-1167.
--------------------------------------
       Resolution: Fixed
         Assignee: Matthias Boehm
    Fix Version/s: SystemML 0.13

> problem with matrix indexing
> ----------------------------
>
>                 Key: SYSTEMML-1167
>                 URL: https://issues.apache.org/jira/browse/SYSTEMML-1167
>             Project: SystemML
>          Issue Type: Bug
>          Components: Compiler, Runtime
>            Reporter: Imran Younus
>            Assignee: Matthias Boehm
>             Fix For: SystemML 0.13
>
>
> I've created a recursive QR decomposition algorithm (see https://github.com/apache/incubator-systemml/pull/322). As part of this algorithm I've implemented a function that converts householder matrix to Q:
> {code}
> QfromH = function(Matrix[double] H)
>   return(Matrix[double] Q) {
>     m = nrow(H);
>     n = ncol(H);
>     ones = matrix(1, m, 1);
>     eye = diag(ones);
>     Q = eye[,1:n];
>     for (j in n:1) {
>       v = H[j:m,j]
>       b = as.scalar(2/(t(v) %*% v))
>       Q[j:m, j:n] = Q[j:m, j:n] - (b * v) %*% (t(v) %*% Q[j:m, j:n])
>     }
> }
> {code}
> In this code, I'm initializing {{Q}} from {{eye\[,1:n\]}}. So {{Q}} should be a {{m x n}} matrix with {{m > n}}. This function is called in the base case for the recursive QR algorithm.
> At the first call, the matrix {{Q}} has correct shape. But, in every successive call it become a {{m x m}} matrix instead of {{m x n}} matrix and the algorithm breaks down.
> It turns out that if the compiler optimization level is set to 0, then this problem goes away. Please see the discussion at https://github.com/apache/incubator-systemml/pull/322



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)