• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python r8vec_uniform_ab.r8vec_uniform_ab函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中r8vec_uniform_ab.r8vec_uniform_ab函数的典型用法代码示例。如果您正苦于以下问题:Python r8vec_uniform_ab函数的具体用法?Python r8vec_uniform_ab怎么用?Python r8vec_uniform_ab使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了r8vec_uniform_ab函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: uvwp_ethier_test

def uvwp_ethier_test ( ):

#*****************************************************************************80
#
## UVWP_ETHIER_TEST samples the solution at the initial time.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    17 January 2015
#
#  Author:
#
#    John Burkardt
#
  import numpy as np
  from r8vec_uniform_ab import r8vec_uniform_ab

  a = np.pi / 4.0
  d = np.pi / 2.0

  print ''
  print 'UVWP_ETHIER_TEST'
  print '  Estimate the range of velocity and pressure'
  print '  at the initial time T = 0, using a region that is'
  print '  the cube centered at (0,0,0) with "radius" 1.0,'
  print '  Parameter A = %g' % ( a )
  print '  Parameter D = %g' % ( d )

  n = 1000
  x_lo = -1.0
  x_hi = +1.0
  seed = 123456789
  x, seed = r8vec_uniform_ab ( n, x_lo, x_hi, seed )
  y, seed = r8vec_uniform_ab ( n, x_lo, x_hi, seed )
  z, seed = r8vec_uniform_ab ( n, x_lo, x_hi, seed )
  t = 0.0

  u, v, w, p = uvwp_ethier ( a, d, n, x, y, z, t )

  print ''
  print '           Minimum       Maximum'
  print ''
  print '  U:  %14.6g  %14.6g' % ( np.min ( u ), np.max ( u ) )
  print '  V:  %14.6g  %14.6g' % ( np.min ( v ), np.max ( v ) )
  print '  W:  %14.6g  %14.6g' % ( np.min ( w ), np.max ( w ) )
  print '  P:  %14.6g  %14.6g' % ( np.min ( p ), np.max ( p ) )

  print ''
  print 'UVWP_ETHIER_TEST:'
  print '  Normal end of execution.'

  return
开发者ID:johannesgerer,项目名称:jburkardt-py,代码行数:56,代码来源:uvwp_ethier.py


示例2: resid_ethier_test

def resid_ethier_test ( ):

#*****************************************************************************80
#
## RESID_ETHIER_TEST samples the residual at the initial time.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    17 January 2015
#
#  Author:
#
#    John Burkardt
#
  import numpy as np
  from r8vec_uniform_ab import r8vec_uniform_ab

  a = np.pi / 4.0;
  d = np.pi / 2.0;

  print ''
  print 'RESID_ETHIER_TEST'
  print '  Sample the Navier-Stokes residuals'
  print '  at the initial time T = 0, using a region that is'
  print '  the cube centered at (0,0,0) with "radius" 1.0,'
  print '  Parameter A = %g' % ( a )
  print '  Parameter D = %g' % ( d )

  n = 1000
  x_lo = -1.0
  x_hi = +1.0
  seed = 123456789
  x, seed = r8vec_uniform_ab ( n, x_lo, x_hi, seed )
  y, seed = r8vec_uniform_ab ( n, x_lo, x_hi, seed )
  z, seed = r8vec_uniform_ab ( n, x_lo, x_hi, seed )
  t = 0.0

  ur, vr, wr, pr = resid_ethier ( a, d, n, x, y, z, t )

  print ''
  print '           Minimum       Maximum'
  print ''
  print '  Ur:  %14.6g  %14.6g' % ( np.min ( np.abs ( ur ) ), np.max ( np.abs ( ur ) ) )
  print '  Vr:  %14.6g  %14.6g' % ( np.min ( np.abs ( vr ) ), np.max ( np.abs ( vr ) ) )
  print '  Wr:  %14.6g  %14.6g' % ( np.min ( np.abs ( wr ) ), np.max ( np.abs ( wr ) ) )
  print '  Pr:  %14.6g  %14.6g' % ( np.min ( np.abs ( pr ) ), np.max ( np.abs ( pr ) ) )

  print ''
  print 'RESID_ETHIER_TEST:'
  print '  Normal end of execution.'

  return
