title: MKL dtrsv wrong output
body: <p>I am trying to properly use 'cblas_dtrsv' however I do not get right output and I do not know why. Here is my example(dtrsv_example.c)</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include "mkl.h"
  
  int main()
  {
    double *A, *b, *x;
    int m, n, k, i, j;
  
    m = 4, k = 4, n = 4;
  
    printf (" Allocating memory for matrices aligned on 64-byte boundary for better \n"
        " performance \n\n");
    A = (double *)mkl_malloc( m*k*sizeof( double ), 64 );
    b = (double *)mkl_malloc( n*sizeof( double ), 64 );
    x = (double *)mkl_malloc( n*sizeof( double ), 64 );
  
    if (A == NULL || b == NULL || x == NULL) {
      printf( "\n ERROR: Can't allocate memory for matrices. Aborting... \n\n");
      mkl_free(A);
      mkl_free(b);
      mkl_free(x);
      return 1;
    }  
    A[0] = 11;
    for (i = 0; i &lt; m; i++) {
      for (j = 0; j &lt;= i; j++) {
        A[j + i*m] = (double)(j+i*m);
      }
    }
   for (i = 0; i &lt; n; i++) {
      x[i] = (i+1)*5.0;
    }
    printf ("\n Computations completed.\n\n");
  
    printf ("\n Result x: \n");
    for (j = 0; j &lt; n; j++) {
      printf ("%f\n", x[i]);
    }
  
  
    printf ("\n Deallocating memory \n\n");
    mkl_free(A);
    mkl_free(b);
    mkl_free(x);
  
    printf (" Example completed. \n\n");
    return 0;
  }
  </code></pre>
  
  <p>Compilation seems fine:</p>
  
  <pre><code>icc -c -Wall   -c -o dtrsv_example.o dtrsv_example.c
  icc dtrsv_example.o -o dtrsv_example -L/opt/intel/mkl/lib/intel64 -lmkl_intel_lp64 -lmkl_core -lmkl_sequential -lpthread -lm
  </code></pre>
  
  <p>However, I get the wrong result:</p>
  
  <pre><code>./dtrsv_example
  Computations completed.
  
  
   Result x: 
  0.000000
  0.000000
  0.000000
  0.000000
  
   Deallocating memory 
  
   Example completed. 
  </code></pre>
  
  <p>Any ideas of what I might be doing wrong here? </p>