I am really confused about the solution I get from a system of linear equations. My goal is to solve linear equation: `A*x = e`

by a function in lapack. Here is my code:

```
#include <iostream>
#include "/usr/include/armadillo"
#include "/usr/local/include/lapacke.h"
using namespace std;
int main()
{
int n = 3;
arma::fvec alpha( n );//define a vetor alpha with a size 3
arma::fvec beta( n );//define a vector beta with a size 2
alpha << 1 << 2 << 3 << arma::endr;//assign 1,2,3 to alpha;
beta << 0.3 << 0.6 << arma::endr;//assign 0.3, 0.6 to beta;
float a = 0.1;
arma::fvec e = arma::zeros<arma::fvec>( n );//define a vector e with all element equal to 0;
e( n - 1 ) = beta( n - 2 ) * beta( n - 2 ); //the last element of e equals to the square of the last element of vector beta;
arma::fvec tri_alpha = alpha - a;
LAPACKE_sgtsv(LAPACK_COL_MAJOR, n, 1, &( beta[ 0 ] ), &( tri_alpha[ 0 ] ), &( beta[ 0 ] ), &( e[ 0 ] ), n );
cout << e.t() << endl;
return 0;
}
```

the vector alpha is on the diagonal and vector beta is on the sub-diagonal and super-diagonal to construct the tridiagonal matrix, assume it to be T. The following is the explain of the function `sgtsv`

.

```
LAPACKE_sgtsv( int matrix_order, int n, int nrhs, float *dl, float *d, float *du, float *b, int ldb)
```

and

```
B is REAL array, dimension (LDB,NRHS)，On exit, if INFO = 0, the N by NRHS solution matrix X
```

In my case, B = e, I output e finally and it is `(0, -0.0444, 0.1333)`

, obviously, the right answer should be `(0.0148, -0.0444, 0.1333)`

, then the first element is wrong or may be lacking, could anyone do me a favour? thanks. By the way, the library I am using is armadillo.