开发者ID:johannesgerer,项目名称:jburkardt-py,代码行数:56,代码来源:resid_ethier.py


示例3: rhs_taylor_test

def rhs_taylor_test ( ):

#*****************************************************************************80
#
## RHS_TAYLOR_TEST samples the right hand sides at the initial time.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    30 January 2015
#
#  Author:
#
#    John Burkardt
#
  import numpy as np
  from r8vec_uniform_ab import r8vec_uniform_ab

  nu = 1.0
  rho = 1.0

  print ''
  print 'RHS_TAYLOR_TEST'
  print '  Taylor Vortex Flow:'
  print '  Sample the Navier-Stokes right hand sides'
  print '  at the initial time T = 0, using a region that is'
  print '  the square centered at (1.5,1.5) with "radius" 1.0,'
  print '  Kinematic viscosity NU = %g' % ( nu )
  print '  Fluid density RHO = %g' % ( rho )

  n = 1000
  x_lo = 0.5
  x_hi = +2.5
  seed = 123456789
  x, seed = r8vec_uniform_ab ( n, x_lo, x_hi, seed )
  y, seed = r8vec_uniform_ab ( n, x_lo, x_hi, seed )
  t = 0.0

  f, g, h = rhs_taylor ( nu, rho, n, x, y, t )

  print ''
  print '           Minimum       Maximum'
  print ''
  print '  Ur:  %14.6g  %14.6g' % ( np.min ( f ), np.max ( f ) )
  print '  Vr:  %14.6g  %14.6g' % ( np.min ( g ), np.max ( g ) )
  print '  Pr:  %14.6g  %14.6g' % ( np.min ( h ), np.max ( h ) )

  print ''
  print 'RHS_TAYLOR_TEST:'
  print '  Normal end of execution.'

  return
开发者ID:johannesgerer,项目名称:jburkardt-py,代码行数:55,代码来源:rhs_taylor.py


示例4: uvp_spiral_test

def uvp_spiral_test ( ):

#*****************************************************************************80
#
## UVP_SPIRAL_TEST samples the Spiral Flow solution at the initial time.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    29 January 2015
#
#  Author:
#
#    John Burkardt
#
  import numpy as np
  from r8vec_uniform_ab import r8vec_uniform_ab

  nu = 1.0
  rho = 1.0

  print ''
  print 'UVP_SPIRAL_TEST'
  print '  Spiral Flow:'
  print '  Estimate the range of velocity and pressure'
  print '  at the initial time T = 0, over the unit square.'
  print '  Kinematic viscosity NU = %g' % ( nu )
  print '  Fluid density RHO = %g' % ( rho )

  n = 1000
  x_lo = 0.0
  x_hi = +1.0
  seed = 123456789
  x, seed = r8vec_uniform_ab ( n, x_lo, x_hi, seed )
  y, seed = r8vec_uniform_ab ( n, x_lo, x_hi, seed )
  t = 0.0

  u, v, p = uvp_spiral ( nu, rho, n, x, y, t )

  print ''
  print '           Minimum       Maximum'
  print ''
  print '  U:  %14.6g  %14.6g' % ( np.min ( u ), np.max ( u ) )
  print '  V:  %14.6g  %14.6g' % ( np.min ( v ), np.max ( v ) )
  print '  P:  %14.6g  %14.6g' % ( np.min ( p ), np.max ( p ) )

  print ''
  print 'UVP_SPIRAL_TEST:'
  print '  Normal end of execution.'

  return
开发者ID:johannesgerer,项目名称:jburkardt-py,代码行数:54,代码来源:uvp_spiral.py


示例5: uvp_taylor_test

def uvp_taylor_test ( ):

