<?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 Hi Tianxiong, Mecej4,  in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/What-does-the-means-of-struct-matrix-descr-in-mol-sparse-XXX/m-p/1030752#M20124</link>
    <description>&lt;P&gt;Hi Tianxiong, Mecej4,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;You are right, the tr functions in SPMV 2, BLAS 2 -3 &amp;nbsp;are only valid for triangular system.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;sv solving a single triangular system (Level 2)&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;sm solving triangular systems with multiple right-hand sides (Level 3).&amp;nbsp;&lt;/P&gt;

&lt;P&gt;So you can't use it for full sparse matrix. &amp;nbsp;I have asked mkl docs team to add such discription under such functions. Thanks a lot for the raising the question,.&lt;/P&gt;

&lt;P&gt;If you want to&amp;nbsp;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;solve the full matrix equations, you may need to call lapack routines for dense matrix or sparse solver like PARDISO, DSS etc.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Best Regards,&lt;BR /&gt;
	Ying&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 21 Sep 2015 02:08:58 GMT</pubDate>
    <dc:creator>Ying_H_Intel</dc:creator>
    <dc:date>2015-09-21T02:08:58Z</dc:date>
    <item>
      <title>What does the means of struct matrix_descr in mol_sparse_XXX routines?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/What-does-the-means-of-struct-matrix-descr-in-mol-sparse-XXX/m-p/1030747#M20119</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Hi all,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; In many mkl_sparse_XXX routines (version 11.3), there is a a parameter of type matrix_descr, just like :&lt;/P&gt;

&lt;P&gt;sparse_status_t mkl_sparse_s_trsv (sparse_operation_t operation, float alpha, const sparse_matrix_t A, struct matrix_descr descr, const float *x, float *y);&lt;/P&gt;

&lt;P&gt;The explanation of this parameter in manual is:&lt;/P&gt;

&lt;P&gt;descr : Structure specifying sparse matrix properties. ......But it is confusing. Following is the code snippet in MKL example sparse_trsv.c,&lt;BR /&gt;
	&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;   //*******************************************************************************
    //     Declaration and initialization of parameters for sparse representation of
    //     the matrix A in the compressed sparse row format:
    //*******************************************************************************
#define M 5
#define N 5
#define NNZ 13
    //*******************************************************************************
    //    Sparse representation of the matrix A
    //*******************************************************************************
    double csrVal[NNZ]    = { 1.0, -1.0,     -3.0,
                             -2.0,  5.0,
                                         4.0, 6.0, 4.0,
                             -4.0,       2.0, 7.0,
                                    8.0,          -5.0 };
    MKL_INT    csrColInd[NNZ] = { 0,      1,        3,
                              0,      1,
                                           2,   3,   4,
                              0,           2,   3,
                                      1,             4 };
    MKL_INT    csrRowPtr[M+1] = { 0, 3, 5, 8, 11, 13 };
    // Descriptor of main sparse matrix properties
    struct matrix_descr descrA;
    // Structure with sparse matrix stored in CSR format
    sparse_matrix_t       csrA;

......

    // Create matrix descriptor
    descrA.type = SPARSE_MATRIX_TYPE_TRIANGULAR;
    descrA.mode = SPARSE_FILL_MODE_LOWER;
    descrA.diag = SPARSE_DIAG_UNIT;

    // Compute y = alpha * A^{-1} * x
    mkl_sparse_d_trsv ( SPARSE_OPERATION_NON_TRANSPOSE,
                        alpha,
                        csrA,
                        descrA,
                        x,
                        y );
&lt;/PRE&gt;

&lt;P&gt;Obviously, the matrix csrA is not a triangular matrix, and the diagnoal is not unit. Why set the properties of descrA to TRIANGULAR and DIAG_UNIT?&lt;BR /&gt;
	If I change the properties to other option, for example:&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;    descrA.type = SPARSE_MATRIX_TYPE_GENERAL;
    descrA.diag = SPARSE_DIAG_NON_UNIT;
&lt;/PRE&gt;

&lt;P&gt;Now it can not get correct result.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;How to setting the properties of matrix_descr correctly?&lt;/P&gt;

&lt;P&gt;Best regards,&lt;/P&gt;

