• 100.00% Rate
  • 10 Hits
  • 0 Missed
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 1x
  • 1x
  • 1x
  • 1x
  • 1x
  • 8x
  • 1x
  • 6x
  • 6x
  • 1x
  • -------------------------------------------------------------------------------
  • -- PUMAS Physical constants
  • -- Author: Valentin Niess
  • -- License: GNU LGPL-3.0
  • -------------------------------------------------------------------------------
  • local ffi = require('ffi')
  • local clib = require('pumas.clib')
  • local readonly = require('pumas.readonly')
  • local constants = {}
  • -------------------------------------------------------------------------------
  • -- Get constants from the PUMAS library
  • -------------------------------------------------------------------------------
  • do
  • local value = ffi.new('double [1]')
  • for _, k in ipairs{'AVOGADRO_NUMBER', 'ELECTRON_MASS', 'MUON_C_TAU',
  • 'MUON_MASS', 'TAU_C_TAU', 'TAU_MASS'} do
  • clib.pumas_constant(ffi.C['PUMAS_CONSTANT_'..k], value)
  • constants[k] = tonumber(value[0])
  • end
  • end
  • -------------------------------------------------------------------------------
  • -- Return the package
  • -------------------------------------------------------------------------------
  • return readonly.Readonly(constants, 'constants')