Sha256: 2d0f2fea40cec2da281ca9dbe849b3268f6d9ad89b1bdeb82deef3342db24ce7

Contents?: true

Size: 741 Bytes

Versions: 6

Compression:

Stored size: 741 Bytes

Contents

require 'minitest/autorun'
require 'minitest/unit'

require 'gsl'

class MatrixComplex < MiniTest::Unit::TestCase

  def test_eye
    z = GSL::Complex[1,0]
    m = GSL::Matrix::Complex.eye(2, z)
    assert_equal(z, m[0,0])
    assert_equal(GSL::Complex[0,0], m[0,1])
    assert_equal(GSL::Complex[0,0], m[1,0])
    assert_equal(z, m[1,1])
  end

  def test_set_row
    z0 = GSL::Complex[1,0]
    z1 = GSL::Complex[2,0]
    m = GSL::Matrix::Complex[2,2]
    m.set_row(0,z0,z1)
    assert_equal(z0, m[0,0])
    assert_equal(z1, m[0,1])
  end

  def test_set_col
    z0 = GSL::Complex[1,0]
    z1 = GSL::Complex[2,0]
    m = GSL::Matrix::Complex[2,2]
    m.set_col(0,z0,z1)
    assert_equal(z0, m[0,0])
    assert_equal(z1, m[1,0])
  end

end

Version data entries

6 entries across 6 versions & 4 rubygems

Version Path
gsl-nmatrix-1.15.3.2 tests/matrix/matrix_complex_test.rb
gsl-nmatrix-1.15.3.1 tests/matrix/matrix_complex_test.rb
rb-gsl-1.15.3.1 tests/matrix/matrix_complex_test.rb
blackwinter-gsl-1.15.3.2 tests/matrix/matrix_complex_test.rb
gsl-nmatrix-1.15.3.0 tests/matrix/matrix_complex_test.rb
gsl-1.15.3 tests/matrix/matrix_complex_test.rb