#*****************************************************************************80
#
## UVP_TAYLOR_TEST samples the solution at the initial time.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    22 January 2015
#
#  Author:
#
#    John Burkardt
#
  import numpy as np
  from r8vec_uniform_ab import r8vec_uniform_ab

  nu = 1.0
  rho = 1.0

  print ''
  print 'UVP_TAYLOR_TEST'
  print '  Estimate the range of velocity and pressure'
  print '  at the initial time T = 0, using a region that is'
  print '  the square centered at (1.5,1.5) with "radius" 1.0,'
  print '  Kinematic viscosity NU = %g' % ( nu )
  print '  Fluid density RHO = %g' % ( rho )

  n = 1000
  x_lo = 0.5
  x_hi = +2.5
  seed = 123456789
  x, seed = r8vec_uniform_ab ( n, x_lo, x_hi, seed )
  y, seed = r8vec_uniform_ab ( n, x_lo, x_hi, seed )
  t = 0.0

  u, v, p = uvp_taylor ( nu, rho, n, x, y, t )

  print ''
  print '           Minimum       Maximum'
  print ''
  print '  U:  %14.6g  %14.6g' % ( np.min ( u ), np.max ( u ) )
  print '  V:  %14.6g  %14.6g' % ( np.min ( v ), np.max ( v ) )
  print '  P:  %14.6g  %14.6g' % ( np.min ( p ), np.max ( p ) )

  print ''
  print 'UVP_TAYLOR_TEST:'
  print '  Normal end of execution.'

  return
开发者ID:johannesgerer,项目名称:jburkardt-py,代码行数:54,代码来源:uvp_taylor.py


示例6: resid_spiral_test

def resid_spiral_test ( ):

#*****************************************************************************80
#
## RESID_SPIRAL_TEST samples the residuals at the initial time.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    30 January 2015
#
#  Author:
#
#    John Burkardt
#
  import numpy as np
  from r8vec_uniform_ab import r8vec_uniform_ab

  nu = 1.0
  rho = 1.0

  print ''
  print 'RESID_SPIRAL_TEST'
  print '  Spiral Flow:'
  print '  Sample the Navier-Stokes residuals'
  print '  at the initial time T = 0, over the unit square.'
  print '  Kinematic viscosity NU = %g' % ( nu )
  print '  Fluid density RHO = %g' % ( rho )

  n = 1000
  x_lo = 0.0
  x_hi = 1.0
  seed = 123456789
  x, seed = r8vec_uniform_ab ( n, x_lo, x_hi, seed )
  y, seed = r8vec_uniform_ab ( n, x_lo, x_hi, seed )
  t = 0.0

  ur, vr, pr = resid_spiral ( nu, rho, n, x, y, t )

  print ''
  print '           Minimum       Maximum'
  print ''
  print '  Ur:  %14.6g  %14.6g' % ( np.min ( np.abs ( ur ) ), np.max ( np.abs ( ur ) ) )
  print '  Vr:  %14.6g  %14.6g' % ( np.min ( np.abs ( vr ) ), np.max ( np.abs ( vr ) ) )
  print '  Pr:  %14.6g  %14.6g' % ( np.min ( np.abs ( pr ) ), np.max ( np.abs ( pr ) ) )

  print ''
  print 'RESID_SPIRAL_TEST:'
  print '  Normal end of execution.'

  return
开发者ID:johannesgerer,项目名称:jburkardt-py,代码行数:54,代码来源:resid_spiral.py


示例7: rhs_lucas_test

def rhs_lucas_test ( ):

#*****************************************************************************80
#
## RHS_LUCAS_TEST samples the right hand sides at the initial time.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    07 March 2015
#
#  Author:
#
#    John Burkardt
#
  import numpy as np
  from r8vec_uniform_ab import r8vec_uniform_ab

  nu = 1.0
  rho = 1.0

  print ''
  print 'RHS_LUCAS_TEST'
  print '  Lucas Bystricky Flow'
  print '  Sample the Navier-Stokes right hand sides'
  print '  at the initial time T = 0, over the unit square.'
  print '  Kinematic viscosity NU = %g' % ( nu )
  print '  Fluid density RHO = %g' % ( rho )

  n = 1000
  r8_lo = 0.0
  r8_hi = 1.0
  seed = 123456789
  x, seed = r8vec_uniform_ab ( n, r8_lo, r8_hi, seed )
  y, seed = r8vec_uniform_ab ( n, r8_lo, r8_hi, seed )
  t = 0.0

  f, g, h = rhs_lucas ( nu, rho, n, x, y, t )

  print ''
  print '           Minimum       Maximum'
  print ''
  print '  Ur:  %14.6g  %14.6g' % ( np.min ( f ), np.max ( f ) )
  print '  Vr:  %14.6g  %14.6g' % ( np.min ( g ), np.max ( g ) )
  print '  Pr:  %14.6g  %14.6g' % ( np.min ( h ), np.max ( h ) )

  print ''
  print 'RHS_LUCAS_TEST:'
  print '  Normal end of execution.'

  return
