I am computing eigenvalue and eigenvector for large matrix, then I found Eigen to solve the problem, however , my matrix is MX[i][j],how can i call my matrix into Eigen. I am new to C++ and Eigen.
int main()
{
int k = 1, L = 0, A = 0, i, j, m, e;
int z = 1, R = 0, C = 0; //variable for Q
int B = 0, T = 0, c = 1, q = 1, n = 0; // variable for diagonal
double P[KMAX];
double Q[KMAX];
double S[KMAX];
double MX[M][M];
double MA[M][M];
double W[M+1][M+1];
double D[M + 1][M + 1];
double Matrix[M + 1][M + 1];
double I[M + 1][M + 1];
double p = 0.95;
double a1 = 20.79, a2 = 0.005;
int V = 3, KM = 5;
cout.setf(ios::fixed);
cout.precision(3);
for (i = 0; i <= M; i++)//matrix 0
for (j = 0; j <= M; j++)
MX[i][j] = 0;
MA[i][j] = 0;
for (i = 1; i <= KMAX; i++)// kiraan untuk P
{
P[i] = (p*V*i) / (KM + i);
Q[i] = (1 - p)*V*i / (KM + i);