&lt;P&gt;Tianxiong Lu&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2015 07:32:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/What-does-the-means-of-struct-matrix-descr-in-mol-sparse-XXX/m-p/1030747#M20119</guid>
      <dc:creator>Tianxiong_Lu</dc:creator>
      <dc:date>2015-09-17T07:32:52Z</dc:date>
    </item>
    <item>
      <title>Please read the comments in</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/What-does-the-means-of-struct-matrix-descr-in-mol-sparse-XXX/m-p/1030748#M20120</link>
      <description>&lt;P&gt;Please read the comments in the example file carefully. The examples shows how to extract the lower triangular part L of a square matrix A and do things with L. Note that L is stated to have unit diagonal elements, so only the strictly-lower triangular part of A is used. Here are the relevant comment lines:&lt;/P&gt;

&lt;P&gt;! &amp;nbsp;The test performs the operation&lt;BR /&gt;
	!&lt;BR /&gt;
	! &amp;nbsp; &amp;nbsp; &amp;nbsp; L^{-1}*x = y, using mkl_sparse_d_trsv&lt;BR /&gt;
	!&lt;BR /&gt;
	! &amp;nbsp;then checks the result:&lt;BR /&gt;
	! &amp;nbsp; &amp;nbsp;1. compute:&lt;BR /&gt;
	! &amp;nbsp; &amp;nbsp; &amp;nbsp; L*y = y1, using mkl_sparse_d_mv&lt;BR /&gt;
	!&lt;BR /&gt;
	! &amp;nbsp; &amp;nbsp;2. compare x with y1 - x should be equal y1 (x = L*L^{-1}*x)&lt;BR /&gt;
	!&lt;BR /&gt;
	! &amp;nbsp;Here A is a general sparse matrix&lt;BR /&gt;
	! &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;L is the lower triangular part of matrix A with unit diagonal&lt;BR /&gt;
	! &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;x, y and y1 are vectors&lt;BR /&gt;
	!&lt;/P&gt;

&lt;P&gt;Note that every matrix operation is done with L, rather than with A.&lt;/P&gt;

&lt;P&gt;If, in your application, you have a different set of needs, and you do not need to extract the lower triangular part of an existing matrix, this particular example is probably not the one to look at.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2015 16:34:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/What-does-the-means-of-struct-matrix-descr-in-mol-sparse-XXX/m-p/1030748#M20120</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2015-09-17T16:34:37Z</dc:date>
    </item>
    <item>
      <title>Hi mecej4,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/What-does-the-means-of-struct-matrix-descr-in-mol-sparse-XXX/m-p/1030749#M20121</link>
      <description>&lt;P&gt;Hi mecej4,&lt;/P&gt;

&lt;P&gt;Thank you for this information.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I have noticed the existence of L in comment, but missing the next line:&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;! &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;L is the lower triangular part of matrix A with unit diagonal&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;and I can not find anything about matrix L in example code, so I misunderstand the true idea of example.&lt;/P&gt;

&lt;P&gt;Now, it is work fine. Thanks again.&lt;/P&gt;

&lt;P&gt;Best regards,&lt;/P&gt;

&lt;P&gt;Tianxiong&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2015 02:21:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/What-does-the-means-of-struct-matrix-descr-in-mol-sparse-XXX/m-p/1030749#M20121</guid>
      <dc:creator>Tianxiong_Lu</dc:creator>
      <dc:date>2015-09-18T02:21:07Z</dc:date>
    </item>
    <item>
      <title>Furthmore, I want solve the</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/What-does-the-means-of-struct-matrix-descr-in-mol-sparse-XXX/m-p/1030750#M20122</link>
      <description>&lt;P&gt;Furthmore, I want solve the full matrix equations rather than lower triangular matrix. And I just comment the matrix descriptor code and set its type to SPARSE_MATRIX_TYPE_GENERAL. But, unfortunately, the result is a wrong answer. What's the matter?&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;assert.h&amp;gt;
#include &amp;lt;math.h&amp;gt;
#include "mkl_spblas.h"

