Exemplo n.º 1
0
def kershawtri_determinant_test():

    #*****************************************************************************80
    #
    ## KERSHAWTRI_DETERMINANT_TEST tests KERSHAWTRI_DETERMINANT.
    #
    #  Licensing:
    #
    #    This code is distributed under the GNU LGPL license.
    #
    #  Modified:
    #
    #    17 February 2015
    #
    #  Author:
    #
    #    John Burkardt
    #
    from kershawtri import kershawtri
    from r8vec_uniform_ab import r8vec_uniform_ab
    from r8mat_print import r8mat_print

    print ''
    print 'KERSHAWTRI_DETERMINANT_TEST'
    print '  KERSHAWTRI_DETERMINANT computes the KERSHAWTRI determinant.'

    n = 5

    x_n = ((n + 1) // 2)
    r8_lo = -5.0
    r8_hi = +5.0
    seed = 123456789
    x, seed = r8vec_uniform_ab(x_n, r8_lo, r8_hi, seed)

    a = kershawtri(n, x)
    m = n
    r8mat_print(m, n, a, '  KERSHAWTRI matrix:')

    value = kershawtri_determinant(n, x)

    print ''
    print '  Value =  %g' % (value)

    print ''
    print 'KERSHAWTRI_DETERMINANT_TEST'
    print '  Normal end of execution.'

    return
Exemplo n.º 2
0
def kershawtri_determinant_test ( ):

#*****************************************************************************80
#
## KERSHAWTRI_DETERMINANT_TEST tests KERSHAWTRI_DETERMINANT.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    17 February 2015
#
#  Author:
#
#    John Burkardt
#
  from kershawtri import kershawtri
  from r8vec_uniform_ab import r8vec_uniform_ab
  from r8mat_print import r8mat_print

  print ''
  print 'KERSHAWTRI_DETERMINANT_TEST'
  print '  KERSHAWTRI_DETERMINANT computes the KERSHAWTRI determinant.'

  n = 5

  x_n = ( ( n + 1 ) // 2 )
  r8_lo = -5.0
  r8_hi = +5.0
  seed = 123456789
  x, seed = r8vec_uniform_ab ( x_n, r8_lo, r8_hi, seed )

  a = kershawtri ( n, x )
  m = n
  r8mat_print ( m, n, a, '  KERSHAWTRI matrix:' )

  value = kershawtri_determinant ( n, x )

  print ''
  print '  Value =  %g' % ( value )

  print ''
  print 'KERSHAWTRI_DETERMINANT_TEST'
  print '  Normal end of execution.'

  return
Exemplo n.º 3
0
def kershawtri_test():

    #*****************************************************************************80
    #
    ## KERSHAWTRI_TEST tests KERSHAWTRI.
    #
    #  Licensing:
    #
    #    This code is distributed under the GNU LGPL license.
    #
    #  Modified:
    #
    #    17 February 2015
    #
    #  Author:
    #
    #    John Burkardt
    #
    from r8vec_uniform_ab import r8vec_uniform_ab
    from r8mat_print import r8mat_print

    print ''
    print 'KERSHAWTRI_TEST'
    print '  KERSHAWTRI computes the KERSHAWTRI matrix.'

    n = 5
    x_n = ((n + 1) // 2)
    x_lo = -5.0
    x_hi = +5.0
    seed = 123456789
    x, seed = r8vec_uniform_ab(x_n, x_lo, x_hi, seed)

    a = kershawtri(n, x)
    m = n
    r8mat_print(m, n, a, '  KERSHAWTRI matrix:')

    print ''
    print 'KERSHAWTRI_TEST'
    print '  Normal end of execution.'

    return
Exemplo n.º 4
0
def kershawtri_test ( ):

#*****************************************************************************80
#
## KERSHAWTRI_TEST tests KERSHAWTRI.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    17 February 2015
#
#  Author:
#
#    John Burkardt
#
  from r8vec_uniform_ab import r8vec_uniform_ab
  from r8mat_print import r8mat_print

  print ''
  print 'KERSHAWTRI_TEST'
  print '  KERSHAWTRI computes the KERSHAWTRI matrix.'

  n = 5
  x_n = ( ( n + 1 ) // 2 )
  x_lo = -5.0
  x_hi = +5.0
  seed = 123456789
  x, seed = r8vec_uniform_ab ( x_n, x_lo, x_hi, seed )

  a = kershawtri ( n, x )
  m = n
  r8mat_print ( m, n, a, '  KERSHAWTRI matrix:' )

  print ''
  print 'KERSHAWTRI_TEST'
  print '  Normal end of execution.'

  return