开发者ID:johannesgerer,项目名称:jburkardt-py,代码行数:54,代码来源:rhs_lucas.py


示例8: ortega_determinant_test

def ortega_determinant_test ( ):

#*****************************************************************************80
#
## ORTEGA_DETERMINANT_TEST tests ORTEGA_DETERMINANT.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    20 February 2015
#
#  Author:
#
#    John Burkardt
#
  from ortega import ortega
  from r8mat_print import r8mat_print
  from r8vec_uniform_ab import r8vec_uniform_ab
 
  print ''
  print 'ORTEGA_DETERMINANT_TEST'
  print '  ORTEGA_DETERMINANT computes the determinant of the ORTEGA matrix.'
  print ''

  m = 5
  n = m
  r8_lo = -5.0
  r8_hi = +5.0
  seed = 123456789
  v1, seed = r8vec_uniform_ab ( n, r8_lo, r8_hi, seed )
  v2, seed = r8vec_uniform_ab ( n, r8_lo, r8_hi, seed )
  v3, seed = r8vec_uniform_ab ( n, r8_lo, r8_hi, seed )

  a = ortega ( n, v1, v2, v3 )

  r8mat_print ( m, n, a, '  ORTEGA matrix:' )

  value = ortega_determinant ( n )

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

  print ''
  print 'ORTEGA_DETERMINANT_TEST'
  print '  Normal end of execution.'

  return
开发者ID:johannesgerer,项目名称:jburkardt-py,代码行数:50,代码来源:ortega.py


示例9: uv_spiral_test

def uv_spiral_test ( ):

#*****************************************************************************80
#
## UV_SPIRAL_TEST generates a field and estimates its range.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    20 January 2015
#
#  Author:
#
#    John Burkardt
#
  import numpy as np
  from r8vec_uniform_ab import r8vec_uniform_ab

  nu = 1.0
  rho = 1.0

  print ''
  print 'UV_SPIRAL_TEST'
  print '  Sample a spiral velocity field and estimate'
  print '  the range of the solution values.'

  n = 1000
  x_lo = 0.0
  x_hi = +1.0
  seed = 123456789
  x, seed = r8vec_uniform_ab ( n, x_lo, x_hi, seed )
  y, seed = r8vec_uniform_ab ( n, x_lo, x_hi, seed )

  c = 1.0
  u, v = uv_spiral ( n, x, y, c )

  print ''
  print '           Minimum       Maximum'
  print ''
  print '  U:  %14.6g  %14.6g' % ( np.min ( u ), np.max ( u ) )
  print '  V:  %14.6g  %14.6g' % ( np.min ( v ), np.max ( v ) )

  print ''
  print 'UV_SPIRAL_TEST:'
  print '  Normal end of execution.'

  return
开发者ID:johannesgerer,项目名称:jburkardt-py,代码行数:50,代码来源:uv_spiral.py


示例10: rhs_stokes2_test

def rhs_stokes2_test ( ):

#*****************************************************************************80
#
## RHS_STOKES2_TEST samples the right hand sides.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    25 January 2015
#
#  Author:
#
#    John Burkardt
#
  import numpy as np
  from r8vec_uniform_ab import r8vec_uniform_ab

  print ''
  print 'RHS_STOKES2_TEST'
  print '  Exact Stokes solution #2.'
  print '  Estimate the range of the right hand side functions'
  print '  using a region that is the unit square.'

  n = 1000
  x_lo = 0.0
  x_hi = +1.0
  seed = 123456789
  x, seed = r8vec_uniform_ab ( n, x_lo, x_hi, seed )
  y, seed = r8vec_uniform_ab ( n, x_lo, x_hi, seed )

  f, g, h = rhs_stokes2 ( n, x, y )

  print ''
  print '           Minimum       Maximum'
  print ''
  print '  U:  %14.6g  %14.6g' % ( np.min ( f ), np.max ( f ) )
  print '  V:  %14.6g  %14.6g' % ( np.min ( g ), np.max ( g ) )
  print '  P:  %14.6g  %14.6g' % ( np.min ( h ), np.max ( h ) )

  print ''
  print 'RHS_STOKES2_TEST:'
  print '  Normal end of execution.'

  return