int main() {
    //*******************************************************************************
    //     Declaration and initialization of parameters for sparse representation of
    //     the matrix A in the compressed sparse row format:
    //*******************************************************************************
#define M 5
#define N 5
#define NNZ 13
    //*******************************************************************************
    //    Sparse representation of the matrix A
    //*******************************************************************************
    double csrVal[NNZ]    = { 1.0, -1.0,     -3.0,
                             -2.0,  5.0,
                                         4.0, 6.0, 4.0,
                             -4.0,       2.0, 7.0,
                                    8.0,          -5.0 };
    MKL_INT    csrColInd[NNZ] = { 0,      1,        3,
                              0,      1,
                                           2,   3,   4,
                              0,           2,   3,
                                      1,             4 };
    MKL_INT    csrRowPtr[M+1] = { 0, 3, 5, 8, 11, 13 };
    MKL_INT    csrRowEndPtr&lt;M&gt; = { 2, 4, 7, 10, 12 };
    // Descriptor of main sparse matrix properties
    struct matrix_descr descrA;
    // Structure with sparse matrix stored in CSR format
    sparse_matrix_t       csrA;
    //*******************************************************************************
    //    Declaration of local variables:
    //*******************************************************************************
    double x&lt;N&gt;  = { 1.0, 5.0, 1.0, 4.0, 1.0};
    double y&lt;N&gt;  = { 0.0, 0.0, 0.0, 0.0, 0.0};
    double y1&lt;N&gt;  = { 0.0, 0.0, 0.0, 0.0, 0.0};
    double alpha = 1.0, beta = 0.0, error = 0.0;
    MKL_INT    i;

    printf( "\n EXAMPLE PROGRAM FOR mkl_sparse_d_trsv \n" );
    printf( "---------------------------------------------------\n" );
    printf( "\n" );
    printf( "   INPUT DATA FOR mkl_sparse_d_trsv    \n" );
    printf( "   LOWER TRIANGULAR SPARSE MATRIX \n" );
    printf( "   WITH UNIT DIAGONAL             \n" );
    printf( "   ALPHA = %4.1f  BETA = %4.1f    \n", alpha, beta );
    printf( "   SPARSE_OPERATION_NON_TRANSPOSE \n" );
    printf( "   Input vector                   \n" );
    for ( i = 0; i &amp;lt; N; i++ )
    {
        printf( "%7.1f\n", x&lt;I&gt; );
    };

    // Create handle with matrix stored in CSR format
    mkl_sparse_d_create_csr ( &amp;amp;csrA, SPARSE_INDEX_BASE_ZERO,
                                    N,  // number of rows
                                    M,  // number of cols
                                    csrRowPtr,
                                    csrRowPtr+1,
                                    csrColInd,
                                    csrVal );

    // Create matrix descriptor
    //descrA.type = SPARSE_MATRIX_TYPE_TRIANGULAR;
    //descrA.mode = SPARSE_FILL_MODE_LOWER;
    //descrA.diag = SPARSE_DIAG_UNIT;
    descrA.type = SPARSE_MATRIX_TYPE_GENERAL;

    // Compute y = alpha * A^{-1} * x
    mkl_sparse_d_trsv ( SPARSE_OPERATION_NON_TRANSPOSE,
                        alpha,
                        csrA,
                        descrA,
                        x,
                        y );

    printf( "                                   \n" );
    printf( "   OUTPUT DATA FOR mkl_sparse_d_trsv \n" );

    // y should be equal { 1.0, 7.0, 1.0, 6.0, -55.0 }
    for ( i = 0; i &amp;lt; N; i++ )
    {
        printf( "%.8f\n", y&lt;I&gt; );
    };

    // For validation perform y1 = A * y
    mkl_sparse_d_mv ( SPARSE_OPERATION_NON_TRANSPOSE,
                      alpha,
                      csrA,
                      descrA,
                      y,
                      beta,
                      y1 );

    printf( "                                   \n" );
    printf( "   OUTPUT DATA FOR mkl_sparse_d_mv \n" );

    // y should be equal { 1.0, 7.0, 1.0, 6.0, -55.0 }
    for ( i = 0; i &amp;lt; N; i++ )
    {
        printf( "%7.1f\n", y1&lt;I&gt; );
    };

    // Release matrix handle and deallocate matrix
    mkl_sparse_destroy ( csrA );

    for ( i = 0; i &amp;lt; N; i++ )
    {
        error += x&lt;I&gt;-y1&lt;I&gt;;
    };
    if (error &amp;gt; 1e-8)
    {
        printf("\n   VALIDATION FAILED\n");
    } else
    {
        printf("\n   VALIDATION PASSED\n");
    }
    printf( "---------------------------------------------------\n" );
    return 0;
}&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/N&gt;&lt;/N&gt;&lt;/N&gt;&lt;/M&gt;&lt;/PRE&gt;

