Hi,
In the example of
https://software.intel.com/sites/products/documentation/doclib/mkl_sa/11...
The to-be-diagonalized matrix is declared to be a dcomplex type
(struct _dcomplex { double re, im; };
typedef struct _dcomplex dcomplex;)
and initialized using:
dcomplex a[LDA*N] = {
{ 9.14, 0.00}, {-4.37, 9.22}, {-1.98, 1.72}, {-8.96, 9.50},
{ 0.00, 0.00}, {-3.35, 0.00}, { 2.25, 9.51}, { 2.57, -2.40},
{ 0.00, 0.00}, { 0.00, 0.00}, {-4.82, 0.00}, {-3.24, -2.04},
{ 0.00, 0.00}, { 0.00, 0.00}, { 0.00, 0.00}, { 8.44, 0.00}
};
When I try to supply my own matrix elements to a[LDA*N] using
dcomplex a[LDA*N];
for (int i=0;i<N;i++) {
for (int j=0;j<LDA;j++) {
int k=j+i*4*N;
a[k] = {std::real(hamiltonian[i][j]),std::imag(hamiltonian[i][j])};
}//j
}//i
It complains:
error: expected an expression
a[k] = {std::real(hamiltonian[i][j]),std::imag(hamiltonian[i][j])};
^
when I tried to icc the code using mkl link.
I guess the question is: how to initialize/access members in a[LDA*N] in a more free way.
As you see I mostly use vectors to store my data. So I am not familiar with other data types.
Thanks a lot,
Yue