开发者ID:johannesgerer,项目名称:jburkardt-py,代码行数:48,代码来源:rhs_stokes2.py


示例11: uvp_stokes1_test

def uvp_stokes1_test ( ):

#*****************************************************************************80
#
## UVP_STOKES1_TEST samples the solution.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    25 January 2015
#
#  Author:
#
#    John Burkardt
#
  import numpy as np
  from r8vec_uniform_ab import r8vec_uniform_ab

  print ''
  print 'UVP_STOKES1_TEST'
  print '  Exact Stokes solution #1.'
  print '  Estimate the range of velocity and pressure'
  print '  using a region that is the unit square.'

  n = 1000
  x_lo = 0.0
  x_hi = +1.0
  seed = 123456789
  x, seed = r8vec_uniform_ab ( n, x_lo, x_hi, seed )
  y, seed = r8vec_uniform_ab ( n, x_lo, x_hi, seed )

  u, v, p = uvp_stokes1 ( n, x, y )

  print ''
  print '           Minimum       Maximum'
  print ''
  print '  U:  %14.6g  %14.6g' % ( np.min ( u ), np.max ( u ) )
  print '  V:  %14.6g  %14.6g' % ( np.min ( v ), np.max ( v ) )
  print '  P:  %14.6g  %14.6g' % ( np.min ( p ), np.max ( p ) )

  print ''
  print 'UVP_STOKES1_TEST:'
  print '  Normal end of execution.'

  return
开发者ID:johannesgerer,项目名称:jburkardt-py,代码行数:48,代码来源:uvp_stokes1.py


示例12: triv_determinant_test

def triv_determinant_test ( ):

#*****************************************************************************80
#
## TRIV_DETERMINANT_TEST tests TRIV_DETERMINANT.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    26 February 2015
#
#  Author:
#
#    John Burkardt
#
  from triv import triv
  from r8vec_uniform_ab import r8vec_uniform_ab
  from r8mat_print import r8mat_print

  print ''
  print 'TRIV_DETERMINANT_TEST'
  print '  TRIV_DETERMINANT computes the TRIV determinant.'

  m = 5
  n = m
  r8_lo = -5.0
  r8_hi = +5.0
  seed = 123456789
  x, seed = r8vec_uniform_ab ( n - 1, r8_lo, r8_hi, seed )
  y, seed = r8vec_uniform_ab ( n, r8_lo, r8_hi, seed )
  z, seed = r8vec_uniform_ab ( n - 1, r8_lo, r8_hi, seed )
  a = triv ( n, x, y, z )

  r8mat_print ( m, n, a, '  TRIV matrix:' )

  value = triv_determinant ( n, x, y, z )

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

  print ''
  print 'TRIV_DETERMINANT_TEST'
  print '  Normal end of execution.'

  return
开发者ID:johannesgerer,项目名称:jburkardt-py,代码行数:48,代码来源:triv.py


示例13: resid_stokes3_test

def resid_stokes3_test ( ):

#*****************************************************************************80
#
## RESID_STOKES3_TEST samples the residuals.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    12 February 2015
#
#  Author:
#
#    John Burkardt
#
  import numpy as np
  from r8vec_uniform_ab import r8vec_uniform_ab

  print ''
  print 'RESID_STOKES3_TEST'
  print '  Exact Stokes solution #3.'
  print '  Sample the Stokes residuals.'

  n = 1000
  x_lo = -1.0
  x_hi = +1.0
  seed = 123456789
  x, seed = r8vec_uniform_ab ( n, x_lo, x_hi, seed )
  y, seed = r8vec_uniform_ab ( n, x_lo, x_hi, seed )

  ur, vr, pr = resid_stokes3 ( n, x, y )

  print ''
  print '           Minimum       Maximum'
  print ''
  print '  Ur:  %14.6g  %14.6g' % ( np.min ( np.abs ( ur ) ), np.max ( np.abs ( ur ) ) )
  print '  Vr:  %14.6g  %14.6g' % ( np.min ( np.abs ( vr ) ), np.max ( np.abs ( vr ) ) )
  print '  Pr:  %14.6g  %14.6g' % ( np.min ( np.abs ( pr ) ), np.max ( np.abs ( pr ) ) )

  print ''
  print 'RESID_STOKES3_TEST:'
  print '  Normal end of execution.'

  return