&lt;P&gt;It give me an unexpected result:&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;   Input vector
    1.0
    5.0
    1.0
    4.0
    1.0

   OUTPUT DATA FOR mkl_sparse_d_trsv
18.00000000
5.00000000
-27.00000000
4.00000000
1.00000000

   OUTPUT DATA FOR mkl_sparse_d_mv
    1.0
  -11.0
  -80.0
  -98.0
   35.0

   VALIDATION FAILED
-------------------------------------------&lt;/PRE&gt;

&lt;P&gt;Correct answer should be&amp;nbsp;&lt;/P&gt;

&lt;P&gt;-2.00148809523810&lt;BR /&gt;
	0.199404761904762&lt;BR /&gt;
	1.73139880952381&lt;BR /&gt;
	-1.06696428571429&lt;BR /&gt;
	0.119047619047619&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2015 09:33:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/What-does-the-means-of-struct-matrix-descr-in-mol-sparse-XXX/m-p/1030750#M20122</guid>
      <dc:creator>Tianxiong_Lu</dc:creator>
      <dc:date>2015-09-18T09:33:28Z</dc:date>
    </item>
    <item>
      <title>As far as I can tell, mkl</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/What-does-the-means-of-struct-matrix-descr-in-mol-sparse-XXX/m-p/1030751#M20123</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 12.195px; line-height: 12.195px;"&gt;As far as I can tell, mkl_sparse_?_trsv() and mkl_sparse_?_trmm() are new in MKL 11.3. The documentation pages for some of these new functions, I feel, need improvement. The "tr" in the function names is significant, standing for "triangular", as is conventional in naming Lapack functions/subroutines. &lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12.195px; line-height: 12.195px;"&gt;My guess is that, in those cases where the operation "op" involves matrix inversion (conceptually, at least), the operand must be &lt;STRONG&gt;triangular &lt;/STRONG&gt;(or, as a special case, diagonal). &lt;EM&gt;These functions cannot solve simultaneous sparse linear equations when the matrix is not triangular&lt;/EM&gt;. For solving sparse linear equations in the general case, when the matrix is square and symmetric or non-symmetric, positive-definite or not, you have to use Pardiso (directly or through the DSS interface).&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12.195px; line-height: 12.195px;"&gt;Intel, please confirm or refute, and please consider revising MKL manual pages (for example, &lt;/SPAN&gt;&lt;A href="https://software.intel.com/en-us/node/590041" target="_blank"&gt;https://software.intel.com/en-us/node/590041&lt;/A&gt;&lt;SPAN style="font-size: 12.195px; line-height: 12.195px;"&gt;&amp;nbsp;) to make this restriction clear. If my conjecture is wrong, we need to be given some guidance on when to use Pardiso and when to use mkl_sparse_?_trsv, and a statement as to why the name contains "tr", in contravention of the normal Lapack naming schemes.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2015 15:13:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/What-does-the-means-of-struct-matrix-descr-in-mol-sparse-XXX/m-p/1030751#M20123</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2015-09-18T15:13:28Z</dc:date>
    </item>
    <item>
      <title>Hi Tianxiong, Mecej4, </title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/What-does-the-means-of-struct-matrix-descr-in-mol-sparse-XXX/m-p/1030752#M20124</link>
      <description>&lt;P&gt;Hi Tianxiong, Mecej4,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;You are right, the tr functions in SPMV 2, BLAS 2 -3 &amp;nbsp;are only valid for triangular system.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;sv solving a single triangular system (Level 2)&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;sm solving triangular systems with multiple right-hand sides (Level 3).&amp;nbsp;&lt;/P&gt;

&lt;P&gt;So you can't use it for full sparse matrix. &amp;nbsp;I have asked mkl docs team to add such discription under such functions. Thanks a lot for the raising the question,.&lt;/P&gt;

&lt;P&gt;If you want to&amp;nbsp;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;solve the full matrix equations, you may need to call lapack routines for dense matrix or sparse solver like PARDISO, DSS etc.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Best Regards,&lt;BR /&gt;
	Ying&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2015 02:08:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/What-does-the-means-of-struct-matrix-descr-in-mol-sparse-XXX/m-p/1030752#M20124</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2015-09-21T02:08:58Z</dc:date>
    </item>
  </channel>
</rss>

