Sha256: 01fbcc4da4e6a34a3901e3a34a40c30de327638a94be046e11032b39abaec5fb

Contents?: true

Size: 888 Bytes

Versions: 16

Compression:

Stored size: 888 Bytes

Contents

#!/usr/bin/env ruby
require("gsl")

m = GSL::Matrix[[1, 2, 3], [4, 5, 0], [6, 0, 0]]
evec, eval = m.eigen_nonsymmv
p evec
p eval

m = GSL::Matrix.vandermonde([-1, -2, 3, 4])
w = GSL::Eigen::Nonsymmv.alloc(4)
eval, evec = GSL::Eigen::nonsymmv(m, w)
p eval
p evec

=begin
This can be compared with the corresponding output from GNU OCTAVE, 

  octave> [v,d] = eig(vander([-1 -2 3 4]));
octave> diag(d)
ans =

  -6.4139 + 0.0000i
   5.5456 + 3.0854i
   5.5456 - 3.0854i
   2.3228 + 0.0000i

octave> v
v =

 Columns 1 through 3:

  -0.09988 + 0.00000i  -0.04350 - 0.00755i  -0.04350 + 0.00755i
  -0.11125 + 0.00000i   0.06399 - 0.14224i   0.06399 + 0.14224i
   0.29250 + 0.00000i  -0.51518 + 0.04142i  -0.51518 - 0.04142i
   0.94451 + 0.00000i  -0.84059 + 0.00000i  -0.84059 - 0.00000i

 Column 4:

  -0.14493 + 0.00000i
   0.35660 + 0.00000i
   0.91937 + 0.00000i
   0.08118 + 0.00000i
=end

Version data entries

16 entries across 16 versions & 4 rubygems

Version Path
rb-gsl-1.16.0.4 examples/eigen/nonsymmv.rb
rb-gsl-1.16.0.3 examples/eigen/nonsymmv.rb
rb-gsl-1.16.0.3.rc1 examples/eigen/nonsymmv.rb
gsl-nmatrix-1.15.3.2 examples/eigen/nonsymmv.rb
gsl-nmatrix-1.15.3.1 examples/eigen/nonsymmv.rb
rb-gsl-1.16.0.2 examples/eigen/nonsymmv.rb
rb-gsl-1.16.0.1 examples/eigen/nonsymmv.rb
rb-gsl-1.16.0 examples/eigen/nonsymmv.rb
rb-gsl-1.15.3.2 examples/eigen/nonsymmv.rb
rb-gsl-1.15.3.1 examples/eigen/nonsymmv.rb
blackwinter-gsl-1.15.3.2 examples/eigen/nonsymmv.rb
gsl-nmatrix-1.15.3.0 examples/eigen/nonsymmv.rb
gsl-1.15.3 examples/eigen/nonsymmv.rb
gsl-1.14.7 examples/eigen/nonsymmv.rb
gsl-1.14.6 examples/eigen/nonsymmv.rb
gsl-1.14.5 examples/eigen/nonsymmv.rb