{"action":"created","issue":{"url":"https://api.github.com/repos/Reference-LAPACK/lapack/issues/92","repository_url":"https://api.github.com/repos/Reference-LAPACK/lapack","labels_url":"https://api.github.com/repos/Reference-LAPACK/lapack/issues/92/labels{/name}","comments_url":"https://api.github.com/repos/Reference-LAPACK/lapack/issues/92/comments","events_url":"https://api.github.com/repos/Reference-LAPACK/lapack/issues/92/events","html_url":"https://github.com/Reference-LAPACK/lapack/issues/92","id":192209324,"number":92,"title":"xLASWP: bug for negative INCX","user":{"login":"vladimir-ch","id":1837502,"avatar_url":"https://avatars.githubusercontent.com/u/1837502?v=3","gravatar_id":"","url":"https://api.github.com/users/vladimir-ch","html_url":"https://github.com/vladimir-ch","followers_url":"https://api.github.com/users/vladimir-ch/followers","following_url":"https://api.github.com/users/vladimir-ch/following{/other_user}","gists_url":"https://api.github.com/users/vladimir-ch/gists{/gist_id}","starred_url":"https://api.github.com/users/vladimir-ch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vladimir-ch/subscriptions","organizations_url":"https://api.github.com/users/vladimir-ch/orgs","repos_url":"https://api.github.com/users/vladimir-ch/repos","events_url":"https://api.github.com/users/vladimir-ch/events{/privacy}","received_events_url":"https://api.github.com/users/vladimir-ch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-29T07:39:56Z","updated_at":"2016-11-29T10:05:15Z","closed_at":null,"body":"In DLASWP, `INCX` is the increment for `IPIV` and can be positive or negative. If negative, the swaps are applied from `K2` down to `K1`, otherwise from `K1` to `K2`. From the documentation it is understood that the same elements of `IPIV` are accessed in both cases.\r\n\r\nHowever, the implementation behaves differently. When `INCX>0`, the first accessed element is `K1`, then `K1+INCX`, ... until `K1+(K2-K1)*INCX`. When `INCX<0`, the first accessed element is\r\n```\r\n1+(1-K2)*INCX\r\n```\r\nwhen in fact it should be\r\n```\r\nK1+(K1-K2)*INCX\r\n```\r\nIt seems that the `1` is missing a `K` in front. All the calls to DLASWP with `INCX=-1` luckily use `K1=1` in LAPACK."},"comment":{"url":"https://api.github.com/repos/Reference-LAPACK/lapack/issues/comments/263528357","html_url":"https://github.com/Reference-LAPACK/lapack/issues/92#issuecomment-263528357","issue_url":"https://api.github.com/repos/Reference-LAPACK/lapack/issues/92","id":263528357,"user":{"login":"langou","id":1789628,"avatar_url":"https://avatars.githubusercontent.com/u/1789628?v=3","gravatar_id":"","url":"https://api.github.com/users/langou","html_url":"https://github.com/langou","followers_url":"https://api.github.com/users/langou/followers","following_url":"https://api.github.com/users/langou/following{/other_user}","gists_url":"https://api.github.com/users/langou/gists{/gist_id}","starred_url":"https://api.github.com/users/langou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/langou/subscriptions","organizations_url":"https://api.github.com/users/langou/orgs","repos_url":"https://api.github.com/users/langou/repos","events_url":"https://api.github.com/users/langou/events{/privacy}","received_events_url":"https://api.github.com/users/langou/received_events","type":"User","site_admin":false},"created_at":"2016-11-29T10:05:15Z","updated_at":"2016-11-29T10:05:15Z","body":"Three proposed changes in xLASWP:\r\n\r\n(1) In description, change \r\n`\r\n          K2 is INTEGER\r\n          The last element of IPIV for which a row interchange will\r\n          be done.\r\n`\r\nto\r\n`\r\n          K2 is INTEGER\r\n          (K2-K1+1) is the number of elements of IPIV for which a row\r\n          interchange will be done.\r\n`\r\n\r\n(2) In description, change \r\n`\r\n          IPIV is INTEGER array, dimension (K2*abs(INCX))\r\n          The vector of pivot indices.  Only the elements in positions\r\n          K1 through K2 of IPIV are accessed.\r\n          IPIV(K) = L implies rows K and L are to be interchanged.\r\n`\r\nto\r\n`\r\n          IPIV is INTEGER array, dimension (K1+(K2-K1)*abs(INCX))\r\n          The vector of pivot indices.  Only the elements in positions\r\n          K1 through K1+(K2-K1)*INCX of IPIV are accessed.\r\n          IPIV(K) = L implies rows K and L are to be interchanged.\r\n`\r\n\r\n(3) In code, change line 146 (as Vladimir suggests)\r\n`\r\n          IX0 = 1 + ( 1-K2 )*INCX\r\n`\r\nto\r\n` \r\n         IX0 = K1 + ( K1-K2 )*INCX\r\n`"}}
{"actor":{"display_login":"langou"}}