test_simple Subroutine

public subroutine test_simple()

Arguments

None

Calls

proc~~test_simple~~CallsGraph proc~test_simple test_simple add_row add_row proc~test_simple->add_row assert_that assert_that proc~test_simple->assert_that equal_to equal_to proc~test_simple->equal_to

Source Code

   subroutine test_simple()
      integer, parameter :: M = 2, N = 3
      type(CSR_SparseMatrix_sp) :: mat
      real :: x(N), y(M)

      mat = CSR_SparseMatrix_sp(M, N, nnz=3)
      call add_row(mat, 1, 1, [1.,1.])
      call add_row(mat, 2, 2, [1.])

      x = 1
      y = matmul(mat, x)

      @assert_that(y, is(equal_to([2.,1.])))
      
   end subroutine test_simple