<?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 vl, vu in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/problem-with-LAPACKE-dstemr/m-p/1167123#M28310</link>
    <description>&lt;P&gt;vl,&amp;nbsp;vu&lt;/P&gt;&lt;P&gt;If&amp;nbsp;range&amp;nbsp;=&amp;nbsp;'V', the lower and upper bounds of the interval to be searched for eigenvalues. Constraint:&amp;nbsp;vl&amp;lt;vu.&lt;/P&gt;</description>
    <pubDate>Mon, 11 Mar 2019 13:17:44 GMT</pubDate>
    <dc:creator>Gennady_F_Intel</dc:creator>
    <dc:date>2019-03-11T13:17:44Z</dc:date>
    <item>
      <title>problem with LAPACKE_dstemr</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/problem-with-LAPACKE-dstemr/m-p/1167122#M28309</link>
      <description>&lt;P&gt;Hello! I am trying to use the function 'LAPACKE_dstemr' with a symmetric&amp;nbsp;tridiagonal matrix 'T' but my code crashes.&amp;nbsp; The&amp;nbsp; matrix T (dimxdim) in general has the following form:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp;1.0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp;|&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | a&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;b&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;a &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp;|&lt;BR /&gt;T =&amp;nbsp;&amp;nbsp; |&amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;a&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;b&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; a&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; 0&amp;nbsp; &amp;nbsp;| *tau&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;a&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;b&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a&amp;nbsp; |&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;a&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1.0|&lt;/P&gt;&lt;P&gt;where a = -phi1, b=(1.0 + phi1^2)&lt;/P&gt;&lt;P&gt;Let&amp;nbsp; for example that coefs=[phi1 tau]=[0.7 1] and&amp;nbsp;&amp;nbsp;dim=200. I want to compute all the eigenvalues and eigenvectors. I cant find an example with this function, please could you tell me what I am doing wrong. My mex-code is the following. Thank you very much.&lt;/P&gt;
&lt;PRE class="brush:; class-name:dark;"&gt;#include &amp;lt;math.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;mkl.h&amp;gt;
#include "mkl_vml.h"
#include "mex.h"
#include "matrix.h"
#include "mkl_vsl.h"
#include &amp;lt;string.h&amp;gt; /* is needed for the function 'strcmp' */

/* Auxiliary routines prototypes */
extern void print_matrix( char* desc, MKL_INT m, MKL_INT n, double* a, MKL_INT lda );
extern double sprod(int dim, double *a);

/* main fucntion */
void mexFunction(int nlhs,mxArray *plhs[],int nrhs,const mxArray *prhs[])
{
    int i,dim,info,n;
    int tryrac = true;
    double *coefs,phi1,tau,phi1square,rw2,*U,*w,*e,*d;
    
    /* make pointers to input data */
    dim = (int)mxGetScalar(prhs[0]);
    coefs = (double*)mxGetPr(prhs[1]);
    rw2 = (double)mxGetScalar(prhs[2]);
    
    /* phi1,tau */
    phi1 = coefs[0];
    phi1square = pow(phi1,2);
    tau = coefs[1];
    
    /* make pointers to output data */
    plhs[0] = mxCreateDoubleMatrix(1,dim,mxREAL);
    w = mxGetPr(plhs[0]);
    
    plhs[1] = mxCreateDoubleMatrix(dim,dim,mxREAL);
    U = mxGetPr(plhs[1]);
    
    /* Memory */
    d = (double*)mxMalloc(dim*sizeof(double));
    e = (double*)mxMalloc(dim*sizeof(double));
    
    /* e, d */
    e[0:dim:1] = -phi1*tau;
    d[0] = tau;
    d[dim-1] = tau;
    d[1:dim-2:1] = (1.0 + phi1square)*tau;
    
    print_matrix( "e", 1, dim, e, 1 );
    print_matrix( "d", 1, dim, d, 1 );
    
    /* Solve eigenproblem */
    n = dim;
    info = LAPACKE_dstemr(LAPACK_COL_MAJOR, 'V', 'A', dim,
            d, e, 0, 0, 0, 0, &amp;amp;n,  w, U, dim, dim, &amp;amp;n, &amp;amp;tryrac );
    
    mexPrintf( "n=%d\t dim=%d\n", n,dim );
    
    /* release memory */
    mxFree(e),mxFree(d);
    return ;
}

/* Auxiliary routine: printing a matrix */
void print_matrix( char* desc, MKL_INT m, MKL_INT n, double* a, MKL_INT lda ) {
    MKL_INT i, j;
    mexPrintf( "\n %s\n", desc );
    for( i = 0; i &amp;lt; m; i++ ) {
        for( j = 0; j &amp;lt; n; j++ ) mexPrintf( " %6.2f", a[i+j*lda] );
        mexPrintf( "\n" );
    }
}
&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 09:18:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/problem-with-LAPACKE-dstemr/m-p/1167122#M28309</guid>
      <dc:creator>A___Fiori</dc:creator>
      <dc:date>2019-03-11T09:18:22Z</dc:date>
    </item>
    <item>
      <title>vl, vu</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/problem-with-LAPACKE-dstemr/m-p/1167123#M28310</link>
      <description>&lt;P&gt;vl,&amp;nbsp;vu&lt;/P&gt;&lt;P&gt;If&amp;nbsp;range&amp;nbsp;=&amp;nbsp;'V', the lower and upper bounds of the interval to be searched for eigenvalues. Constraint:&amp;nbsp;vl&amp;lt;vu.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 13:17:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/problem-with-LAPACKE-dstemr/m-p/1167123#M28310</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2019-03-11T13:17:44Z</dc:date>
    </item>
  </channel>
</rss>

