I suggest you ...

how to calculate eigenvectors?

I have this code to calculate eigenvalues/vectors, however, it causes some errors when compiled. How can I solve?
----------------------------------------
using MathNet.Numerics;
using MathNet.Numerics.LinearAlgebra;

class Test
{
static void Main(string[] args)
{
Matrix m = new Matrix(new double[][] {
new double[] { 10.0, -18.0 },
new double[] { 6.0, -11.0 }});

// alternative way to create the matrix:
// double[][] data = Matrix.CreateMatrixData(2, 2);
// data[0][0] = 10.0;
// data[1][0] = 6.0;
// data[0][1] = -18.0;
// data[1][1] = -11.0;
// Matrix m = new Matrix(data);

EigenvalueDecomposition eigen = m.EigenvalueDecomposition;

Complex[] eigenValues = eigen.EigenValues;
// eigenvalues: 1, -2

Matrix eigenVectors = eigen.EigenVectors;

// eigenvectors: [0.894...,0.447...] and [6.708...,4.473...]

// alternative way to access the eigenvalues witout the Complex type:
// double[] eigenValuesReal = eigen.RealEigenvalues; // real part
// double[] eigenValuesImag = eigen.ImagEigenvalues; // imaginary part
}
}

1 vote
Vote 0 votes Vote Vote
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    I agree to the terms of service

    You'll receive a confirmation email with a link to create a password (optional).

    Signed in as (Sign out)
    You have left! (?) (thinking…)
    lehoangthanhlehoangthanh shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      I agree to the terms of service

      You'll receive a confirmation email with a link to create a password (optional).

      Signed in as (Sign out)
      Submitting...

      Knowledge Base and Helpdesk