开发者ID:johannesgerer,项目名称:jburkardt-py,代码行数:47,代码来源:resid_stokes3.py


示例14: schur_block_test

def schur_block_test ( ):

#*****************************************************************************80
#
## SCHUR_BLOCK_TEST tests SCHUR_BLOCK.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    28 March 2015
#
#  Author:
#
#    John Burkardt
#
  from r8mat_print import r8mat_print
  from r8vec_uniform_ab import r8vec_uniform_ab

  print ''
  print 'SCHUR_BLOCK_TEST'
  print '  SCHUR_BLOCK computes the SCHUR_BLOCK matrix.'

  m = 5
  n = m
  r8_lo = -5.0
  r8_hi = +5.0
  seed = 123456789
  x_n = ( ( n + 1 ) // 2 )
  x, seed = r8vec_uniform_ab ( x_n, r8_lo, r8_hi, seed )
  y_n = ( n // 2 )
  y, seed = r8vec_uniform_ab ( y_n, r8_lo, r8_hi, seed )
  a = schur_block ( n, x, y )

  r8mat_print ( n, n, a, '  SCHUR_BLOCK matrix:' )

  print ''
  print 'SCHUR_BLOCK_TEST'
  print '  Normal end of execution.'

  return
开发者ID:johannesgerer,项目名称:jburkardt-py,代码行数:43,代码来源:schur_block.py


示例15: clement2_determinant_test

def clement2_determinant_test ( ):

#*****************************************************************************80
#
## CLEMENT2_DETERMINANT_TEST tests CLEMENT2_DETERMINANT.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    27 December 2014
#
#  Author:
#
#    John Burkardt
#
  from clement2 import clement2
  from r8mat_print import r8mat_print
  from r8vec_uniform_ab import r8vec_uniform_ab

  print ''
  print 'CLEMENT2_DETERMINANT_TEST'
  print '  CLEMENT2_DETERMINANT computes the CLEMENT2 determinant.'

  m = 4
  n = m
  seed = 123456789
  x, seed = r8vec_uniform_ab ( n-1, -5.0, +5.0, seed )
  y, seed = r8vec_uniform_ab ( n-1, -5.0, +5.0, seed )

  a = clement2 ( n, x, y )
  r8mat_print ( m, n, a, '  CLEMENT2 matrix:' )

  value = clement2_determinant ( n, x, y )
  print '  Value =  %g' % ( value )

  print ''
  print 'CLEMENT2_DETERMINANT_TEST'
  print '  Normal end of execution.'

  return
开发者ID:johannesgerer,项目名称:jburkardt-py,代码行数:43,代码来源:clement2.py


示例16: gk324_determinant_test

def gk324_determinant_test ( ):

#*****************************************************************************80
#
## GK324_DETERMINANT_TEST tests GK324_DETERMINANT.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    09 February 2015
#
#  Author:
#
#    John Burkardt
#
  from gk324 import gk324
  from r8mat_print import r8mat_print
  from r8vec_uniform_ab import r8vec_uniform_ab

  print ''
  print 'GK324_DETERMINANT_TEST'
  print '  GK324_DETERMINANT computes the GK324 determinant.'

  m = 5
  n = m
 
  r8_lo = -5.0
  r8_hi = +5.0
  seed = 123456789
  if ( n < m ):
    x_n = n
  else:
    x_n = n - 1

  x, seed = r8vec_uniform_ab ( x_n, r8_lo, r8_hi, seed )

  a = gk324 ( m, n, x )

  r8mat_print ( m, n, a, '  GK324 matrix:' )

  value = gk324_determinant ( n, x )

  print '  Value =  %g' % ( value )

  print ''
  print 'GK324_DETERMINANT_TEST'
  print '  Normal end of execution.'

  return
开发者ID:johannesgerer,项目名称:jburkardt-py,代码行数:52,代码来源:gk324.py


示例17: kershawtri_determinant_test

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
开发者ID:johannesgerer,项目名称:jburkardt-py,代码行数:48,代码来源:kershawtri.py


示例18: fiedler_determinant_test

def fiedler_determinant_test ( ):

#*****************************************************************************80
#
## FIEDLER_DETERMINANT_TEST tests FIEDLER_DETERMINANT.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    31 January 2015
#
#  Author:
#
#    John Burkardt
#
  from fiedler import fiedler
  from r8vec_uniform_ab import r8vec_uniform_ab
  from r8mat_print import r8mat_print

  print ''
  print 'FIEDLER_DETERMINANT_TEST'
  print '  FIEDLER_DETERMINANT computes the FIEDLER determinant.'

  m = 5
  n = m
  x_lo = -5.0
  x_hi = +5.0
  seed = 123456789
  x, seed = r8vec_uniform_ab ( n, x_lo, x_hi, seed )

  a = fiedler ( m, n, x )

  r8mat_print ( m, n, a, '  FIEDLER matrix:' )

  value = fiedler_determinant ( n, x )

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

  print ''
  print 'FIEDLER_DETERMINANT_TEST'
  print '  Normal end of execution.'

  return
开发者ID:johannesgerer,项目名称:jburkardt-py,代码行数:47,代码来源:fiedler.py


示例19: milnes_determinant_test

def milnes_determinant_test ( ):

#*****************************************************************************80
#
## MILNES_DETERMINANT_TEST tests MILNES_DETERMINANT.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    19 February 2015
#
#  Author:
#
#    John Burkardt
#
  from milnes import milnes
  from r8vec_uniform_ab import r8vec_uniform_ab
  from r8mat_print import r8mat_print

  print ''
  print 'MILNES_DETERMINANT_TEST'
  print '  MILNES_DETERMINANT computes the MILNES determinant.'

  m = 5
  n = m
  r8_lo = -5.0
  r8_hi = +5.0
  seed = 123456789
  x, seed = r8vec_uniform_ab ( n, r8_lo, r8_hi, seed )

  a = milnes ( m, n, x )

  r8mat_print ( m, n, a, '  MILNES matrix:' )

  value = milnes_determinant ( n, x )

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

  print ''
  print 'MILNES_DETERMINANT_TEST'
  print '  Normal end of execution.'

  return
开发者ID:johannesgerer,项目名称:jburkardt-py,代码行数:47,代码来源:milnes.py


示例20: vand2_determinant_test

def vand2_determinant_test ( ):

#*****************************************************************************80
#
## VAND2_DETERMINANT_TEST tests VAND2_DETERMINANT.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    27 February 2015
#
#  Author:
#
#    John Burkardt
#
  from vand2 import vand2
  from r8vec_uniform_ab import r8vec_uniform_ab
  from r8mat_print import r8mat_print

  print ''
  print 'VAND2_DETERMINANT_TEST'
  print '  VAND2_DETERMINANT computes the VAND2 determinant.'

  m = 5
  n = m
  r8_lo = -5.0
  r8_hi = +5.0
  seed = 123456789
  x, seed = r8vec_uniform_ab ( n, r8_lo, r8_hi, seed )

  a = vand2 ( n, x )

  r8mat_print ( m, n, a, '  VAND2 matrix:' )

  value = vand2_determinant ( n, x )

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

  print ''
  print 'VAND2_DETERMINANT_TEST'
  print '  Normal end of execution.'

  return
开发者ID:johannesgerer,项目名称:jburkardt-py,代码行数:47,代码来源:vand2.py



注:本文中的r8vec_uniform_ab.r8vec_uniform_ab函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python rabbit_helper.RabbitHelper类代码示例发布时间:2022-05-26
下一篇:
Python r8mat_print.r8mat_print函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap