<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re:permutation vector from getrf when matrix is rank deficient in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/permutation-vector-from-getrf-when-matrix-is-rank-deficient/m-p/1589465#M36039</link>
    <description>&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Here are the lapack's developer comments:&lt;/P&gt;&lt;P&gt;"I think the user is erroneously expecting the IPIV array to be an explicit permutation of (1,…,n) where repetition of index would be an error. The rank-deficient comment is unrelated to the format LAPACK uses.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;LAPACK uses the IPIV array to encode a permutation as a product of transpositions, such a representation naturally arises out of gaussian elimination with pivoting. Assuming Fortran style indexing, the permutation can be written in cycle notation (composition going from left to right) as &lt;/LI&gt;&lt;LI&gt; &lt;SPAN style="font-family: Consolas;"&gt;(1, ipiv[1])&lt;/SPAN&gt;&lt;SPAN style="font-family: &amp;quot;Segoe UI Symbol&amp;quot;, sans-serif;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas;"&gt;(2, ipiv[2]) ... (n, ipiv[n])&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;Our documentation for getrf has a terse explanation for IPIV:&lt;/LI&gt;&lt;LI&gt; &lt;SPAN style="font-family: Consolas;"&gt;ipiv&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas;"&gt;Array, size at least max(1,min(m,n)). Contains the pivot indices; for 1 ≤ i ≤ min(m,n), &lt;/SPAN&gt;&lt;STRONG style="font-family: Consolas;"&gt;row i was interchanged with row ipiv(i).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;This representation is common in LAPACK, though we do not have any exhaustive list.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 16 Apr 2024 05:14:02 GMT</pubDate>
    <dc:creator>Gennady_F_Intel</dc:creator>
    <dc:date>2024-04-16T05:14:02Z</dc:date>
    <item>
      <title>permutation vector from getrf when matrix is rank deficient</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/permutation-vector-from-getrf-when-matrix-is-rank-deficient/m-p/1586928#M35995</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When using "getrf" for factorizing squared symmetric matrices I have come across permutation vectors as output which contain repeated values and may not cover all columns/rows of the input matrix. This seems to happen only when the input matrix is rank deficient.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It appears as if a permutation matrix P usable in A=PLU cannot be obtained directly from such vector.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I could recover a usable permutation vector (i.e. a vector from which a permutation matrix can be build) such that A=PLU after studying the "asPerm" C code in "Matrix" package of "R", which makes use of the the system Lapack installation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A C++ example rebuild from the would be:&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;#include &amp;lt;array&amp;gt;
int main(){
  //p is a potential output from getrf for a 10x10 matrix
  auto p=std::array&amp;lt;int,10&amp;gt;{2,9,7,9,7,1,5,5,6,9};
  //ip will eventually contain the permutation vector covering columns 0 to 9
  auto ip=std::array&amp;lt;int,10&amp;gt;{0,1,2,3,4,5,6,7,8,9};
  //r is the permutation vector sought
  auto r=std::array&amp;lt;int,10&amp;gt;{2,5,7,1,0,4,8,6,9,3};
  //build permutation vector
  for(int j=0;j&amp;lt;ip.size();++j){
    if(p[j]!=j) std::swap(ip[p[j]],ip[j]);
  }
  //check whether results againts vector sought
  for(int j=0;j&amp;lt;ip.size();++j){
    if(ip[j]!=r[j]) return(1);
  }
  return(0);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What remains unclear to me is the purpose the initial representation of the permutation using repeated numbers.&lt;/P&gt;&lt;P&gt;Google didn't give much results.&lt;/P&gt;&lt;P&gt;s there any documentation/explanation?&lt;/P&gt;&lt;P&gt;And is this representation limited to "getrf"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Apr 2024 10:30:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/permutation-vector-from-getrf-when-matrix-is-rank-deficient/m-p/1586928#M35995</guid>
      <dc:creator>may_ka</dc:creator>
      <dc:date>2024-04-06T10:30:04Z</dc:date>
    </item>
    <item>
      <title>Re:permutation vector from getrf when matrix is rank deficient</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/permutation-vector-from-getrf-when-matrix-is-rank-deficient/m-p/1589465#M36039</link>
      <description>&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Here are the lapack's developer comments:&lt;/P&gt;&lt;P&gt;"I think the user is erroneously expecting the IPIV array to be an explicit permutation of (1,…,n) where repetition of index would be an error. The rank-deficient comment is unrelated to the format LAPACK uses.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;LAPACK uses the IPIV array to encode a permutation as a product of transpositions, such a representation naturally arises out of gaussian elimination with pivoting. Assuming Fortran style indexing, the permutation can be written in cycle notation (composition going from left to right) as &lt;/LI&gt;&lt;LI&gt; &lt;SPAN style="font-family: Consolas;"&gt;(1, ipiv[1])&lt;/SPAN&gt;&lt;SPAN style="font-family: &amp;quot;Segoe UI Symbol&amp;quot;, sans-serif;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas;"&gt;(2, ipiv[2]) ... (n, ipiv[n])&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;Our documentation for getrf has a terse explanation for IPIV:&lt;/LI&gt;&lt;LI&gt; &lt;SPAN style="font-family: Consolas;"&gt;ipiv&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas;"&gt;Array, size at least max(1,min(m,n)). Contains the pivot indices; for 1 ≤ i ≤ min(m,n), &lt;/SPAN&gt;&lt;STRONG style="font-family: Consolas;"&gt;row i was interchanged with row ipiv(i).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;This representation is common in LAPACK, though we do not have any exhaustive list.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Apr 2024 05:14:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/permutation-vector-from-getrf-when-matrix-is-rank-deficient/m-p/1589465#M36039</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2024-04-16T05:14:02Z</dc:date>
    </item>
  </channel>
</rss>

