Statistics
| Branch: | Revision:

root / synthbench / euroben-dm / mod2as / .svn / text-base / check.f.svn-base @ 0:839f52ef7657

History | View | Annotate | Download (1.1 kB)

1
      Subroutine check( ncols, nrows, nelmts, indx, rowp, outvec, ok )
2
! ---------------------------------------------------------------------
3
! --- Routine 'check' checks the solution vector 'x' in 'b = Ax'. The
4
!     check is possible because of the special definition of 'A' & 'b'.
5
! ---------------------------------------------------------------------
6
      Use          numerics
7
      Use          dist_module
8
      Implicit     None
9

    
10
      Integer   :: ncols, nrows, nelmts
11
      Integer   :: indx(nelmts), rowp(nrows)
12
      Real(l_)  :: outvec(nrows)
13
      Logical   :: ok
14

    
15
      Integer   :: i
16
      Real(l_)  :: eps, rowsum
17
! ---------------------------------------------------------------------
18
      eps = 2.0_l_*ncols*Epsilon( 1.0_l_ )
19
      Do i = 1, nrows - 1             
20
         rowsum = Real( rowp(i+1) - rowp(i), l_ )
21
         ok = ok .AND. ( Abs( outvec(i) - rowsum ) <= eps )
22
      End Do
23
      rowsum = Real( nelmts - rowp(nrows) + 1, l_ )
24
      ok = ok .AND. ( Abs( outvec(nrows) - rowsum ) <= eps )
25
! ---------------------------------------------------------------------
26
      End Subroutine check